1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_LOGGED_RESOURCES_HXX
21 #define INCLUDED_LOGGED_RESOURCES_HXX
23 #include "WW8ResourceModel.hxx"
24 #include "TagLogger.hxx"
26 #include <WriterFilterDllApi.hxx>
28 namespace writerfilter
32 class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC LoggedResourcesHelper
35 explicit LoggedResourcesHelper(TagLogger::Pointer_t pLogger
, const string
& sPrefix
);
36 virtual ~LoggedResourcesHelper();
38 void startElement(const string
& sElement
);
39 void endElement(const string
& sElement
);
40 void chars(const OUString
& rChars
);
41 void chars(const string
& rChars
);
42 void attribute(const string
& rName
, const string
& rValue
);
43 void attribute(const string
& rName
, sal_uInt32 nValue
);
46 TagLogger::Pointer_t mpLogger
;
51 class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC LoggedStream
: public Stream
54 explicit LoggedStream(TagLogger::Pointer_t pLogger
, const string
& sPrefix
);
55 virtual ~LoggedStream();
57 void startSectionGroup();
58 void endSectionGroup();
59 void startParagraphGroup();
60 void endParagraphGroup();
61 void startCharacterGroup();
62 void endCharacterGroup();
63 void startShape( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> xShape
);
65 void text(const sal_uInt8
* data
, size_t len
);
66 void utext(const sal_uInt8
* data
, size_t len
);
67 void props(writerfilter::Reference
<Properties
>::Pointer_t ref
);
68 void table(Id name
, writerfilter::Reference
<Table
>::Pointer_t ref
);
69 void substream(Id name
, writerfilter::Reference
<Stream
>::Pointer_t ref
);
70 void info(const string
& info
);
73 virtual void lcl_startSectionGroup() = 0;
74 virtual void lcl_endSectionGroup() = 0;
75 virtual void lcl_startParagraphGroup() = 0;
76 virtual void lcl_endParagraphGroup() = 0;
77 virtual void lcl_startCharacterGroup() = 0;
78 virtual void lcl_endCharacterGroup() = 0;
79 virtual void lcl_startShape( ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> xShape
) = 0;
80 virtual void lcl_endShape() = 0;
81 virtual void lcl_text(const sal_uInt8
* data
, size_t len
) = 0;
82 virtual void lcl_utext(const sal_uInt8
* data
, size_t len
) = 0;
83 virtual void lcl_props(writerfilter::Reference
<Properties
>::Pointer_t ref
) = 0;
84 virtual void lcl_table(Id name
, writerfilter::Reference
<Table
>::Pointer_t ref
) = 0;
85 virtual void lcl_substream(Id name
, writerfilter::Reference
<Stream
>::Pointer_t ref
) = 0;
86 virtual void lcl_info(const string
& info
) = 0;
89 LoggedResourcesHelper mHelper
;
93 class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC LoggedProperties
: public Properties
96 explicit LoggedProperties(TagLogger::Pointer_t pLogger
, const string
& sPrefix
);
97 virtual ~LoggedProperties();
99 void attribute(Id name
, Value
& val
);
100 void sprm(Sprm
& sprm
);
103 virtual void lcl_attribute(Id name
, Value
& val
) = 0;
104 virtual void lcl_sprm(Sprm
& sprm
) = 0;
107 LoggedResourcesHelper mHelper
;
111 class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC LoggedTable
: public Table
114 explicit LoggedTable(TagLogger::Pointer_t pLogger
, const string
& sPrefix
);
115 virtual ~LoggedTable();
117 void entry(int pos
, writerfilter::Reference
<Properties
>::Pointer_t ref
);
120 virtual void lcl_entry(int pos
, writerfilter::Reference
<Properties
>::Pointer_t ref
) = 0;
123 LoggedResourcesHelper mHelper
;
128 #endif // INCLUDED_LOGGED_RESOURCES_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */