xref: /AOO41X/main/xmloff/source/text/XMLIndexMarkExport.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_XMLINDEXMARKEXPORT_HXX_
25 #define _XMLOFF_XMLINDEXMARKEXPORT_HXX_
26 
27 #include <rtl/ustrbuf.hxx>
28 #include <com/sun/star/uno/Reference.h>
29 #include <com/sun/star/uno/Sequence.h>
30 
31 class SvXMLExport;
32 class XMLTextParagraphExport;
33 namespace com { namespace sun { namespace star {
34     namespace beans { class XPropertySet; }
35  } } }
36 namespace rtl {
37     class OUString;
38     class OUStringBuffer;
39 }
40 
41 
42 /**
43  * This class handles the export of index marks for table of content,
44  * alphabetical and user index.
45  *
46  * Marks for bibliography indices are internally modelled as text
47  * fields and thus handled in txtparae.cxx
48  */
49 class XMLIndexMarkExport
50 {
51     ::rtl::OUString sLevel;
52     ::rtl::OUString sUserIndexName;
53     ::rtl::OUString sPrimaryKey;
54     ::rtl::OUString sSecondaryKey;
55     ::rtl::OUString sDocumentIndexMark;
56     ::rtl::OUString sIsStart;
57     ::rtl::OUString sIsCollapsed;
58     ::rtl::OUString sAlternativeText;
59     ::rtl::OUString sTextReading;
60     ::rtl::OUString sPrimaryKeyReading;
61     ::rtl::OUString sSecondaryKeyReading;
62     ::rtl::OUString sMainEntry;
63 
64 
65     SvXMLExport& rExport;
66     XMLTextParagraphExport& rParaExport;
67 
68 public:
69     XMLIndexMarkExport(SvXMLExport& rExp,
70                        XMLTextParagraphExport& rParaExp);
71 
72     ~XMLIndexMarkExport();
73 
74     /**
75      * export by the property set of its *text* *portion*.
76      *
77      * The text portion supplies us with the properties of the index
78      * mark itself, as well as the information whether we are at the
79      * start or end of an index mark, or whether the index mark is
80      * collapsed.
81      */
82     void ExportIndexMark(
83         const ::com::sun::star::uno::Reference<
84             ::com::sun::star::beans::XPropertySet> & rPropSet,
85         sal_Bool bAutoStyles);
86 
87 protected:
88 
89     /// export attributes of table-of-content index marks
90     void ExportTOCMarkAttributes(
91         const ::com::sun::star::uno::Reference<
92             ::com::sun::star::beans::XPropertySet> & rPropSet);
93 
94     /// export attributes of user index marks
95     void ExportUserIndexMarkAttributes(
96         const ::com::sun::star::uno::Reference<
97             ::com::sun::star::beans::XPropertySet> & rPropSet);
98 
99     /// export attributes of alphabetical  index marks
100     void ExportAlphabeticalIndexMarkAttributes(
101         const ::com::sun::star::uno::Reference<
102             ::com::sun::star::beans::XPropertySet> & rPropSet);
103 
104     /// create a numerical ID for this index mark
105     /// (represented by its properties)
106     void GetID(
107         ::rtl::OUStringBuffer& sBuffer,
108         const ::com::sun::star::uno::Reference<
109             ::com::sun::star::beans::XPropertySet> & rPropSet);
110 
111 };
112 
113 #endif
114