xref: /AOO41X/main/sc/source/filter/xml/XMLColumnRowGroupExport.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523)
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 SC_XMLCOLUMNROWGROUPEXPORT_HXX
25 #define SC_XMLCOLUMNROWGROUPEXPORT_HXX
26 
27 #include <list>
28 #include <rtl/ustring.hxx>
29 #include <sal/types.h>
30 
31 struct ScMyColumnRowGroup
32 {
33     sal_Int32   nField;
34     sal_Int16   nLevel;
35     sal_Bool    bDisplay;
36 
37     ScMyColumnRowGroup();
38     sal_Bool operator< (const ScMyColumnRowGroup& rGroup) const;
39 };
40 
41 typedef std::list <ScMyColumnRowGroup> ScMyColumnRowGroupVec;
42 typedef std::list <sal_Int32> ScMyFieldGroupVec;
43 
44 class ScXMLExport;
45 class ScMyOpenCloseColumnRowGroup
46 {
47     ScXMLExport&                rExport;
48     const rtl::OUString         rName;
49     ScMyColumnRowGroupVec       aTableStart;
50     ScMyFieldGroupVec           aTableEnd;
51 
52     void OpenGroup(const ScMyColumnRowGroup& rGroup);
53     void CloseGroup();
54 public:
55     ScMyOpenCloseColumnRowGroup(ScXMLExport& rExport, sal_uInt32 nToken);
56     ~ScMyOpenCloseColumnRowGroup();
57 
58     void NewTable();
59     void AddGroup(const ScMyColumnRowGroup& aGroup, const sal_Int32 nEndField);
60     sal_Bool IsGroupStart(const sal_Int32 nField);
61     void OpenGroups(const sal_Int32 nField);
62     sal_Bool IsGroupEnd(const sal_Int32 nField);
63     void CloseGroups(const sal_Int32 nField);
64     sal_Int32 GetLast();
65     void Sort();
66 };
67 
68 #endif
69 
70