xref: /AOO41X/main/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx (revision ecfe53c5d1886e1e0d215b0d140d05282ab1c477)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _XMLOFF_XMLINDEXBIBLIOGRAPHYCONFIGURATIONCONTEXT_HXX_
25 #define _XMLOFF_XMLINDEXBIBLIOGRAPHYCONFIGURATIONCONTEXT_HXX_
26 
27 #include <xmloff/xmlstyle.hxx>
28 #include <com/sun/star/uno/Reference.h>
29 #include <com/sun/star/uno/Sequence.h>
30 #include <com/sun/star/beans/PropertyValue.hpp>
31 #include <com/sun/star/lang/Locale.hpp>
32 #include <rtl/ustring.hxx>
33 
34 
35 #include <vector>
36 
37 namespace com { namespace sun { namespace star {
38     namespace xml { namespace sax { class XAttributeList; } }
39 } } }
40 
41 
42 /**
43  * Import bibliography configuration.
44  *
45  * Little cheat: Cover all child elements in CreateChildContext.
46  */
47 class XMLIndexBibliographyConfigurationContext : public SvXMLStyleContext
48 {
49     const ::rtl::OUString sFieldMaster_Bibliography;
50     const ::rtl::OUString sBracketBefore;
51     const ::rtl::OUString sBracketAfter;
52     const ::rtl::OUString sIsNumberEntries;
53     const ::rtl::OUString sIsSortByPosition;
54     const ::rtl::OUString sSortKeys;
55     const ::rtl::OUString sSortKey;
56     const ::rtl::OUString sIsSortAscending;
57     const ::rtl::OUString sSortAlgorithm;
58     const ::rtl::OUString sLocale;
59 
60     ::rtl::OUString sSuffix;
61     ::rtl::OUString sPrefix;
62     ::rtl::OUString sAlgorithm;
63     ::com::sun::star::lang::Locale aLocale;
64     sal_Bool bNumberedEntries;
65     sal_Bool bSortByPosition;
66 
67     ::std::vector< ::com::sun::star::uno::Sequence<
68                         ::com::sun::star::beans::PropertyValue> > aSortKeys;
69 
70 public:
71 
72     TYPEINFO();
73 
74     XMLIndexBibliographyConfigurationContext(
75         SvXMLImport& rImport,
76         sal_uInt16 nPrfx,
77         const ::rtl::OUString& rLocalName,
78         const ::com::sun::star::uno::Reference<
79             ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
80 
81     ~XMLIndexBibliographyConfigurationContext();
82 
83 protected:
84 
85     virtual void StartElement(
86         const ::com::sun::star::uno::Reference<
87             ::com::sun::star::xml::sax::XAttributeList> & xAttrList);
88 
89     virtual void CreateAndInsert( sal_Bool bOverwrite );
90 
91     virtual SvXMLImportContext *CreateChildContext(
92         sal_uInt16 nPrefix,
93         const ::rtl::OUString& rLocalName,
94         const ::com::sun::star::uno::Reference<
95             ::com::sun::star::xml::sax::XAttributeList> & xAttrList );
96 
97     void ProcessAttribute(
98         sal_uInt16 nPrefix,
99         const ::rtl::OUString sLocalName,
100         const ::rtl::OUString sValue);
101 };
102 
103 #endif
104