xlsxcell.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 QXLSX_XLSXCELL_H
  26. #define QXLSX_XLSXCELL_H
  27. #include "xlsxglobal.h"
  28. #include "xlsxformat.h"
  29. #include <QVariant>
  30. QT_BEGIN_NAMESPACE_XLSX
  31. class Worksheet;
  32. class Format;
  33. class CellFormula;
  34. class CellPrivate;
  35. class WorksheetPrivate;
  36. class Q_XLSX_EXPORT Cell
  37. {
  38. Q_DECLARE_PRIVATE(Cell)
  39. public:
  40. enum CellType {
  41. BooleanType, //t="b"
  42. NumberType, //t="n" (default)
  43. ErrorType, //t="e"
  44. SharedStringType, //t="s"
  45. StringType, //t="str"
  46. InlineStringType //t="inlineStr"
  47. };
  48. CellType cellType() const;
  49. QVariant value() const;
  50. Format format() const;
  51. bool hasFormula() const;
  52. CellFormula formula() const;
  53. bool isDateTime() const;
  54. QDateTime dateTime() const;
  55. bool isRichString() const;
  56. ~Cell();
  57. private:
  58. friend class Worksheet;
  59. friend class WorksheetPrivate;
  60. Cell(const QVariant &data=QVariant(), CellType type=NumberType, const Format &format=Format(), Worksheet *parent=0);
  61. Cell(const Cell * const cell);
  62. CellPrivate * const d_ptr;
  63. };
  64. QT_END_NAMESPACE_XLSX
  65. #endif // QXLSX_XLSXCELL_H