LRFTypes.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 LRFTYPES_H_INCLUDED
00018 #define LRFTYPES_H_INCLUDED
00019 
00020 #include <deque>
00021 #include <map>
00022 #include <string>
00023 
00024 #include <boost/optional.hpp>
00025 
00026 namespace libebook
00027 {
00028 
00029 enum ImageType
00030 {
00031   IMAGE_TYPE_UNKNOWN = 0,
00032   IMAGE_TYPE_JPEG = 0x11,
00033   IMAGE_TYPE_PNG = 0x12,
00034   IMAGE_TYPE_BMP = 0x13
00035 };
00036 
00037 struct LRFBookInfo
00038 {
00039   LRFBookInfo();
00040 
00041   std::string author;
00042   std::string title;
00043   std::string bookID;
00044   std::string publisher;
00045   boost::optional<std::string> label;
00046   std::deque<std::string> categories;
00047   std::string classification;
00048   boost::optional<std::string> freeText;
00049 };
00050 
00051 struct LRFDocInfo
00052 {
00053   LRFDocInfo();
00054 
00055   std::string language;
00056   std::string creator;
00057   std::string creationDate;
00058   std::string producer;
00059   unsigned page;
00060 };
00061 
00062 struct LRFMetadata
00063 {
00064   LRFMetadata();
00065 
00066   LRFBookInfo bookInfo;
00067   LRFDocInfo docInfo;
00068   boost::optional<std::string> keyword;
00069 };
00070 
00071 struct LRFColor
00072 {
00073   LRFColor();
00074   explicit LRFColor(unsigned color);
00075   LRFColor(unsigned char red, unsigned char green, unsigned char blue);
00076 
00077   unsigned char r;
00078   unsigned char g;
00079   unsigned char b;
00080 };
00081 
00082 struct LRFAttributes
00083 {
00084   LRFAttributes();
00085 
00086   boost::optional<unsigned> fontSize;
00087   boost::optional<unsigned> fontWidth;
00088   boost::optional<unsigned> fontEscapement;
00089   boost::optional<unsigned> fontOrientation;
00090   boost::optional<unsigned> fontWeight;
00091   boost::optional<std::string> fontFacename;
00092   boost::optional<LRFColor> textColor;
00093   boost::optional<LRFColor> textBgColor;
00094   boost::optional<unsigned> wordSpace;
00095   boost::optional<unsigned> letterSpace;
00096   boost::optional<unsigned> baseLineSkip;
00097   boost::optional<unsigned> lineSpace;
00098   boost::optional<unsigned> parIndent;
00099   boost::optional<unsigned> parSkip;
00100   boost::optional<unsigned> height;
00101   boost::optional<unsigned> width;
00102   boost::optional<unsigned> locationX;
00103   boost::optional<unsigned> locationY;
00104   boost::optional<bool> italic;
00105   boost::optional<bool> sup;
00106   boost::optional<bool> sub;
00107 };
00108 
00109 typedef std::map<unsigned, LRFAttributes> LRFAttributeMap_t;
00110 
00111 }
00112 
00113 #endif // LRFTYPES_H_INCLUDED
00114 
00115 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */