vconstants.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef VCONSTANTS_H
  2. #define VCONSTANTS_H
  3. // Html: rich text file;
  4. // Markdown: Markdown text file;
  5. // List: Infinite list file like WorkFlowy;
  6. // Container: a composite file containing multiple files;
  7. enum class DocType { Html = 0, Markdown, List, Container, Invalid };
  8. // Normal: note file managed by VNote;
  9. // Orphan: external file;
  10. enum class FileType { Normal, Orphan };
  11. enum class ClipboardOpType { Invalid, CopyFile, CopyDir };
  12. enum class OpenFileMode {Read = 0, Edit};
  13. static const qreal c_webZoomFactorMax = 5;
  14. static const qreal c_webZoomFactorMin = 0.25;
  15. static const int c_tabSequenceBase = 1;
  16. // HTML and JS.
  17. static const QString c_htmlJSHolder = "JS_PLACE_HOLDER";
  18. static const QString c_htmlExtraHolder = "<!-- EXTRA_PLACE_HOLDER -->";
  19. // Directory Config file items.
  20. namespace DirConfig
  21. {
  22. static const QString c_version = "version";
  23. static const QString c_subDirectories = "sub_directories";
  24. static const QString c_files = "files";
  25. static const QString c_imageFolder = "image_folder";
  26. static const QString c_name = "name";
  27. static const QString c_createdTime = "created_time";
  28. static const QString c_modifiedTime = "modified_time";
  29. }
  30. static const QString c_emptyHeaderName = "[EMPTY]";
  31. enum class TextDecoration { None,
  32. Bold,
  33. Italic,
  34. Underline,
  35. Strikethrough,
  36. InlineCode };
  37. enum FindOption
  38. {
  39. CaseSensitive = 0x1U,
  40. WholeWordOnly = 0x2U,
  41. RegularExpression = 0x4U,
  42. IncrementalSearch = 0x8U
  43. };
  44. enum class ImageProperty {/* ID of the image preview (long long). Unique for each source. */
  45. ImageID = 1,
  46. /* Source type of the preview, such as image, codeblock. */
  47. ImageSource,
  48. /* Type of the preview, block or inline. */
  49. ImageType };
  50. enum class PreviewImageType { Block, Inline, Invalid };
  51. enum class PreviewImageSource { Image, CodeBlock, Invalid };
  52. enum HighlightBlockState
  53. {
  54. Normal = 0,
  55. // A fenced code block.
  56. CodeBlockStart,
  57. CodeBlock,
  58. CodeBlockEnd,
  59. // This block is inside a HTML comment region.
  60. Comment
  61. };
  62. enum class LineNumberType
  63. {
  64. None = 0,
  65. Absolute,
  66. Relative,
  67. CodeBlock
  68. };
  69. #endif