FB2TextContext.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* libe-book
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Alternatively, the contents of this file may be used under the terms
00010  * of the GNU Lesser General Public License Version 2.1 or later
00011  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00012  * applicable instead of those above.
00013  *
00014  * For further information visit http://libebook.sourceforge.net
00015  */
00016 
00017 #ifndef FB2TEXTCONTEXT_H_INCLUDED
00018 #define FB2TEXTCONTEXT_H_INCLUDED
00019 
00020 #include <string>
00021 
00022 #include "FB2ParserContext.h"
00023 
00024 namespace libebook
00025 {
00026 
00027 class FB2ParaContextBase : public FB2StyleContextBase
00028 {
00029 public:
00030   FB2ParaContextBase(FB2ParserContext *parentContext, const FB2BlockFormat &format);
00031 
00032 private:
00033   virtual void startOfElement();
00034   virtual void endOfElement();
00035   virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
00036 };
00037 
00038 class FB2AContext : public FB2StyleContextBase
00039 {
00040 public:
00041   FB2AContext(FB2ParserContext *parentContext, const FB2Style &style);
00042 
00043 private:
00044   virtual void startOfElement();
00045   virtual void endOfAttributes();
00046   virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
00047   virtual void text(const char *text);
00048 
00049 private:
00050   std::string m_href;
00051   bool m_valid;
00052   bool m_note;
00053 };
00054 
00055 class FB2CodeContext : public FB2StyleContextBase
00056 {
00057 public:
00058   FB2CodeContext(FB2ParserContext *parentContext, FB2Style &style);
00059 
00060 private:
00061   virtual void startOfElement();
00062 };
00063 
00064 class FB2EmphasisContext : public FB2StyleContextBase
00065 {
00066 public:
00067   FB2EmphasisContext(FB2ParserContext *parentContext, FB2Style &style);
00068 
00069 private:
00070   virtual void startOfElement();
00071 };
00072 
00073 class FB2InlineImageContext : public FB2DataContextBase
00074 {
00075 public:
00076   FB2InlineImageContext(FB2ParserContext *parentContext, const FB2Style &style);
00077 
00078 private:
00079   virtual void startOfElement();
00080   virtual void endOfElement();
00081   virtual void endOfAttributes();
00082   virtual void attribute(const EBOOKToken &name, const EBOOKToken *ns, const char *value);
00083 
00084 private:
00085   const FB2Style &m_style;
00086   std::string m_href;
00087   std::string m_altText;
00088   bool m_valid;
00089 };
00090 
00091 class FB2PContext : public FB2ParaContextBase
00092 {
00093 public:
00094   FB2PContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
00095 
00096 private:
00097   static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format);
00098 };
00099 
00100 class FB2StrikethroughContext : public FB2StyleContextBase
00101 {
00102 public:
00103   FB2StrikethroughContext(FB2ParserContext *parentContext, FB2Style &style);
00104 
00105 private:
00106   virtual void startOfElement();
00107 };
00108 
00109 class FB2StrongContext : public FB2StyleContextBase
00110 {
00111 public:
00112   FB2StrongContext(FB2ParserContext *parentContext, FB2Style &style);
00113 
00114 private:
00115   virtual void startOfElement();
00116 };
00117 
00118 class FB2StyleContext : public FB2StyleContextBase
00119 {
00120 public:
00121   FB2StyleContext(FB2ParserContext *parentContext, FB2Style &style);
00122 
00123 private:
00124   virtual void startOfElement();
00125 };
00126 
00127 class FB2SubContext : public FB2StyleContextBase
00128 {
00129 public:
00130   FB2SubContext(FB2ParserContext *parentContext, FB2Style &style);
00131 
00132 private:
00133   virtual void startOfElement();
00134 };
00135 
00136 class FB2SubtitleContext : public FB2ParaContextBase
00137 {
00138 public:
00139   explicit FB2SubtitleContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
00140 
00141 private:
00142   static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format);
00143 };
00144 
00145 class FB2SupContext : public FB2StyleContextBase
00146 {
00147 public:
00148   FB2SupContext(FB2ParserContext *parentContext, FB2Style &style);
00149 
00150 private:
00151   virtual void startOfElement();
00152 };
00153 
00154 class FB2TextAuthorContext : public FB2PContext
00155 {
00156 public:
00157   explicit FB2TextAuthorContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
00158 
00159 private:
00160   static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format);
00161 };
00162 
00163 class FB2VContext : public FB2ParaContextBase
00164 {
00165 public:
00166   explicit FB2VContext(FB2ParserContext *parentContext, const FB2BlockFormat &format);
00167 
00168 private:
00169   static FB2BlockFormat makeBlockFormat(const FB2BlockFormat &format);
00170 };
00171 
00172 }
00173 
00174 #endif // FB2TEXTCONTEXT_H_INCLUDED
00175 
00176 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */