xlsxformat_p.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /****************************************************************************
  2. ** Copyright (c) 2013-2014 Debao Zhang <hello@debao.me>
  3. ** All right reserved.
  4. **
  5. ** Permission is hereby granted, free of charge, to any person obtaining
  6. ** a copy of this software and associated documentation files (the
  7. ** "Software"), to deal in the Software without restriction, including
  8. ** without limitation the rights to use, copy, modify, merge, publish,
  9. ** distribute, sublicense, and/or sell copies of the Software, and to
  10. ** permit persons to whom the Software is furnished to do so, subject to
  11. ** the following conditions:
  12. **
  13. ** The above copyright notice and this permission notice shall be
  14. ** included in all copies or substantial portions of the Software.
  15. **
  16. ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  20. ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  21. ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22. ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. **
  24. ****************************************************************************/
  25. #ifndef XLSXFORMAT_P_H
  26. #define XLSXFORMAT_P_H
  27. //
  28. // W A R N I N G
  29. // -------------
  30. //
  31. // This file is not part of the Qt Xlsx API. It exists for the convenience
  32. // of the Qt Xlsx. This header file may change from
  33. // version to version without notice, or even be removed.
  34. //
  35. // We mean it.
  36. //
  37. #include "xlsxformat.h"
  38. #include <QSharedData>
  39. #include <QMap>
  40. #include <QSet>
  41. namespace QXlsx {
  42. class FormatPrivate : public QSharedData
  43. {
  44. public:
  45. enum FormatType
  46. {
  47. FT_Invalid = 0,
  48. FT_NumFmt = 0x01,
  49. FT_Font = 0x02,
  50. FT_Alignment = 0x04,
  51. FT_Border = 0x08,
  52. FT_Fill = 0x10,
  53. FT_Protection = 0x20
  54. };
  55. enum Property {
  56. P_STARTID,
  57. //numFmt
  58. P_NumFmt_Id,
  59. P_NumFmt_FormatCode,
  60. //font
  61. P_Font_STARTID,
  62. P_Font_Size = P_Font_STARTID,
  63. P_Font_Italic,
  64. P_Font_StrikeOut,
  65. P_Font_Color,
  66. P_Font_Bold,
  67. P_Font_Script,
  68. P_Font_Underline,
  69. P_Font_Outline,
  70. P_Font_Shadow,
  71. P_Font_Name,
  72. P_Font_Family,
  73. P_Font_Charset,
  74. P_Font_Scheme,
  75. P_Font_Condense,
  76. P_Font_Extend,
  77. P_Font_ENDID,
  78. //border
  79. P_Border_STARTID,
  80. P_Border_LeftStyle = P_Border_STARTID,
  81. P_Border_RightStyle,
  82. P_Border_TopStyle,
  83. P_Border_BottomStyle,
  84. P_Border_DiagonalStyle,
  85. P_Border_LeftColor,
  86. P_Border_RightColor,
  87. P_Border_TopColor,
  88. P_Border_BottomColor,
  89. P_Border_DiagonalColor,
  90. P_Border_DiagonalType,
  91. P_Border_ENDID,
  92. //fill
  93. P_Fill_STARTID,
  94. P_Fill_Pattern = P_Fill_STARTID,
  95. P_Fill_BgColor,
  96. P_Fill_FgColor,
  97. P_Fill_ENDID,
  98. //alignment
  99. P_Alignment_STARTID,
  100. P_Alignment_AlignH = P_Alignment_STARTID,
  101. P_Alignment_AlignV,
  102. P_Alignment_Wrap,
  103. P_Alignment_Rotation,
  104. P_Alignment_Indent,
  105. P_Alignment_ShinkToFit,
  106. P_Alignment_ENDID,
  107. //protection
  108. P_Protection_Locked,
  109. P_Protection_Hidden,
  110. P_ENDID
  111. };
  112. FormatPrivate();
  113. FormatPrivate(const FormatPrivate &other);
  114. ~FormatPrivate();
  115. bool dirty; //The key re-generation is need.
  116. QByteArray formatKey;
  117. bool font_dirty;
  118. bool font_index_valid;
  119. QByteArray font_key;
  120. int font_index;
  121. bool fill_dirty;
  122. bool fill_index_valid;
  123. QByteArray fill_key;
  124. int fill_index;
  125. bool border_dirty;
  126. bool border_index_valid;
  127. QByteArray border_key;
  128. int border_index;
  129. int xf_index;
  130. bool xf_indexValid;
  131. bool is_dxf_fomat;
  132. int dxf_index;
  133. bool dxf_indexValid;
  134. int theme;
  135. QMap<int, QVariant> properties;
  136. };
  137. }
  138. #endif // XLSXFORMAT_P_H