LibreOffice Module sc (master) 1
xltoolbar.hxx
Go to the documentation of this file.
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#pragma once
10
12
13namespace com::sun::star::container { class XIndexContainer; }
14
15class ScCTBWrapper;
16// hmm I don't normally use these packed structures
17// but... hey always good to do something different
18class TBCCmd : public TBBase
19{
20public:
21 TBCCmd() : cmdID(0), A(false), B(false), cmdType(0), C(false), reserved3(0)
22 {}
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
33};
34
35class ScTBC : public TBBase
36{
38 std::shared_ptr<TBCCmd> tbcCmd; // optional
39 std::shared_ptr<TBCData> tbcd;
40public:
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 );
47};
48
49class ScCTB : public TBBase
50{
51 sal_uInt16 nViews;
53 std::vector<TBVisualData> rVisualData;
54 sal_uInt32 ectbid;
55 std::vector< ScTBC > rTBC;
56public:
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;
64 bool ImportMenuTB( ScCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
65 const OUString& GetName() { return tb.getName().getString(); }
66
67};
68
69class CTBS : public TBBase
70{
71public:
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&);
82 CTBS();
83#ifdef DEBUG_SC_EXCEL
84 virtual void Print( FILE* ) override;
85#endif
86 bool Read(SvStream &rS) override;
87};
88
89class ScCTBWrapper : public TBBase
90{
92
93 std::vector< ScCTB > rCTB;
94
95public:
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 );
104};
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 reserved3
Definition: xltoolbar.hxx:76
CTBS & operator=(const CTBS &)
sal_uInt16 ctbViews
Definition: xltoolbar.hxx:78
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:211
sal_uInt16 reserved2
Definition: xltoolbar.hxx:75
sal_uInt8 bVersion
Definition: xltoolbar.hxx:73
CTBS()
Definition: xltoolbar.cxx:73
sal_uInt8 bSignature
Definition: xltoolbar.hxx:72
sal_uInt16 reserved1
Definition: xltoolbar.hxx:74
sal_uInt16 ctb
Definition: xltoolbar.hxx:77
CTBS(const CTBS &)
sal_uInt16 ictbView
Definition: xltoolbar.hxx:79
void ImportCustomToolBar(SfxObjectShell &rDocSh)
Definition: xltoolbar.cxx:416
ScCTB * GetCustomizationData(const OUString &name)
Definition: xltoolbar.cxx:407
std::vector< ScCTB > rCTB
Definition: xltoolbar.hxx:93
virtual ~ScCTBWrapper() override
Definition: xltoolbar.cxx:363
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:368
bool ImportCustomToolBar(ScCTBWrapper &, CustomToolBarImportHelper &)
Definition: xltoolbar.cxx:170
sal_uInt16 nViews
Definition: xltoolbar.hxx:51
std::vector< ScTBC > rTBC
Definition: xltoolbar.hxx:55
TB tb
Definition: xltoolbar.hxx:52
bool ImportMenuTB(ScCTBWrapper &, const css::uno::Reference< css::container::XIndexContainer > &, CustomToolBarImportHelper &)
Definition: xltoolbar.cxx:160
bool IsMenuToolbar() const
Definition: xltoolbar.cxx:155
sal_uInt32 ectbid
Definition: xltoolbar.hxx:54
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:81
std::vector< TBVisualData > rVisualData
Definition: xltoolbar.hxx:53
ScCTB(sal_uInt16)
Definition: xltoolbar.cxx:77
const OUString & GetName()
Definition: xltoolbar.hxx:65
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:243
TBCHeader tbch
Definition: xltoolbar.hxx:37
std::shared_ptr< TBCCmd > tbcCmd
Definition: xltoolbar.hxx:38
bool ImportToolBarControl(ScCTBWrapper &, const css::uno::Reference< css::container::XIndexContainer > &toolbarcontainer, CustomToolBarImportHelper &helper, bool bIsMenuBar)
Definition: xltoolbar.cxx:280
std::shared_ptr< TBCData > tbcd
Definition: xltoolbar.hxx:39
sal_uInt16 reserved3
Definition: xltoolbar.hxx:28
bool A
Definition: xltoolbar.hxx:24
sal_uInt16 cmdID
Definition: xltoolbar.hxx:23
bool C
Definition: xltoolbar.hxx:27
bool B
Definition: xltoolbar.hxx:25
TBCCmd()
Definition: xltoolbar.hxx:21
sal_uInt16 cmdType
Definition: xltoolbar.hxx:26
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:344
WString & getName()
const OUString & getString() const
@ Print
black or white, depending on background
unsigned char sal_uInt8