1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 //_________________________________________________________________________________________________________________ 25 // my own includes 26 //_________________________________________________________________________________________________________________ 27 28 29 #ifndef __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ 30 #define __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ 31 32 #include <vcl/toolbox.hxx> 33 34 namespace framework 35 { 36 37 class ToolBarManager; 38 class ToolBar : public ToolBox 39 { 40 public: 41 ToolBar( Window* pParent, WinBits nWinBits ); 42 virtual ~ToolBar(); 43 44 virtual void Command ( const CommandEvent& rCEvt ); 45 virtual void StateChanged( StateChangedType nType ); 46 virtual void DataChanged( const DataChangedEvent& rDCEvt ); 47 48 // Toolbar manager 49 void SetToolBarManager( ToolBarManager* pTbMgr ); GetToolBarManager() const50 ToolBarManager* GetToolBarManager() const { return m_pToolBarManager; } 51 52 // Provide additional handlers to support external implementations SetCommandHdl(const Link & aLink)53 void SetCommandHdl( const Link& aLink ) { m_aCommandHandler = aLink; } GetCommandHdl() const54 const Link& GetCommandHdl() const { return m_aCommandHandler; } SetStateChangedHdl(const Link & aLink)55 void SetStateChangedHdl( const Link& aLink ) { m_aStateChangedHandler = aLink; } GetStateChangedHdl() const56 const Link& GetStateChangedHdl() const { return m_aStateChangedHandler; } SetDataChangedHdl(const Link & aLink)57 void SetDataChangedHdl( const Link& aLink ) { m_aDataChangedHandler = aLink; } GetDataChangedHdl()58 const Link& GetDataChangedHdl() { return m_aDataChangedHandler; } 59 60 private: 61 Link m_aCommandHandler; 62 Link m_aStateChangedHandler; 63 Link m_aDataChangedHandler; 64 ToolBarManager* m_pToolBarManager; 65 }; 66 67 } 68 69 #endif // __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ 70