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_SD_SOURCE_FILTER_EPPT_GROUPTABLE_HXX
21 : #define INCLUDED_SD_SOURCE_FILTER_EPPT_GROUPTABLE_HXX
22 :
23 : #include <com/sun/star/container/XIndexAccess.hpp>
24 :
25 : struct GroupEntry
26 : {
27 : sal_uInt32 mnCurrentPos;
28 : sal_uInt32 mnCount;
29 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mXIndexAccess;
30 :
31 10 : GroupEntry( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex )
32 10 : {
33 10 : mXIndexAccess = rIndex;
34 10 : mnCount =mXIndexAccess->getCount();
35 10 : mnCurrentPos = 0;
36 10 : };
37 :
38 386 : GroupEntry( sal_uInt32 nCount )
39 386 : {
40 386 : mnCount = nCount;
41 386 : mnCurrentPos = 0;
42 386 : };
43 :
44 396 : ~GroupEntry(){};
45 : };
46 :
47 : class GroupTable
48 : {
49 : protected:
50 :
51 : sal_uInt32 mnIndex;
52 : sal_uInt32 mnCurrentGroupEntry;
53 : sal_uInt32 mnMaxGroupEntry;
54 : sal_uInt32 mnGroupsClosed;
55 : GroupEntry** mpGroupEntry;
56 :
57 : void ImplResizeGroupTable( sal_uInt32 nEntrys );
58 :
59 : public:
60 :
61 1134 : sal_uInt32 GetCurrentGroupIndex() const { return mnIndex; };
62 1150 : sal_Int32 GetCurrentGroupLevel() const { return mnCurrentGroupEntry - 1; };
63 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > &
64 7 : GetCurrentGroupAccess() const { return mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mXIndexAccess; };
65 : sal_uInt32 GetGroupsClosed();
66 : void ResetGroupTable( sal_uInt32 nCount );
67 : void ClearGroupTable();
68 : bool EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex );
69 : bool GetNextGroupEntry();
70 : GroupTable();
71 : ~GroupTable();
72 : };
73 :
74 : #endif
75 :
76 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|