android: Update app-specific/MIME type icons
[LibreOffice.git] / writerfilter / source / dmapper / LoggedResources.hxx
blobaa7b84e0a0836bb9f03d43c6872529ad6e58bdac
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <sal/config.h>
24 #include <string_view>
26 #include <dmapper/resourcemodel.hxx>
28 namespace writerfilter
30 #ifdef DBG_UTIL
31 class LoggedResourcesHelper final
33 public:
34 explicit LoggedResourcesHelper(std::string sPrefix);
35 ~LoggedResourcesHelper();
37 void startElement(const std::string& sElement);
38 static void endElement();
39 static void chars(std::u16string_view rChars);
40 static void chars(const std::string& rChars);
41 static void attribute(const std::string& rName, const std::string& rValue);
42 static void attribute(const std::string& rName, sal_uInt32 nValue);
44 private:
45 std::string msPrefix;
47 #endif
49 class LoggedStream : public Stream
51 public:
52 explicit LoggedStream(const std::string& sPrefix);
53 virtual ~LoggedStream() override;
55 void startSectionGroup() override;
56 void endSectionGroup() override;
57 void startParagraphGroup() override;
58 void endParagraphGroup() override;
59 void startCharacterGroup() override;
60 void endCharacterGroup() override;
61 void startShape(css::uno::Reference<css::drawing::XShape> const& xShape) override;
62 void endShape() override;
63 void startTextBoxContent() override;
64 void endTextBoxContent() override;
65 void text(const sal_uInt8* data, size_t len) override;
66 void utext(const sal_uInt8* data, size_t len) override;
67 void positionOffset(const OUString& rText, bool bVertical) override;
68 void align(const OUString& rText, bool bVertical) override;
69 void positivePercentage(const OUString& rText) override;
70 void props(writerfilter::Reference<Properties>::Pointer_t ref) override;
71 void table(Id name, writerfilter::Reference<Table>::Pointer_t ref) override;
72 void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) override;
73 void info(const std::string& info) override;
74 void startGlossaryEntry() override;
75 void endGlossaryEntry() override;
76 void checkId(const sal_Int32 nId) override;
78 virtual void setDocumentReference(writerfilter::ooxml::OOXMLDocument* /*pDocument*/) override{};
80 protected:
81 virtual void lcl_startSectionGroup() = 0;
82 virtual void lcl_endSectionGroup() = 0;
83 virtual void lcl_startParagraphGroup() = 0;
84 virtual void lcl_endParagraphGroup() = 0;
85 virtual void lcl_startCharacterGroup() = 0;
86 virtual void lcl_endCharacterGroup() = 0;
87 virtual void lcl_startShape(css::uno::Reference<css::drawing::XShape> const& xShape) = 0;
88 virtual void lcl_endShape() = 0;
89 virtual void lcl_startTextBoxContent() = 0;
90 virtual void lcl_endTextBoxContent() = 0;
91 virtual void lcl_text(const sal_uInt8* data, size_t len) = 0;
92 virtual void lcl_utext(const sal_uInt8* data, size_t len) = 0;
93 virtual void lcl_positionOffset(const OUString& /*rText*/, bool /*bVertical*/) {}
94 virtual css::awt::Point getPositionOffset() override { return css::awt::Point(); }
95 virtual void lcl_align(const OUString& /*rText*/, bool /*bVertical*/) {}
96 virtual void lcl_positivePercentage(const OUString& /*rText*/) {}
97 virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref) = 0;
98 virtual void lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref) = 0;
99 virtual void lcl_substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) = 0;
100 virtual void lcl_startGlossaryEntry() {}
101 virtual void lcl_endGlossaryEntry() {}
102 virtual void lcl_checkId(const sal_Int32) {}
104 #ifdef DBG_UTIL
105 LoggedResourcesHelper mHelper;
106 #endif
109 class LoggedProperties : public Properties
111 public:
112 explicit LoggedProperties(const std::string& sPrefix);
113 virtual ~LoggedProperties() override;
115 void attribute(Id name, Value& val) override;
116 void sprm(Sprm& sprm) override;
118 protected:
119 virtual void lcl_attribute(Id name, Value& val) = 0;
120 virtual void lcl_sprm(Sprm& sprm) = 0;
122 #ifdef DBG_UTIL
123 LoggedResourcesHelper mHelper;
124 #endif
127 class LoggedTable : public Table
129 public:
130 explicit LoggedTable(const std::string& sPrefix);
131 virtual ~LoggedTable() override;
133 void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref) override;
135 protected:
136 virtual void lcl_entry(writerfilter::Reference<Properties>::Pointer_t ref) = 0;
138 #ifdef DBG_UTIL
139 LoggedResourcesHelper mHelper;
140 #endif
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */