00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* 00003 * This file is part of the libe-book project. 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 00010 #ifndef FB2STYLE_H_INCLUDED 00011 #define FB2STYLE_H_INCLUDED 00012 00013 #include <string> 00014 00015 #include "libebook_utils.h" 00016 00017 00018 namespace libebook 00019 { 00020 00021 struct FB2TextFormat 00022 { 00023 FB2TextFormat(); 00024 00025 uint8_t a; 00026 uint8_t code; 00027 uint8_t emphasis; 00028 uint8_t strikethrough; 00029 uint8_t strong; 00030 uint8_t sub; 00031 uint8_t sup; 00032 std::string lang; 00033 }; 00034 00035 struct FB2BlockFormat 00036 { 00037 FB2BlockFormat(); 00038 00039 uint8_t annotation; 00040 uint8_t cite; 00041 uint8_t epigraph; 00042 bool headerRow; 00043 bool p; 00044 uint8_t poem; 00045 bool stanza; 00046 bool subtitle; 00047 bool table; 00048 bool textAuthor; 00049 bool title; 00050 bool v; 00051 uint8_t headingLevel; 00052 std::string lang; 00053 }; 00054 00055 class FB2Style 00056 { 00057 public: 00058 explicit FB2Style(const FB2BlockFormat &blockFormat); 00059 00060 FB2TextFormat &getTextFormat(); 00061 const FB2TextFormat &getTextFormat() const; 00062 const FB2BlockFormat &getBlockFormat() const; 00063 00064 private: 00065 FB2TextFormat m_textFormat; 00066 const FB2BlockFormat m_blockFormat; 00067 }; 00068 00069 librevenge::RVNGPropertyList makePropertyList(const FB2Style &style); 00070 librevenge::RVNGPropertyList makePropertyList(const FB2TextFormat &format, const FB2BlockFormat &blockFormat); 00071 librevenge::RVNGPropertyList makePropertyList(const FB2BlockFormat &format); 00072 00073 } 00074 00075 #endif // FB2STYLE_H_INCLUDED 00076 00077 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */