forked from vnotex/vnote
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvconstants.h
More file actions
182 lines (153 loc) · 4.87 KB
/
vconstants.h
File metadata and controls
182 lines (153 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#ifndef VCONSTANTS_H
#define VCONSTANTS_H
#include <QString>
#include <QStringList>
typedef unsigned long long TimeStamp;
// Html: rich text file;
// Markdown: Markdown text file;
// List: Infinite list file like WorkFlowy;
// Container: a composite file containing multiple files;
enum class DocType { Html = 0, Markdown, List, Container, Unknown };
// Note: note file managed by VNote;
// Orphan: external file;
enum class FileType { Note, Orphan };
enum class ClipboardOpType { CopyFile, CopyDir, Invalid };
namespace ClipboardConfig
{
static const QString c_type = "type";
static const QString c_magic = "magic";
static const QString c_isCut = "is_cut";
static const QString c_files = "files";
static const QString c_dirs = "dirs";
static const QString c_format = "text/json";
}
enum class OpenFileMode {Read = 0, Edit, Invalid };
static const qreal c_webZoomFactorMax = 5;
static const qreal c_webZoomFactorMin = 0.25;
static const int c_editorZoomDeltaMax = 10;
static const int c_editorZoomDeltaMin = -10;
static const int c_tabSequenceBase = 1;
// HTML and JS.
namespace HtmlHolder
{
static const QString c_JSHolder = "JS_PLACE_HOLDER";
static const QString c_cssHolder = "CSS_PLACE_HOLDER";
static const QString c_codeBlockCssHolder = "HIGHLIGHTJS_CSS_PLACE_HOLDER";
static const QString c_commonCssHolder = "COMMON_CSS_PLACE_HOLDER";
static const QString c_globalStyleHolder = "/* STYLE_GLOBAL_PLACE_HOLDER */";
static const QString c_extraHolder = "<!-- EXTRA_PLACE_HOLDER -->";
static const QString c_bodyHolder = "<!-- BODY_PLACE_HOLDER -->";
static const QString c_headHolder = "<!-- HEAD_PLACE_HOLDER -->";
static const QString c_styleHolder = "/* STYLE_PLACE_HOLDER */";
static const QString c_outlineStyleHolder = "/* STYLE_OUTLINE_PLACE_HOLDER */";
static const QString c_headTitleHolder = "<!-- HEAD_TITLE_PLACE_HOLDER -->";
}
// Directory Config file items.
namespace DirConfig
{
static const QString c_version = "version";
static const QString c_subDirectories = "sub_directories";
static const QString c_files = "files";
static const QString c_attachments = "attachments";
static const QString c_imageFolder = "image_folder";
static const QString c_attachmentFolder = "attachment_folder";
static const QString c_recycleBinFolder = "recycle_bin_folder";
static const QString c_tags = "tags";
static const QString c_name = "name";
static const QString c_createdTime = "created_time";
static const QString c_modifiedTime = "modified_time";
}
// Snippet Cofnig file items.
namespace SnippetConfig
{
static const QString c_version = "version";
static const QString c_snippets = "snippets";
static const QString c_name = "name";
static const QString c_type = "type";
static const QString c_cursorMark = "cursor_mark";
static const QString c_selectionMark = "selection_mark";
static const QString c_shortcut = "shortcut";
static const QString c_autoIndent = "auto_indent";
}
namespace Shortcut
{
static const QString c_expand = "Ctrl+B";
static const QString c_info = "F2";
static const QString c_copy = "Ctrl+C";
static const QString c_cut = "Ctrl+X";
static const QString c_paste = "Ctrl+V";
}
static const QString c_emptyHeaderName = "[EMPTY]";
enum class TextDecoration
{
None,
Bold,
Italic,
Underline,
Strikethrough,
InlineCode,
CodeBlock,
Heading
};
enum FindOption
{
CaseSensitive = 0x1U,
WholeWordOnly = 0x2U,
RegularExpression = 0x4U,
IncrementalSearch = 0x8U
};
enum class ImageProperty {/* ID of the image preview (long long). Unique for each source. */
ImageID = 1,
/* Source type of the preview, such as image, codeblock. */
ImageSource,
/* Type of the preview, block or inline. */
ImageType };
enum class PreviewImageType { Block, Inline, Invalid };
enum class PreviewImageSource { Image, CodeBlock, Invalid };
enum HighlightBlockState
{
Normal = -1,
// A fenced code block.
CodeBlockStart,
CodeBlock,
CodeBlockEnd,
HRule
};
// Pages to open on start up.
enum class StartupPageType
{
None = 0,
ContinueLeftOff = 1,
SpecificPages = 2,
Invalid
};
// Cursor block mode.
enum class CursorBlock
{
None = 0,
// Display a cursor block on the character on the right side of the cursor.
RightSide,
// Display a cursor block on the character on the left side of the cursor.
LeftSide
};
enum class UpdateAction
{
// The info of a file/directory has been changed.
InfoChanged = 0,
// The file/directory has been moved.
Moved
};
enum MarkdownConverterType
{
Hoedown = 0,
Marked,
MarkdownIt,
Showdown
};
enum PlantUMLMode
{
DisablePlantUML = 0,
OnlinePlantUML = 1,
LocalPlantUML = 2
};
#endif