/src/libreoffice/include/oox/helper/grabbagstack.hxx
Line | Count | Source |
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 | | */ |
10 | | |
11 | | #ifndef INCLUDED_OOX_HELPER_GRABBAGSTACK_HXX |
12 | | #define INCLUDED_OOX_HELPER_GRABBAGSTACK_HXX |
13 | | |
14 | | #include <stack> |
15 | | #include <vector> |
16 | | |
17 | | #include <com/sun/star/beans/PropertyValue.hpp> |
18 | | #include <oox/dllapi.h> |
19 | | #include <rtl/ustring.hxx> |
20 | | #include <sal/types.h> |
21 | | |
22 | | namespace com::sun::star { |
23 | | namespace uno { class Any; } |
24 | | } |
25 | | |
26 | | namespace oox { |
27 | | |
28 | | struct GrabBagStackElement |
29 | | { |
30 | | OUString maElementName; |
31 | | std::vector<css::beans::PropertyValue> maPropertyList; |
32 | | }; |
33 | | |
34 | | /// Tool that is useful for construction of a nested Sequence/PropertyValue hierarchy |
35 | | class OOX_DLLPUBLIC GrabBagStack final |
36 | | { |
37 | | private: |
38 | | std::stack<GrabBagStackElement> mStack; |
39 | | GrabBagStackElement mCurrentElement; |
40 | | |
41 | | public: |
42 | | GrabBagStack(const OUString& aElementName); |
43 | | ~GrabBagStack(); |
44 | | |
45 | 10.7k | const OUString& getCurrentName() const { return mCurrentElement.maElementName;} |
46 | | |
47 | | css::beans::PropertyValue getRootProperty(); |
48 | | |
49 | | void appendElement(const OUString& aName, const css::uno::Any& aAny); |
50 | | void push(const OUString& aKey); |
51 | | void pop(); |
52 | | void addInt32(const OUString& aElementName, sal_Int32 aIntValue); |
53 | | void addString(const OUString& aElementName, const OUString& aStringValue); |
54 | | bool isStackEmpty() const; |
55 | | }; |
56 | | |
57 | | } // namespace oox |
58 | | |
59 | | #endif |
60 | | |
61 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |