lok: vcl: fix multiple floatwin removal case more robustly.
[LibreOffice.git] / writerfilter / source / dmapper / LoggedResources.hxx
blob397fe099c09ee192ca5b9f9fa226f2a647ce066a
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 #ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_LOGGEDRESOURCES_HXX
21 #define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_LOGGEDRESOURCES_HXX
23 #include <dmapper/resourcemodel.hxx>
24 #include "TagLogger.hxx"
27 namespace writerfilter
30 #ifdef DEBUG_WRITERFILTER
31 class LoggedResourcesHelper final
33 public:
34 explicit LoggedResourcesHelper(const std::string & sPrefix);
35 ~LoggedResourcesHelper();
37 void startElement(const std::string & sElement);
38 static void endElement();
39 static void chars(const OUString & 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 const 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 text(const sal_uInt8 * data, size_t len) override;
64 void utext(const sal_uInt8 * data, size_t len) override;
65 void positionOffset(const OUString& rText, bool bVertical) override;
66 void align(const OUString& rText, bool bVertical) override;
67 void positivePercentage(const OUString& rText) override;
68 void props(writerfilter::Reference<Properties>::Pointer_t ref) override;
69 void table(Id name, writerfilter::Reference<Table>::Pointer_t ref) override;
70 void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) override;
71 void info(const std::string & info) override;
72 void startGlossaryEntry() override;
73 void endGlossaryEntry() override;
75 protected:
76 virtual void lcl_startSectionGroup() = 0;
77 virtual void lcl_endSectionGroup() = 0;
78 virtual void lcl_startParagraphGroup() = 0;
79 virtual void lcl_endParagraphGroup() = 0;
80 virtual void lcl_startCharacterGroup() = 0;
81 virtual void lcl_endCharacterGroup() = 0;
82 virtual void lcl_startShape(css::uno::Reference<css::drawing::XShape> const& xShape) = 0;
83 virtual void lcl_endShape() = 0;
84 virtual void lcl_text(const sal_uInt8 * data, size_t len) = 0;
85 virtual void lcl_utext(const sal_uInt8 * data, size_t len) = 0;
86 virtual void lcl_positionOffset(const OUString& /*rText*/, bool /*bVertical*/) { }
87 virtual css::awt::Point getPositionOffset() override { return css::awt::Point(); }
88 virtual void lcl_align(const OUString& /*rText*/, bool /*bVertical*/) { }
89 virtual void lcl_positivePercentage(const OUString& /*rText*/) { }
90 virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref) = 0;
91 virtual void lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref) = 0;
92 virtual void lcl_substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) = 0;
93 virtual void lcl_info(const std::string & info) = 0;
94 virtual void lcl_startGlossaryEntry() { }
95 virtual void lcl_endGlossaryEntry() { }
97 #ifdef DEBUG_WRITERFILTER
98 LoggedResourcesHelper mHelper;
99 #endif
102 class LoggedProperties : public Properties
104 public:
105 explicit LoggedProperties(const std::string & sPrefix);
106 virtual ~LoggedProperties() override;
108 void attribute(Id name, Value & val) override;
109 void sprm(Sprm & sprm) override;
111 protected:
112 virtual void lcl_attribute(Id name, Value & val) = 0;
113 virtual void lcl_sprm(Sprm & sprm) = 0;
115 #ifdef DEBUG_WRITERFILTER
116 LoggedResourcesHelper mHelper;
117 #endif
120 class LoggedTable : public Table
122 public:
123 explicit LoggedTable(const std::string & sPrefix);
124 virtual ~LoggedTable() override;
126 void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref) override;
128 protected:
129 virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref) = 0;
131 #ifdef DEBUG_WRITERFILTER
132 LoggedResourcesHelper mHelper;
133 #endif
137 #endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_LOGGEDRESOURCES_HXX
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */