FB2Style.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 FB2STYLE_H_INCLUDED
00018 #define FB2STYLE_H_INCLUDED
00019 
00020 #include "libebook_utils.h"
00021 
00022 class WPXPropertyList;
00023 
00024 namespace libebook
00025 {
00026 
00027 struct FB2TextFormat
00028 {
00029   FB2TextFormat();
00030 
00031   uint8_t a;
00032   uint8_t code;
00033   uint8_t emphasis;
00034   uint8_t strikethrough;
00035   uint8_t strong;
00036   uint8_t sub;
00037   uint8_t sup;
00038 };
00039 
00040 struct FB2BlockFormat
00041 {
00042   FB2BlockFormat();
00043 
00044   uint8_t annotation;
00045   uint8_t cite;
00046   uint8_t epigraph;
00047   bool headerRow;
00048   bool p;
00049   uint8_t poem;
00050   bool stanza;
00051   bool subtitle;
00052   bool table;
00053   bool textAuthor;
00054   bool title;
00055   bool v;
00056 };
00057 
00058 class FB2Style
00059 {
00060 public:
00061   explicit FB2Style(const FB2BlockFormat &blockFormat);
00062 
00063   FB2TextFormat &getTextFormat();
00064   const FB2TextFormat &getTextFormat() const;
00065   const FB2BlockFormat &getBlockFormat() const;
00066 
00067 private:
00068   FB2TextFormat m_textFormat;
00069   const FB2BlockFormat m_blockFormat;
00070 };
00071 
00072 WPXPropertyList makePropertyList(const FB2Style &style);
00073 WPXPropertyList makePropertyList(const FB2TextFormat &format, const FB2BlockFormat &blockFormat);
00074 WPXPropertyList makePropertyList(const FB2BlockFormat &format);
00075 
00076 }
00077 
00078 #endif // FB2STYLE_H_INCLUDED
00079 
00080 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */