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 
13 namespace com::sun::star::container { class XIndexContainer; }
14 
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
19 {
20 public:
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 
35 class ScTBC : public TBBase
36 {
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 );
47 };
48 
49 class ScCTB : public TBBase
50 {
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;
64  bool ImportMenuTB( ScCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
65  const OUString& GetName() { return tb.getName().getString(); }
66 
67 };
68 
69 class CTBS : public TBBase
70 {
71 public:
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;
87 };
88 
89 class ScCTBWrapper : public TBBase
90 {
92 
93  std::vector< ScCTB > rCTB;
94 
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 );
104 };
105 
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool A
Definition: xltoolbar.hxx:24
def Print(s)
CTBS & operator=(const CTBS &)
sal_uInt32 ectbid
Definition: xltoolbar.hxx:54
sal_uInt16 ctbViews
Definition: xltoolbar.hxx:78
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:241
CTBS()
Definition: xltoolbar.cxx:71
bool IsMenuToolbar() const
Definition: xltoolbar.cxx:153
const OUString & GetName()
Definition: xltoolbar.hxx:65
sal_uInt16 reserved3
Definition: xltoolbar.hxx:76
std::vector< TBVisualData > rVisualData
Definition: xltoolbar.hxx:53
sal_uInt16 reserved2
Definition: xltoolbar.hxx:75
bool ImportToolBarControl(ScCTBWrapper &, const css::uno::Reference< css::container::XIndexContainer > &toolbarcontainer, CustomToolBarImportHelper &helper, bool bIsMenuBar)
Definition: xltoolbar.cxx:278
sal_uInt16 ctb
Definition: xltoolbar.hxx:77
void ImportCustomToolBar(SfxObjectShell &rDocSh)
Definition: xltoolbar.cxx:415
sal_uInt8 bVersion
Definition: xltoolbar.hxx:73
std::shared_ptr< TBCData > tbcd
Definition: xltoolbar.hxx:39
sal_uInt8 bSignature
Definition: xltoolbar.hxx:72
sal_uInt16 ictbView
Definition: xltoolbar.hxx:79
std::vector< ScCTB > rCTB
Definition: xltoolbar.hxx:93
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:209
ScCTB * GetCustomizationData(const OUString &name)
Definition: xltoolbar.cxx:406
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:343
sal_uInt16 reserved1
Definition: xltoolbar.hxx:74
bool ImportCustomToolBar(ScCTBWrapper &, CustomToolBarImportHelper &)
Definition: xltoolbar.cxx:168
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:79
sal_uInt16 nViews
Definition: xltoolbar.hxx:51
std::vector< ScTBC > rTBC
Definition: xltoolbar.hxx:55
ScCTB(sal_uInt16)
Definition: xltoolbar.cxx:75
unsigned char sal_uInt8
TBCHeader tbch
Definition: xltoolbar.hxx:37
sal_uInt16 cmdType
Definition: xltoolbar.hxx:26
bool B
Definition: xltoolbar.hxx:25
virtual ~ScCTBWrapper() override
Definition: xltoolbar.cxx:362
TBCCmd()
Definition: xltoolbar.hxx:21
WString & getName()
const OUString & getString() const
std::shared_ptr< TBCCmd > tbcCmd
Definition: xltoolbar.hxx:38
bool Read(SvStream &rS) override
Definition: xltoolbar.cxx:367
TB tb
Definition: xltoolbar.hxx:52
sal_uInt16 reserved3
Definition: xltoolbar.hxx:28
sal_uInt16 cmdID
Definition: xltoolbar.hxx:23
bool C
Definition: xltoolbar.hxx:27
bool ImportMenuTB(ScCTBWrapper &, const css::uno::Reference< css::container::XIndexContainer > &, CustomToolBarImportHelper &)
Definition: xltoolbar.cxx:158