1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice 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 INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBPACKAGE_HXX
11 #define INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBPACKAGE_HXX
12 
13 #include <libepubgen/EPUBPackage.h>
14 
15 #include <com/sun/star/uno/Sequence.h>
16 #include <com/sun/star/uno/Reference.h>
17 
18 namespace com
19 {
20 namespace sun
21 {
22 namespace star
23 {
24 namespace beans
25 {
26 struct PropertyValue;
27 }
28 namespace embed
29 {
30 class XHierarchicalStorageAccess;
31 }
32 namespace io
33 {
34 class XOutputStream;
35 }
36 namespace uno
37 {
38 class XComponentContext;
39 }
40 namespace xml
41 {
42 namespace sax
43 {
44 class XWriter;
45 }
46 }
47 }
48 }
49 }
50 
51 namespace writerperfect
52 {
53 /// The epub package has direct access to the resulting ZIP file.
54 class EPUBPackage : public libepubgen::EPUBPackage
55 {
56     css::uno::Reference<css::uno::XComponentContext> mxContext;
57     css::uno::Reference<css::embed::XHierarchicalStorageAccess> mxStorage;
58     css::uno::Reference<css::io::XOutputStream> mxOutputStream;
59     css::uno::Reference<css::xml::sax::XWriter> mxOutputWriter;
60 
61 public:
62     explicit EPUBPackage(css::uno::Reference<css::uno::XComponentContext> xContext,
63                          const css::uno::Sequence<css::beans::PropertyValue>& rDescriptor);
64 
65     ~EPUBPackage() override;
66 
67     void openXMLFile(const char* pName) override;
68 
69     void openElement(const char* pName, const librevenge::RVNGPropertyList& rAttributes) override;
70     void closeElement(const char* pName) override;
71 
72     void insertCharacters(const librevenge::RVNGString& rCharacters) override;
73 
74     void closeXMLFile() override;
75 
76     void openCSSFile(const char* pName) override;
77 
78     void insertRule(const librevenge::RVNGString& rSelector,
79                     const librevenge::RVNGPropertyList& rProperties) override;
80 
81     void closeCSSFile() override;
82 
83     void openBinaryFile(const char* pName) override;
84 
85     void insertBinaryData(const librevenge::RVNGBinaryData& rData) override;
86 
87     void closeBinaryFile() override;
88 
89     void openTextFile(const char* pName) override;
90 
91     void insertText(const librevenge::RVNGString& rCharacters) override;
92 
93     void insertLineBreak() override;
94 
95     void closeTextFile() override;
96 };
97 
98 } // namespace writerperfect
99 
100 #endif
101 
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
103