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 XMLSTYLESHEET_H_INCLUDED 00011 #define XMLSTYLESHEET_H_INCLUDED 00012 00013 #include <deque> 00014 #include <string> 00015 00016 #include <librevenge-stream/librevenge-stream.h> 00017 00018 #include "libebook_libcss.h" 00019 00020 namespace libebook 00021 { 00022 00023 class XMLStylesheet 00024 { 00025 public: 00026 enum Source 00027 { 00028 SOURCE_UA, 00029 SOURCE_USER, 00030 SOURCE_AUTHOR 00031 }; 00032 00033 public: 00034 explicit XMLStylesheet(Source source, bool quirks = false, librevenge::RVNGInputStream *input = 0); 00035 00036 void append(const std::string &selector, const std::string &rule); 00037 00038 bool isQuirks() const; 00039 Source getSource() const; 00040 00041 CSSStylesheetPtr_t get() const; 00042 00043 private: 00044 std::deque<std::string> m_data; 00045 const Source m_source; 00046 const bool m_quirks; 00047 mutable bool m_changed; 00048 mutable CSSStylesheetPtr_t m_compiled; 00049 }; 00050 00051 typedef std::deque<XMLStylesheet> XMLStylesheets_t; 00052 00053 } 00054 00055 #endif // XMLSTYLESHEET_H_INCLUDED 00056 00057 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */