1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef __FRAMEWORK_UIELEMENT_COMBOBOXTOOLBARCONTROLLER_HXX_ 29 #define __FRAMEWORK_UIELEMENT_COMBOBOXTOOLBARCONTROLLER_HXX_ 30 31 #include <com/sun/star/beans/NamedValue.hpp> 32 #include <com/sun/star/frame/XDispatch.hpp> 33 #include <com/sun/star/frame/ControlCommand.hpp> 34 35 //_________________________________________________________________________________________________________________ 36 // includes of other projects 37 //_________________________________________________________________________________________________________________ 38 39 //#include <vcl/toolbox.hxx> 40 //#include <vcl/combobox.hxx> 41 #include <uielement/complextoolbarcontroller.hxx> 42 43 namespace framework 44 { 45 46 class ToolBar; 47 class ComboBoxControl; 48 49 class IComboBoxListener 50 { 51 public: 52 virtual void Select() = 0; 53 virtual void DoubleClick() = 0; 54 virtual void Modify() = 0; 55 virtual void KeyInput( const KeyEvent& rKEvt ) = 0; 56 virtual void GetFocus() = 0; 57 virtual void LoseFocus() = 0; 58 virtual long PreNotify( NotifyEvent& rNEvt ) = 0; 59 }; 60 61 class ComboboxToolbarController : public IComboBoxListener, 62 public ComplexToolbarController 63 64 { 65 public: 66 ComboboxToolbarController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager, 67 const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, 68 ToolBox* pToolBar, 69 sal_uInt16 nID, 70 sal_Int32 nWidth, 71 const rtl::OUString& aCommand ); 72 virtual ~ComboboxToolbarController(); 73 74 // XComponent 75 virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException ); 76 77 // IComboBoxListener 78 virtual void Select(); 79 virtual void DoubleClick(); 80 virtual void Modify(); 81 virtual void KeyInput( const KeyEvent& rKEvt ); 82 virtual void GetFocus(); 83 virtual void LoseFocus(); 84 virtual long PreNotify( NotifyEvent& rNEvt ); 85 86 protected: 87 virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ); 88 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const; 89 90 private: 91 ComboBoxControl* m_pComboBox; 92 }; 93 94 } 95 96 #endif // __FRAMEWORK_UIELEMENT_COMBOBOXTOOLBARCONTROLLER_HXX_ 97