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 : #ifndef _XLTOOLBAR_HXX
10 : #define _XLTOOLBAR_HXX
11 :
12 : #include <filter/msfilter/mstoolbar.hxx>
13 :
14 : class ScCTBWrapper;
15 : // hmm I don't normally use these packed structures
16 : // but.. hey always good to do something different
17 0 : class TBCCmd : public TBBase
18 : {
19 : public:
20 0 : TBCCmd() : cmdID(0), A(0), B(0), cmdType(0), C(0), reserved3(0) {}
21 : sal_uInt16 cmdID;
22 : sal_uInt16 A:1;
23 : sal_uInt16 B:1;
24 : sal_uInt16 cmdType:5;
25 : sal_uInt16 C:1;
26 : sal_uInt16 reserved3:8;
27 : bool Read( SvStream& rS );
28 : void Print(FILE* fp);
29 : };
30 :
31 0 : class ScTBC : public TBBase
32 : {
33 : TBCHeader tbch;
34 : boost::shared_ptr<TBCCmd> tbcCmd; // optional
35 : boost::shared_ptr<TBCData> tbcd;
36 : public:
37 : ScTBC();
38 0 : ~ScTBC(){}
39 : void Print( FILE* );
40 : bool Read(SvStream &rS);
41 : bool ImportToolBarControl( ScCTBWrapper&, const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar );
42 : };
43 :
44 0 : class ScCTB : public TBBase
45 : {
46 : sal_uInt16 nViews;
47 : TB tb;
48 : std::vector<TBVisualData> rVisualData;
49 : sal_uInt32 ectbid;
50 : std::vector< ScTBC > rTBC;
51 : bool ImportCustomToolBar_Impl( ScCTBWrapper&, CustomToolBarImportHelper& );
52 : public:
53 : ScCTB(sal_uInt16);
54 0 : ~ScCTB(){}
55 : void Print( FILE* );
56 : bool Read(SvStream &rS);
57 : bool IsMenuToolbar();
58 : bool ImportCustomToolBar( ScCTBWrapper&, CustomToolBarImportHelper& );
59 : bool ImportMenuTB( ScCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
60 0 : OUString GetName() { return tb.getName().getString(); }
61 :
62 :
63 : };
64 :
65 : class CTBS : public TBBase
66 : {
67 : public:
68 : sal_uInt8 bSignature;
69 : sal_uInt8 bVersion;
70 : sal_uInt16 reserved1;
71 : sal_uInt16 reserved2;
72 : sal_uInt16 reserved3;
73 : sal_uInt16 ctb;
74 : sal_uInt16 ctbViews;
75 : sal_uInt16 ictbView;
76 : CTBS(const CTBS&);
77 : CTBS& operator = ( const CTBS&);
78 : CTBS();
79 27 : ~CTBS(){}
80 : void Print( FILE* );
81 : bool Read(SvStream &rS);
82 : };
83 :
84 : class ScCTBWrapper : public TBBase
85 : {
86 : CTBS ctbSet;
87 :
88 : std::vector< ScCTB > rCTB;
89 :
90 : public:
91 : ScCTBWrapper();
92 : ~ScCTBWrapper();
93 : bool Read(SvStream &rS);
94 : void Print( FILE* );
95 : bool ImportCustomToolBar( SfxObjectShell& rDocSh );
96 : ScCTB* GetCustomizationData( const OUString& name );
97 : };
98 :
99 :
100 : #endif //_XLTOOLBAR_HXX
101 :
102 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|