XMLStylesheet.h Source File documentation

XMLStylesheet.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libe-book project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef XMLSTYLESHEET_H_INCLUDED
11#define XMLSTYLESHEET_H_INCLUDED
12
13#include <deque>
14#include <string>
15
16#include <librevenge-stream/librevenge-stream.h>
17
18#include "libebook_libcss.h"
19
20namespace libebook
21{
22
23 class XMLStylesheet
24{
25public:
26 enum Source
27 {
28 SOURCE_UA,
29 SOURCE_USER,
30 SOURCE_AUTHOR
31 };
32
33public:
34 explicit XMLStylesheet(Source source, bool quirks = false, librevenge::RVNGInputStream *input = 0);
35
36 void append(const std::string &selector, const std::string &rule);
37
38 bool isQuirks() const;
39 Source getSource() const;
40
41 CSSStylesheetPtr_t get() const;
42
43private:
44 std::deque<std::string> m_data;
45 const Source m_source;
46 const bool m_quirks;
47 mutable bool m_changed;
48 mutable CSSStylesheetPtr_t m_compiled;
49};
50
51 typedef std::deque<XMLStylesheet> XMLStylesheets_t;
52
53}
54
55#endif // XMLSTYLESHEET_H_INCLUDED
56
57/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::XMLStylesheet
Definition XMLStylesheet.h:24
libebook::XMLStylesheet::m_data
std::deque< std::string > m_data
Definition XMLStylesheet.h:44
libebook::XMLStylesheet::append
void append(const std::string &selector, const std::string &rule)
Definition XMLStylesheet.cpp:33
libebook::XMLStylesheet::m_source
const Source m_source
Definition XMLStylesheet.h:45
libebook::XMLStylesheet::get
CSSStylesheetPtr_t get() const
Definition XMLStylesheet.cpp:51
libebook::XMLStylesheet::getSource
Source getSource() const
Definition XMLStylesheet.cpp:46
libebook::XMLStylesheet::m_compiled
CSSStylesheetPtr_t m_compiled
Definition XMLStylesheet.h:48
libebook::XMLStylesheet::m_quirks
const bool m_quirks
Definition XMLStylesheet.h:46
libebook::XMLStylesheet::Source
Source
Definition XMLStylesheet.h:27
libebook::XMLStylesheet::SOURCE_USER
@ SOURCE_USER
Definition XMLStylesheet.h:29
libebook::XMLStylesheet::SOURCE_UA
@ SOURCE_UA
Definition XMLStylesheet.h:28
libebook::XMLStylesheet::SOURCE_AUTHOR
@ SOURCE_AUTHOR
Definition XMLStylesheet.h:30
libebook::XMLStylesheet::isQuirks
bool isQuirks() const
Definition XMLStylesheet.cpp:41
libebook::XMLStylesheet::m_changed
bool m_changed
Definition XMLStylesheet.h:47
libebook_libcss.h
libebook
Definition BBeBCollector.cpp:19
libebook::XMLStylesheets_t
std::deque< XMLStylesheet > XMLStylesheets_t
Definition XMLStylesheet.h:51
libebook::CSSStylesheetPtr_t
std::shared_ptr< css_stylesheet > CSSStylesheetPtr_t
Definition libebook_libcss.h:23