xlsxworkbook_p.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 XLSXWORKBOOK_P_H
  26. #define XLSXWORKBOOK_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 "xlsxworkbook.h"
  38. #include "xlsxabstractooxmlfile_p.h"
  39. #include "xlsxtheme_p.h"
  40. #include "xlsxsimpleooxmlfile_p.h"
  41. #include "xlsxrelationships_p.h"
  42. #include <QSharedPointer>
  43. #include <QPair>
  44. #include <QStringList>
  45. namespace QXlsx {
  46. struct XlsxDefineNameData
  47. {
  48. XlsxDefineNameData()
  49. :sheetId(-1)
  50. {}
  51. XlsxDefineNameData(const QString &name, const QString &formula, const QString &comment, int sheetId=-1)
  52. :name(name), formula(formula), comment(comment), sheetId(sheetId)
  53. {
  54. }
  55. QString name;
  56. QString formula;
  57. QString comment;
  58. //using internal sheetId, instead of the localSheetId(order in the workbook)
  59. int sheetId;
  60. };
  61. class WorkbookPrivate : public AbstractOOXmlFilePrivate
  62. {
  63. Q_DECLARE_PUBLIC(Workbook)
  64. public:
  65. WorkbookPrivate(Workbook *q, Workbook::CreateFlag flag);
  66. QSharedPointer<SharedStrings> sharedStrings;
  67. QList<QSharedPointer<AbstractSheet> > sheets;
  68. QList<QSharedPointer<SimpleOOXmlFile> > externalLinks;
  69. QStringList sheetNames;
  70. QSharedPointer<Styles> styles;
  71. QSharedPointer<Theme> theme;
  72. QList<QSharedPointer<MediaFile> > mediaFiles;
  73. QList<QSharedPointer<Chart> > chartFiles;
  74. QList<XlsxDefineNameData> definedNamesList;
  75. bool strings_to_numbers_enabled;
  76. bool strings_to_hyperlinks_enabled;
  77. bool html_to_richstring_enabled;
  78. bool date1904;
  79. QString defaultDateFormat;
  80. int x_window;
  81. int y_window;
  82. int window_width;
  83. int window_height;
  84. int activesheetIndex;
  85. int firstsheet;
  86. int table_count;
  87. //Used to generate new sheet name and id
  88. int last_worksheet_index;
  89. int last_chartsheet_index;
  90. int last_sheet_id;
  91. };
  92. }
  93. #endif // XLSXWORKBOOK_P_H