Line data Source code
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 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_TAG_LOGGER_HXX
21 : #define INCLUDED_TAG_LOGGER_HXX
22 :
23 : #include <rtl/ustring.hxx>
24 : #include <com/sun/star/beans/XPropertySet.hpp>
25 : #include <WriterFilterDllApi.hxx>
26 : #include <resourcemodel/WW8ResourceModel.hxx>
27 : #include <string>
28 : #include <boost/unordered_map.hpp>
29 : #include <boost/shared_ptr.hpp>
30 : #include <libxml/xmlwriter.h>
31 :
32 : namespace writerfilter
33 : {
34 : class IdToString
35 : {
36 : public:
37 : typedef boost::shared_ptr<IdToString> Pointer_t;
38 : virtual std::string toString(const Id & id) const = 0;
39 :
40 : protected:
41 : ~IdToString() {}
42 : };
43 :
44 : class WRITERFILTER_RESOURCEMODEL_DLLPUBLIC TagLogger
45 : {
46 : public:
47 : typedef boost::shared_ptr<TagLogger> Pointer_t;
48 :
49 : private:
50 : xmlTextWriterPtr pWriter;
51 : const char* pName;
52 :
53 : TagLogger(const char* name);
54 :
55 : public:
56 : ~TagLogger();
57 :
58 : static Pointer_t getInstance(const char * name);
59 :
60 : #ifdef DEBUG_IMPORT
61 : void setFileName(const std::string & filename);
62 : void startDocument();
63 : void endDocument();
64 : #endif
65 :
66 : #ifdef DEBUG_DOMAINMAPPER
67 : void element(const std::string & name);
68 : void unoPropertySet(uno::Reference<beans::XPropertySet> rPropSet);
69 : #endif
70 : #if OSL_DEBUG_LEVEL > 1
71 : void startElement(const std::string & name);
72 : #endif
73 : void attribute(const std::string & name, const std::string & value);
74 : #if OSL_DEBUG_LEVEL > 1
75 : void attribute(const std::string & name, const OUString & value);
76 : void attribute(const std::string & name, sal_uInt32 value);
77 : void attribute(const std::string & name, const uno::Any aAny);
78 : void chars(const std::string & chars);
79 : void chars(const OUString & chars);
80 : void endElement();
81 : #endif
82 :
83 : #ifdef DEBUG_CONTEXT_HANDLER
84 : void propertySet(writerfilter::Reference<Properties>::Pointer_t props,
85 : IdToString::Pointer_t pIdToString);
86 : #endif
87 : };
88 15 : }
89 :
90 : #endif // INCLUDED_TAG_LOGGER_HXX
91 :
92 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|