Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef FB2TABLECONTEXT_H_INCLUDED
00018 #define FB2TABLECONTEXT_H_INCLUDED
00019
00020 #include "FB2ParserContext.h"
00021
00022 namespace libebook
00023 {
00024
00025 class FB2TableModel;
00026
00027 class FB2TableContext : public FB2BlockFormatContextBase
00028 {
00029
00030 FB2TableContext(const FB2TableContext &other);
00031 FB2TableContext &operator=(const FB2TableContext &other);
00032
00033 public:
00034 FB2TableContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
00035 virtual ~FB2TableContext();
00036
00037 private:
00038 virtual FB2XMLParserContext *element(const EBOOKToken &name, const EBOOKToken &ns);
00039 virtual void startOfElement();
00040 virtual void endOfElement();
00041 virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
00042
00043 private:
00044 FB2TableModel *m_model;
00045 };
00046
00047 class FB2CellContext : public FB2StyleContextBase
00048 {
00049
00050 FB2CellContext(const FB2CellContext &other);
00051 FB2CellContext &operator=(const FB2CellContext &other);
00052
00053 public:
00054 FB2CellContext(FB2ParserContext *parentContext, FB2TableModel *model, const FB2BlockFormat &format, bool header);
00055
00056 private:
00057 virtual void startOfElement();
00058 virtual void endOfElement();
00059 virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
00060 virtual void endOfAttributes();
00061
00062 void openCell();
00063
00064 private:
00065 FB2TableModel *const m_model;
00066 const bool m_header;
00067 bool m_opened;
00068 int m_columnSpan;
00069 int m_rowSpan;
00070 size_t m_coveredColumns;
00071 };
00072
00073 class FB2TrContext : public FB2BlockFormatContextBase
00074 {
00075
00076 FB2TrContext(const FB2TrContext &);
00077 FB2TrContext &operator=(const FB2TrContext &);
00078
00079 public:
00080 FB2TrContext(FB2ParserContext *parentContext, FB2TableModel *model, const FB2BlockFormat &format);
00081
00082 private:
00083 virtual FB2XMLParserContext *element(const EBOOKToken &name, const EBOOKToken &ns);
00084 virtual void endOfElement();
00085 virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
00086
00087 void openRow(bool header);
00088
00089 private:
00090 FB2TableModel *m_model;
00091 bool m_opened;
00092 };
00093
00094 }
00095
00096 #endif // FB2TABLECONTEXT_H_INCLUDED
00097
00098