1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #include <filter/msfilter/mstoolbar.hxx>
13 namespace com::sun::star::container
{ class XIndexContainer
; }
16 // hmm I don't normally use these packed structures
17 // but... hey always good to do something different
18 class TBCCmd
: public TBBase
21 TBCCmd() : cmdID(0), A(false), B(false), cmdType(0), C(false), reserved3(0)
28 sal_uInt16 reserved3
:8;
29 bool Read( SvStream
& rS
) override
;
31 virtual void Print(FILE* fp
) override
;
35 class ScTBC
: public TBBase
38 std::shared_ptr
<TBCCmd
> tbcCmd
; // optional
39 std::shared_ptr
<TBCData
> tbcd
;
43 virtual void Print( FILE* ) override
;
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
53 std::vector
<TBVisualData
> rVisualData
;
55 std::vector
< ScTBC
> rTBC
;
57 explicit ScCTB(sal_uInt16
);
59 virtual void Print( FILE* ) override
;
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
81 CTBS
& operator = ( const CTBS
&);
84 virtual void Print( FILE* ) override
;
86 bool Read(SvStream
&rS
) override
;
89 class ScCTBWrapper
: public TBBase
93 std::vector
< ScCTB
> rCTB
;
97 virtual ~ScCTBWrapper() override
;
98 bool Read(SvStream
&rS
) override
;
100 virtual void Print( FILE* ) override
;
102 void ImportCustomToolBar( SfxObjectShell
& rDocSh
);
103 ScCTB
* GetCustomizationData( const OUString
& name
);
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */