Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / filter / excel / xltoolbar.hxx
blob1ee3d544ef05ce2207e5657964f11eddb0b24c92
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 #ifndef INCLUDED_SC_SOURCE_FILTER_EXCEL_XLTOOLBAR_HXX
10 #define INCLUDED_SC_SOURCE_FILTER_EXCEL_XLTOOLBAR_HXX
12 #include <filter/msfilter/mstoolbar.hxx>
14 class ScCTBWrapper;
15 // hmm I don't normally use these packed structures
16 // but.. hey always good to do something different
17 class TBCCmd : public TBBase
19 public:
20 TBCCmd() : cmdID(0), A(false), B(false), cmdType(0), C(false), reserved3(0)
22 sal_uInt16 cmdID;
23 bool A:1;
24 bool B:1;
25 sal_uInt16 cmdType:5;
26 bool C:1;
27 sal_uInt16 reserved3:8;
28 bool Read( SvStream& rS ) override;
29 #ifdef DEBUG_SC_EXCEL
30 virtual void Print(FILE* fp) override;
31 #endif
34 class ScTBC : public TBBase
36 TBCHeader tbch;
37 std::shared_ptr<TBCCmd> tbcCmd; // optional
38 std::shared_ptr<TBCData> tbcd;
39 public:
40 ScTBC();
41 virtual ~ScTBC(){}
42 #ifdef DEBUG_SC_EXCEL
43 virtual void Print( FILE* ) override;
44 #endif
45 bool Read(SvStream &rS) override;
46 bool ImportToolBarControl( ScCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar );
49 class ScCTB : public TBBase
51 sal_uInt16 nViews;
52 TB tb;
53 std::vector<TBVisualData> rVisualData;
54 sal_uInt32 ectbid;
55 std::vector< ScTBC > rTBC;
56 public:
57 explicit ScCTB(sal_uInt16);
58 virtual ~ScCTB(){}
59 #ifdef DEBUG_SC_EXCEL
60 virtual void Print( FILE* ) override;
61 #endif
62 bool Read(SvStream &rS) override;
63 bool IsMenuToolbar();
64 bool ImportCustomToolBar( ScCTBWrapper&, CustomToolBarImportHelper& );
65 bool ImportMenuTB( ScCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
66 OUString GetName() { return tb.getName().getString(); }
70 class CTBS : public TBBase
72 public:
73 sal_uInt8 bSignature;
74 sal_uInt8 bVersion;
75 sal_uInt16 reserved1;
76 sal_uInt16 reserved2;
77 sal_uInt16 reserved3;
78 sal_uInt16 ctb;
79 sal_uInt16 ctbViews;
80 sal_uInt16 ictbView;
81 CTBS(const CTBS&);
82 CTBS& operator = ( const CTBS&);
83 CTBS();
84 virtual ~CTBS(){}
85 #ifdef DEBUG_SC_EXCEL
86 virtual void Print( FILE* ) override;
87 #endif
88 bool Read(SvStream &rS) override;
91 class ScCTBWrapper : public TBBase
93 CTBS ctbSet;
95 std::vector< ScCTB > rCTB;
97 public:
98 ScCTBWrapper();
99 virtual ~ScCTBWrapper();
100 bool Read(SvStream &rS) override;
101 #ifdef DEBUG_SC_EXCEL
102 virtual void Print( FILE* ) override;
103 #endif
104 void ImportCustomToolBar( SfxObjectShell& rDocSh );
105 ScCTB* GetCustomizationData( const OUString& name );
108 #endif // INCLUDED_SC_SOURCE_FILTER_EXCEL_XLTOOLBAR_HXX
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */