Branch data Line data Source code
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 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #ifndef __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_
21 : : #define __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_
22 : :
23 : : #include <vcl/toolbox.hxx>
24 : :
25 : : namespace framework
26 : : {
27 : :
28 : : class ToolBarManager;
29 : : class ToolBar : public ToolBox
30 : : {
31 : : public:
32 : : ToolBar( Window* pParent, WinBits nWinBits );
33 : : virtual ~ToolBar();
34 : :
35 : : virtual void Command ( const CommandEvent& rCEvt );
36 : : virtual void StateChanged( StateChangedType nType );
37 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
38 : :
39 : : // Toolbar manager
40 : : void SetToolBarManager( ToolBarManager* pTbMgr );
41 : : ToolBarManager* GetToolBarManager() const { return m_pToolBarManager; }
42 : :
43 : : // Provide additional handlers to support external implementations
44 : 7236 : void SetCommandHdl( const Link& aLink ) { m_aCommandHandler = aLink; }
45 : : const Link& GetCommandHdl() const { return m_aCommandHandler; }
46 : 7236 : void SetStateChangedHdl( const Link& aLink ) { m_aStateChangedHandler = aLink; }
47 : : const Link& GetStateChangedHdl() const { return m_aStateChangedHandler; }
48 : 7236 : void SetDataChangedHdl( const Link& aLink ) { m_aDataChangedHandler = aLink; }
49 : : const Link& GetDataChangedHdl() { return m_aDataChangedHandler; }
50 : :
51 : : private:
52 : : Link m_aCommandHandler;
53 : : Link m_aStateChangedHandler;
54 : : Link m_aDataChangedHandler;
55 : : ToolBarManager* m_pToolBarManager;
56 : : };
57 : :
58 : : }
59 : :
60 : : #endif // __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_
61 : :
62 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|