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_REPORTDESIGN_SOURCE_FILTER_XML_XMLSTYLEIMPORT_HXX
21 : #define INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLSTYLEIMPORT_HXX
22 :
23 : #include <rtl/ustring.hxx>
24 : #include <xmloff/xmlimp.hxx>
25 : #include <xmloff/xmlictxt.hxx>
26 : #include <xmloff/maptype.hxx>
27 : #include <xmloff/prstylei.hxx>
28 : #include <xmloff/xmlimppr.hxx>
29 : #include <xmloff/XMLTextMasterPageContext.hxx>
30 : #include <xmloff/XMLTextMasterStylesContext.hxx>
31 : #include <xmloff/contextid.hxx>
32 : #include <xmloff/controlpropertyhdl.hxx>
33 : #include <vector>
34 :
35 : namespace rptxml
36 : {
37 : class ORptFilter;
38 :
39 : class OControlStyleContext : public XMLPropStyleContext
40 : {
41 : OUString m_sDataStyleName;
42 : OUString sPageStyle;
43 : SvXMLStylesContext* pStyles;
44 : // std::vector<ScXMLMapContent> aMaps;
45 : sal_Int32 m_nNumberFormat;
46 : ORptFilter& m_rImport;
47 :
48 0 : ORptFilter& GetOwnImport() const { return m_rImport;}
49 :
50 : OControlStyleContext(const OControlStyleContext&) SAL_DELETED_FUNCTION;
51 : void operator =(const OControlStyleContext&) SAL_DELETED_FUNCTION;
52 : protected:
53 :
54 : virtual void SetAttribute( sal_uInt16 nPrefixKey,
55 : const OUString& rLocalName,
56 : const OUString& rValue ) SAL_OVERRIDE;
57 :
58 : public:
59 :
60 : TYPEINFO_OVERRIDE();
61 :
62 : OControlStyleContext( ORptFilter& rImport, sal_uInt16 nPrfx,
63 : const OUString& rLName,
64 : const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
65 : SvXMLStylesContext& rStyles, sal_uInt16 nFamily, bool bDefaultStyle = false );
66 :
67 : virtual ~OControlStyleContext();
68 :
69 :
70 : virtual void FillPropertySet(const ::com::sun::star::uno::Reference<
71 : ::com::sun::star::beans::XPropertySet > & rPropSet ) SAL_OVERRIDE;
72 :
73 : virtual void SetDefaults() SAL_OVERRIDE;
74 :
75 : void AddProperty(sal_Int16 nContextID, const com::sun::star::uno::Any& aValue);
76 :
77 : sal_Int32 GetNumberFormat() { return m_nNumberFormat; }
78 : };
79 :
80 : class OReportStylesContext : public SvXMLStylesContext
81 : {
82 : const OUString m_sTableStyleFamilyName;
83 : const OUString m_sColumnStyleFamilyName;
84 : const OUString m_sRowStyleFamilyName;
85 : const OUString m_sCellStyleFamilyName;
86 : ORptFilter& m_rImport;
87 : sal_Int32 m_nNumberFormatIndex;
88 : bool bAutoStyles : 1;
89 :
90 : //mutable rtl::Reference < SvXMLImportPropertyMapper > m_xControlImpPropMapper;
91 : mutable rtl::Reference < SvXMLImportPropertyMapper > m_xCellImpPropMapper;
92 : mutable rtl::Reference < SvXMLImportPropertyMapper > m_xColumnImpPropMapper;
93 : mutable rtl::Reference < SvXMLImportPropertyMapper > m_xRowImpPropMapper;
94 : mutable rtl::Reference < SvXMLImportPropertyMapper > m_xTableImpPropMapper;
95 :
96 : mutable ::com::sun::star::uno::Reference <
97 : ::com::sun::star::container::XNameContainer > m_xCellStyles;
98 : mutable ::com::sun::star::uno::Reference <
99 : ::com::sun::star::container::XNameContainer > m_xColumnStyles;
100 : mutable ::com::sun::star::uno::Reference <
101 : ::com::sun::star::container::XNameContainer > m_xRowStyles;
102 : mutable ::com::sun::star::uno::Reference <
103 : ::com::sun::star::container::XNameContainer > m_xTableStyles;
104 :
105 0 : ORptFilter& GetOwnImport() const { return m_rImport;}
106 :
107 : OReportStylesContext(const OReportStylesContext&) SAL_DELETED_FUNCTION;
108 : void operator =(const OReportStylesContext&) SAL_DELETED_FUNCTION;
109 : protected:
110 :
111 : // Create a style context.
112 : virtual SvXMLStyleContext *CreateStyleStyleChildContext(
113 : sal_uInt16 nFamily,
114 : sal_uInt16 nPrefix,
115 : const OUString& rLocalName,
116 : const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ) SAL_OVERRIDE;
117 :
118 : virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext(
119 : sal_uInt16 nFamily, sal_uInt16 nPrefix,
120 : const OUString& rLocalName,
121 : const ::com::sun::star::uno::Reference<
122 : ::com::sun::star::xml::sax::XAttributeList > & xAttrList ) SAL_OVERRIDE;
123 :
124 : public:
125 :
126 : TYPEINFO_OVERRIDE();
127 :
128 : OReportStylesContext( ORptFilter& rImport, sal_uInt16 nPrfx ,
129 : const OUString& rLName ,
130 : const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
131 : const bool bAutoStyles );
132 : virtual ~OReportStylesContext();
133 :
134 : virtual void EndElement() SAL_OVERRIDE;
135 :
136 : virtual rtl::Reference < SvXMLImportPropertyMapper > GetImportPropertyMapper(
137 : sal_uInt16 nFamily ) const SAL_OVERRIDE;
138 : virtual ::com::sun::star::uno::Reference <
139 : ::com::sun::star::container::XNameContainer >
140 : GetStylesContainer( sal_uInt16 nFamily ) const SAL_OVERRIDE;
141 : virtual OUString GetServiceName( sal_uInt16 nFamily ) const SAL_OVERRIDE;
142 : virtual sal_uInt16 GetFamily( const OUString& rFamily ) const SAL_OVERRIDE;
143 :
144 : sal_Int32 GetIndex(const sal_Int16 nContextID);
145 : };
146 :
147 : } // rptxml
148 :
149 : #endif // INCLUDED_REPORTDESIGN_SOURCE_FILTER_XML_XMLSTYLEIMPORT_HXX
150 :
151 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|