use insert function instead of for loop
[LibreOffice.git] / sc / source / filter / excel / xltoolbar.hxx
blobf7da78b2ff2327bb231f92c4737c63393b7f3a5e
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 #pragma once
11 #include <filter/msfilter/mstoolbar.hxx>
13 namespace com::sun::star::container { class XIndexContainer; }
15 class ScCTBWrapper;
16 // hmm I don't normally use these packed structures
17 // but... hey always good to do something different
18 class TBCCmd : public TBBase
20 public:
21 TBCCmd() : cmdID(0), A(false), B(false), cmdType(0), C(false), reserved3(0)
23 sal_uInt16 cmdID;
24 bool A:1;
25 bool B:1;
26 sal_uInt16 cmdType:5;
27 bool C:1;
28 sal_uInt16 reserved3:8;
29 bool Read( SvStream& rS ) override;
30 #ifdef DEBUG_SC_EXCEL
31 virtual void Print(FILE* fp) override;
32 #endif
35 class ScTBC : public TBBase
37 TBCHeader tbch;
38 std::shared_ptr<TBCCmd> tbcCmd; // optional
39 std::shared_ptr<TBCData> tbcd;
40 public:
41 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 #ifdef DEBUG_SC_EXCEL
59 virtual void Print( FILE* ) override;
60 #endif
61 bool Read(SvStream &rS) override;
62 bool IsMenuToolbar() const;
63 bool ImportCustomToolBar( ScCTBWrapper&, CustomToolBarImportHelper& );
64 bool ImportMenuTB( ScCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
65 const OUString& GetName() { return tb.getName().getString(); }
69 class CTBS : public TBBase
71 public:
72 sal_uInt8 bSignature;
73 sal_uInt8 bVersion;
74 sal_uInt16 reserved1;
75 sal_uInt16 reserved2;
76 sal_uInt16 reserved3;
77 sal_uInt16 ctb;
78 sal_uInt16 ctbViews;
79 sal_uInt16 ictbView;
80 CTBS(const CTBS&);
81 CTBS& operator = ( const CTBS&);
82 CTBS();
83 #ifdef DEBUG_SC_EXCEL
84 virtual void Print( FILE* ) override;
85 #endif
86 bool Read(SvStream &rS) override;
89 class ScCTBWrapper : public TBBase
91 CTBS ctbSet;
93 std::vector< ScCTB > rCTB;
95 public:
96 ScCTBWrapper();
97 virtual ~ScCTBWrapper() override;
98 bool Read(SvStream &rS) override;
99 #ifdef DEBUG_SC_EXCEL
100 virtual void Print( FILE* ) override;
101 #endif
102 void ImportCustomToolBar( SfxObjectShell& rDocSh );
103 ScCTB* GetCustomizationData( const OUString& name );
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */