1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _XMLOFF_XMLINDEXMARKEXPORT_HXX_
29 #define _XMLOFF_XMLINDEXMARKEXPORT_HXX_
30 
31 #include <rtl/ustrbuf.hxx>
32 #include <com/sun/star/uno/Reference.h>
33 #include <com/sun/star/uno/Sequence.h>
34 
35 class SvXMLExport;
36 class XMLTextParagraphExport;
37 namespace com { namespace sun { namespace star {
38 	namespace beans { class XPropertySet; }
39  } } }
40 namespace rtl {
41 	class OUString;
42 	class OUStringBuffer;
43 }
44 
45 
46 /**
47  * This class handles the export of index marks for table of content,
48  * alphabetical and user index.
49  *
50  * Marks for bibliography indices are internally modelled as text
51  * fields and thus handled in txtparae.cxx
52  */
53 class XMLIndexMarkExport
54 {
55 	::rtl::OUString sLevel;
56 	::rtl::OUString sUserIndexName;
57 	::rtl::OUString sPrimaryKey;
58 	::rtl::OUString sSecondaryKey;
59 	::rtl::OUString sDocumentIndexMark;
60 	::rtl::OUString sIsStart;
61 	::rtl::OUString sIsCollapsed;
62 	::rtl::OUString sAlternativeText;
63     ::rtl::OUString sTextReading;
64     ::rtl::OUString sPrimaryKeyReading;
65     ::rtl::OUString sSecondaryKeyReading;
66     ::rtl::OUString sMainEntry;
67 
68 
69 	SvXMLExport& rExport;
70 	XMLTextParagraphExport& rParaExport;
71 
72 public:
73 	XMLIndexMarkExport(SvXMLExport& rExp,
74 					   XMLTextParagraphExport& rParaExp);
75 
76 	~XMLIndexMarkExport();
77 
78 	/**
79 	 * export by the property set of its *text* *portion*.
80 	 *
81 	 * The text portion supplies us with the properties of the index
82 	 * mark itself, as well as the information whether we are at the
83 	 * start or end of an index mark, or whether the index mark is
84 	 * collapsed.
85 	 */
86 	void ExportIndexMark(
87 		const ::com::sun::star::uno::Reference<
88 			::com::sun::star::beans::XPropertySet> & rPropSet,
89 		sal_Bool bAutoStyles);
90 
91 protected:
92 
93 	/// export attributes of table-of-content index marks
94 	void ExportTOCMarkAttributes(
95 		const ::com::sun::star::uno::Reference<
96 			::com::sun::star::beans::XPropertySet> & rPropSet);
97 
98 	/// export attributes of user index marks
99 	void ExportUserIndexMarkAttributes(
100 		const ::com::sun::star::uno::Reference<
101 			::com::sun::star::beans::XPropertySet> & rPropSet);
102 
103 	/// export attributes of alphabetical  index marks
104 	void ExportAlphabeticalIndexMarkAttributes(
105 		const ::com::sun::star::uno::Reference<
106 			::com::sun::star::beans::XPropertySet> & rPropSet);
107 
108 	/// create a numerical ID for this index mark
109 	/// (represented by its properties)
110 	void GetID(
111 		::rtl::OUStringBuffer& sBuffer,
112 		const ::com::sun::star::uno::Reference<
113 			::com::sun::star::beans::XPropertySet> & rPropSet);
114 
115 };
116 
117 #endif
118