2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2019-06-12 12:55:06 +02:00
|
|
|
#include "texteditor_global.h"
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QtGlobal>
|
2009-11-27 16:12:12 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace TextEditor {
|
2012-04-26 14:17:42 +02:00
|
|
|
|
|
|
|
|
// Text color and style categories
|
2016-02-22 15:54:14 +01:00
|
|
|
enum TextStyle : quint8 {
|
2012-04-26 14:17:42 +02:00
|
|
|
C_TEXT,
|
|
|
|
|
|
|
|
|
|
C_LINK,
|
|
|
|
|
C_SELECTION,
|
|
|
|
|
C_LINE_NUMBER,
|
|
|
|
|
C_SEARCH_RESULT,
|
2020-09-10 14:33:14 +02:00
|
|
|
C_SEARCH_RESULT_ALT1,
|
|
|
|
|
C_SEARCH_RESULT_ALT2,
|
2012-04-26 14:17:42 +02:00
|
|
|
C_SEARCH_SCOPE,
|
|
|
|
|
C_PARENTHESES,
|
2015-04-28 11:04:07 +02:00
|
|
|
C_PARENTHESES_MISMATCH,
|
2016-04-28 12:51:34 +02:00
|
|
|
C_AUTOCOMPLETE,
|
2012-04-26 14:17:42 +02:00
|
|
|
C_CURRENT_LINE,
|
|
|
|
|
C_CURRENT_LINE_NUMBER,
|
|
|
|
|
C_OCCURRENCES,
|
|
|
|
|
C_OCCURRENCES_UNUSED,
|
|
|
|
|
C_OCCURRENCES_RENAME,
|
|
|
|
|
|
|
|
|
|
C_NUMBER,
|
|
|
|
|
C_STRING,
|
|
|
|
|
C_TYPE,
|
2021-10-27 15:52:20 +02:00
|
|
|
C_NAMESPACE,
|
2012-04-26 14:17:42 +02:00
|
|
|
C_LOCAL,
|
2021-03-03 19:32:48 +01:00
|
|
|
C_PARAMETER,
|
2016-03-07 11:59:01 +01:00
|
|
|
C_GLOBAL,
|
2012-04-26 14:17:42 +02:00
|
|
|
C_FIELD,
|
2012-08-27 10:42:42 +02:00
|
|
|
C_ENUMERATION,
|
2012-04-26 14:17:42 +02:00
|
|
|
C_VIRTUAL_METHOD,
|
2010-10-18 17:45:49 +02:00
|
|
|
C_FUNCTION,
|
2012-04-26 14:17:42 +02:00
|
|
|
C_KEYWORD,
|
2014-06-21 14:31:06 +04:00
|
|
|
C_PRIMITIVE_TYPE,
|
2012-04-26 14:17:42 +02:00
|
|
|
C_OPERATOR,
|
2016-11-05 15:29:10 +01:00
|
|
|
C_OVERLOADED_OPERATOR,
|
2018-08-22 17:25:12 +02:00
|
|
|
C_PUNCTUATION,
|
2012-04-26 14:17:42 +02:00
|
|
|
C_PREPROCESSOR,
|
|
|
|
|
C_LABEL,
|
|
|
|
|
C_COMMENT,
|
|
|
|
|
C_DOXYGEN_COMMENT,
|
|
|
|
|
C_DOXYGEN_TAG,
|
|
|
|
|
C_VISUAL_WHITESPACE,
|
|
|
|
|
C_QML_LOCAL_ID,
|
|
|
|
|
C_QML_EXTERNAL_ID,
|
|
|
|
|
C_QML_TYPE_ID,
|
|
|
|
|
C_QML_ROOT_OBJECT_PROPERTY,
|
|
|
|
|
C_QML_SCOPE_OBJECT_PROPERTY,
|
|
|
|
|
C_QML_EXTERNAL_OBJECT_PROPERTY,
|
|
|
|
|
C_JS_SCOPE_VAR,
|
|
|
|
|
C_JS_IMPORT_VAR,
|
|
|
|
|
C_JS_GLOBAL_VAR,
|
|
|
|
|
C_QML_STATE_NAME,
|
|
|
|
|
C_BINDING,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
C_DISABLED_CODE,
|
|
|
|
|
|
|
|
|
|
C_ADDED_LINE,
|
|
|
|
|
C_REMOVED_LINE,
|
|
|
|
|
C_DIFF_FILE,
|
|
|
|
|
C_DIFF_LOCATION,
|
|
|
|
|
|
2013-06-05 15:25:42 +02:00
|
|
|
C_DIFF_FILE_LINE,
|
|
|
|
|
C_DIFF_CONTEXT_LINE,
|
|
|
|
|
C_DIFF_SOURCE_LINE,
|
|
|
|
|
C_DIFF_SOURCE_CHAR,
|
|
|
|
|
C_DIFF_DEST_LINE,
|
|
|
|
|
C_DIFF_DEST_CHAR,
|
|
|
|
|
|
2015-03-25 10:30:24 +02:00
|
|
|
C_LOG_CHANGE_LINE,
|
2020-07-01 21:31:09 +02:00
|
|
|
C_LOG_AUTHOR_NAME,
|
|
|
|
|
C_LOG_COMMIT_DATE,
|
|
|
|
|
C_LOG_COMMIT_HASH,
|
|
|
|
|
C_LOG_COMMIT_SUBJECT,
|
|
|
|
|
C_LOG_DECORATION,
|
2015-03-25 10:30:24 +02:00
|
|
|
|
2015-09-10 14:18:09 +02:00
|
|
|
C_WARNING,
|
|
|
|
|
C_WARNING_CONTEXT,
|
|
|
|
|
C_ERROR,
|
|
|
|
|
C_ERROR_CONTEXT,
|
|
|
|
|
|
2016-03-02 11:24:03 +01:00
|
|
|
C_DECLARATION,
|
2016-07-17 00:29:33 +02:00
|
|
|
C_FUNCTION_DEFINITION,
|
2016-10-11 18:19:12 +02:00
|
|
|
C_OUTPUT_ARGUMENT,
|
2021-10-27 13:46:15 +02:00
|
|
|
C_STATIC_MEMBER,
|
2016-03-02 11:24:03 +01:00
|
|
|
|
2012-04-26 14:17:42 +02:00
|
|
|
C_LAST_STYLE_SENTINEL
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Constants {
|
|
|
|
|
|
2011-11-02 16:45:13 +01:00
|
|
|
const char C_TEXTEDITOR[] = "Text Editor";
|
2018-03-22 09:52:49 +01:00
|
|
|
const char M_STANDARDCONTEXTMENU[] = "TextEditor.StandardContextMenu";
|
|
|
|
|
const char G_UNDOREDO[] = "TextEditor.UndoRedoGroup";
|
|
|
|
|
const char G_COPYPASTE[] = "TextEditor.CopyPasteGroup";
|
|
|
|
|
const char G_SELECT[] = "TextEditor.SelectGroup";
|
|
|
|
|
const char G_BOM[] = "TextEditor.BomGroup";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char COMPLETE_THIS[] = "TextEditor.CompleteThis";
|
2020-07-31 16:50:03 +02:00
|
|
|
const char FUNCTION_HINT[] = "TextEditor.FunctionHint";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char QUICKFIX_THIS[] = "TextEditor.QuickFix";
|
2017-06-01 17:15:35 +02:00
|
|
|
const char SHOWCONTEXTMENU[] = "TextEditor.ShowContextMenu";
|
2013-04-05 14:33:23 +02:00
|
|
|
const char CREATE_SCRATCH_BUFFER[] = "TextEditor.CreateScratchBuffer";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char VISUALIZE_WHITESPACE[] = "TextEditor.VisualizeWhitespace";
|
|
|
|
|
const char CLEAN_WHITESPACE[] = "TextEditor.CleanWhitespace";
|
|
|
|
|
const char TEXT_WRAPPING[] = "TextEditor.TextWrapping";
|
|
|
|
|
const char UN_COMMENT_SELECTION[] = "TextEditor.UnCommentSelection";
|
|
|
|
|
const char FOLD[] = "TextEditor.Fold";
|
|
|
|
|
const char UNFOLD[] = "TextEditor.Unfold";
|
|
|
|
|
const char UNFOLD_ALL[] = "TextEditor.UnFoldAll";
|
|
|
|
|
const char AUTO_INDENT_SELECTION[] = "TextEditor.AutoIndentSelection";
|
2019-11-18 10:38:35 +01:00
|
|
|
const char AUTO_FORMAT_SELECTION[] = "TextEditor.AutoFormatSelection";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char INCREASE_FONT_SIZE[] = "TextEditor.IncreaseFontSize";
|
|
|
|
|
const char DECREASE_FONT_SIZE[] = "TextEditor.DecreaseFontSize";
|
|
|
|
|
const char RESET_FONT_SIZE[] = "TextEditor.ResetFontSize";
|
|
|
|
|
const char GOTO_BLOCK_START[] = "TextEditor.GotoBlockStart";
|
|
|
|
|
const char GOTO_BLOCK_START_WITH_SELECTION[] = "TextEditor.GotoBlockStartWithSelection";
|
|
|
|
|
const char GOTO_BLOCK_END[] = "TextEditor.GotoBlockEnd";
|
|
|
|
|
const char GOTO_BLOCK_END_WITH_SELECTION[] = "TextEditor.GotoBlockEndWithSelection";
|
|
|
|
|
const char SELECT_BLOCK_UP[] = "TextEditor.SelectBlockUp";
|
|
|
|
|
const char SELECT_BLOCK_DOWN[] = "TextEditor.SelectBlockDown";
|
2016-08-02 08:17:35 +02:00
|
|
|
const char SELECT_WORD_UNDER_CURSOR[] = "TextEditor.SelectWordUnderCursor";
|
2014-06-02 14:21:46 +02:00
|
|
|
const char VIEW_PAGE_UP[] = "TextEditor.viewPageUp";
|
|
|
|
|
const char VIEW_PAGE_DOWN[] = "TextEditor.viewPageDown";
|
|
|
|
|
const char VIEW_LINE_UP[] = "TextEditor.viewLineUp";
|
|
|
|
|
const char VIEW_LINE_DOWN[] = "TextEditor.viewLineDown";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char MOVE_LINE_UP[] = "TextEditor.MoveLineUp";
|
|
|
|
|
const char MOVE_LINE_DOWN[] = "TextEditor.MoveLineDown";
|
|
|
|
|
const char COPY_LINE_UP[] = "TextEditor.CopyLineUp";
|
|
|
|
|
const char COPY_LINE_DOWN[] = "TextEditor.CopyLineDown";
|
|
|
|
|
const char JOIN_LINES[] = "TextEditor.JoinLines";
|
|
|
|
|
const char INSERT_LINE_ABOVE[] = "TextEditor.InsertLineAboveCurrentLine";
|
|
|
|
|
const char INSERT_LINE_BELOW[] = "TextEditor.InsertLineBelowCurrentLine";
|
|
|
|
|
const char UPPERCASE_SELECTION[] = "TextEditor.UppercaseSelection";
|
|
|
|
|
const char LOWERCASE_SELECTION[] = "TextEditor.LowercaseSelection";
|
2017-08-13 20:38:08 +03:00
|
|
|
const char SORT_SELECTED_LINES[] = "TextEditor.SortSelectedLines";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char CUT_LINE[] = "TextEditor.CutLine";
|
|
|
|
|
const char COPY_LINE[] = "TextEditor.CopyLine";
|
2022-04-11 14:43:47 +02:00
|
|
|
const char ADD_SELECT_NEXT_FIND_MATCH[] = "TextEditor.AddSelectionNextFindMatch";
|
2016-09-26 15:55:04 +02:00
|
|
|
const char DUPLICATE_SELECTION[] = "TextEditor.DuplicateSelection";
|
|
|
|
|
const char DUPLICATE_SELECTION_AND_COMMENT[] = "TextEditor.DuplicateSelectionAndComment";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char DELETE_LINE[] = "TextEditor.DeleteLine";
|
|
|
|
|
const char DELETE_END_OF_WORD[] = "TextEditor.DeleteEndOfWord";
|
2017-04-26 10:48:48 +02:00
|
|
|
const char DELETE_END_OF_LINE[] = "TextEditor.DeleteEndOfLine";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char DELETE_END_OF_WORD_CAMEL_CASE[] = "TextEditor.DeleteEndOfWordCamelCase";
|
|
|
|
|
const char DELETE_START_OF_WORD[] = "TextEditor.DeleteStartOfWord";
|
2017-04-26 10:48:48 +02:00
|
|
|
const char DELETE_START_OF_LINE[] = "TextEditor.DeleteStartOfLine";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char DELETE_START_OF_WORD_CAMEL_CASE[] = "TextEditor.DeleteStartOfWordCamelCase";
|
|
|
|
|
const char SELECT_ENCODING[] = "TextEditor.SelectEncoding";
|
|
|
|
|
const char REWRAP_PARAGRAPH[] = "TextEditor.RewrapParagraph";
|
2018-02-12 15:07:45 +01:00
|
|
|
const char GOTO_DOCUMENT_START[] = "TextEditor.GotoDocumentStart";
|
|
|
|
|
const char GOTO_DOCUMENT_END[] = "TextEditor.GotoDocumentEnd";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char GOTO_LINE_START[] = "TextEditor.GotoLineStart";
|
|
|
|
|
const char GOTO_LINE_END[] = "TextEditor.GotoLineEnd";
|
|
|
|
|
const char GOTO_NEXT_LINE[] = "TextEditor.GotoNextLine";
|
|
|
|
|
const char GOTO_PREVIOUS_LINE[] = "TextEditor.GotoPreviousLine";
|
|
|
|
|
const char GOTO_PREVIOUS_CHARACTER[] = "TextEditor.GotoPreviousCharacter";
|
|
|
|
|
const char GOTO_NEXT_CHARACTER[] = "TextEditor.GotoNextCharacter";
|
|
|
|
|
const char GOTO_PREVIOUS_WORD[] = "TextEditor.GotoPreviousWord";
|
|
|
|
|
const char GOTO_NEXT_WORD[] = "TextEditor.GotoNextWord";
|
|
|
|
|
const char GOTO_PREVIOUS_WORD_CAMEL_CASE[] = "TextEditor.GotoPreviousWordCamelCase";
|
|
|
|
|
const char GOTO_NEXT_WORD_CAMEL_CASE[] = "TextEditor.GotoNextWordCamelCase";
|
|
|
|
|
const char GOTO_LINE_START_WITH_SELECTION[] = "TextEditor.GotoLineStartWithSelection";
|
|
|
|
|
const char GOTO_LINE_END_WITH_SELECTION[] = "TextEditor.GotoLineEndWithSelection";
|
|
|
|
|
const char GOTO_NEXT_LINE_WITH_SELECTION[] = "TextEditor.GotoNextLineWithSelection";
|
|
|
|
|
const char GOTO_PREVIOUS_LINE_WITH_SELECTION[] = "TextEditor.GotoPreviousLineWithSelection";
|
|
|
|
|
const char GOTO_PREVIOUS_CHARACTER_WITH_SELECTION[] = "TextEditor.GotoPreviousCharacterWithSelection";
|
|
|
|
|
const char GOTO_NEXT_CHARACTER_WITH_SELECTION[] = "TextEditor.GotoNextCharacterWithSelection";
|
|
|
|
|
const char GOTO_PREVIOUS_WORD_WITH_SELECTION[] = "TextEditor.GotoPreviousWordWithSelection";
|
|
|
|
|
const char GOTO_NEXT_WORD_WITH_SELECTION[] = "TextEditor.GotoNextWordWithSelection";
|
|
|
|
|
const char GOTO_PREVIOUS_WORD_CAMEL_CASE_WITH_SELECTION[] = "TextEditor.GotoPreviousWordCamelCaseWithSelection";
|
|
|
|
|
const char GOTO_NEXT_WORD_CAMEL_CASE_WITH_SELECTION[] = "TextEditor.GotoNextWordCamelCaseWithSelection";
|
|
|
|
|
const char C_TEXTEDITOR_MIMETYPE_TEXT[] = "text/plain";
|
2019-02-07 08:50:16 +01:00
|
|
|
const char INFO_MISSING_SYNTAX_DEFINITION[] = "TextEditor.InfoSyntaxDefinition";
|
|
|
|
|
const char INFO_MULTIPLE_SYNTAX_DEFINITIONS[] = "TextEditor.InfoMultipleSyntaxDefinitions";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char TASK_OPEN_FILE[] = "TextEditor.Task.OpenFile";
|
2011-12-13 12:15:30 +01:00
|
|
|
const char CIRCULAR_PASTE[] = "TextEditor.CircularPaste";
|
2020-11-18 08:30:05 +01:00
|
|
|
const char NO_FORMAT_PASTE[] = "TextEditor.NoFormatPaste";
|
2012-03-02 08:16:23 +08:00
|
|
|
const char SWITCH_UTF8BOM[] = "TextEditor.SwitchUtf8bom";
|
2012-01-22 17:05:02 -05:00
|
|
|
const char INDENT[] = "TextEditor.Indent";
|
|
|
|
|
const char UNINDENT[] = "TextEditor.Unindent";
|
2012-03-27 23:18:46 +04:00
|
|
|
const char FOLLOW_SYMBOL_UNDER_CURSOR[] = "TextEditor.FollowSymbolUnderCursor";
|
2013-02-05 14:14:33 +01:00
|
|
|
const char FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT[] = "TextEditor.FollowSymbolUnderCursorInNextSplit";
|
2018-11-28 07:26:14 +01:00
|
|
|
const char FIND_USAGES[] = "TextEditor.FindUsages";
|
2020-05-06 07:30:33 +02:00
|
|
|
// moved from CppEditor to TextEditor avoid breaking the setting by using the old key
|
|
|
|
|
const char RENAME_SYMBOL[] = "CppEditor.RenameSymbolUnderCursor";
|
2012-03-27 23:18:46 +04:00
|
|
|
const char JUMP_TO_FILE_UNDER_CURSOR[] = "TextEditor.JumpToFileUnderCursor";
|
2013-02-05 14:14:33 +01:00
|
|
|
const char JUMP_TO_FILE_UNDER_CURSOR_IN_NEXT_SPLIT[] = "TextEditor.JumpToFileUnderCursorInNextSplit";
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-06-04 10:43:34 +02:00
|
|
|
const char SCROLL_BAR_SEARCH_RESULT[] = "TextEditor.ScrollBarSearchResult";
|
|
|
|
|
const char SCROLL_BAR_CURRENT_LINE[] = "TextEditor.ScrollBarCurrentLine";
|
|
|
|
|
|
2019-06-12 12:55:06 +02:00
|
|
|
const TEXTEDITOR_EXPORT char *nameForStyle(TextStyle style);
|
2012-04-26 14:17:42 +02:00
|
|
|
TextStyle styleFromName(const char *name);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2020-01-15 15:00:57 +01:00
|
|
|
const char TEXT_EDITOR_SETTINGS_CATEGORY_ICON_PATH[] = ":/texteditor/images/settingscategory_texteditor.png";
|
2011-11-02 16:45:13 +01:00
|
|
|
const char TEXT_EDITOR_SETTINGS_CATEGORY[] = "C.TextEditor";
|
|
|
|
|
const char TEXT_EDITOR_FONT_SETTINGS[] = "A.FontSettings";
|
|
|
|
|
const char TEXT_EDITOR_BEHAVIOR_SETTINGS[] = "B.BehaviourSettings";
|
|
|
|
|
const char TEXT_EDITOR_DISPLAY_SETTINGS[] = "D.DisplaySettings";
|
|
|
|
|
const char TEXT_EDITOR_HIGHLIGHTER_SETTINGS[] = "E.HighlighterSettings";
|
|
|
|
|
const char TEXT_EDITOR_SNIPPETS_SETTINGS[] = "F.SnippetsSettings";
|
2010-10-27 17:38:22 +02:00
|
|
|
|
2019-02-07 13:40:39 +01:00
|
|
|
const char HIGHLIGHTER_SETTINGS_CATEGORY[] = "HighlighterSettings";
|
|
|
|
|
|
2011-11-02 16:45:13 +01:00
|
|
|
const char SNIPPET_EDITOR_ID[] = "TextEditor.SnippetEditor";
|
|
|
|
|
const char TEXT_SNIPPET_GROUP_ID[] = "Text";
|
2009-10-01 13:34:02 +02:00
|
|
|
|
2011-11-02 16:45:13 +01:00
|
|
|
const char GLOBAL_SETTINGS_ID[] = "Global";
|
2021-08-13 10:49:30 +02:00
|
|
|
const char GENERIC_PROPOSAL_ID[] = "TextEditor.GenericProposalId";
|
2011-06-20 16:23:40 +02:00
|
|
|
|
2012-07-10 20:30:31 +04:00
|
|
|
/**
|
|
|
|
|
* Delay before tooltip will be shown near completion assistant proposal
|
|
|
|
|
*/
|
|
|
|
|
const unsigned COMPLETION_ASSIST_TOOLTIP_DELAY = 100;
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
} // namespace Constants
|
|
|
|
|
} // namespace TextEditor
|