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