1*d4a7ee09SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*d4a7ee09SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d4a7ee09SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d4a7ee09SAndrew Rist * distributed with this work for additional information 6*d4a7ee09SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d4a7ee09SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d4a7ee09SAndrew Rist * "License"); you may not use this file except in compliance 9*d4a7ee09SAndrew Rist * with the License. You may obtain a copy of the License at 10*d4a7ee09SAndrew Rist * 11*d4a7ee09SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*d4a7ee09SAndrew Rist * 13*d4a7ee09SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d4a7ee09SAndrew Rist * software distributed under the License is distributed on an 15*d4a7ee09SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d4a7ee09SAndrew Rist * KIND, either express or implied. See the License for the 17*d4a7ee09SAndrew Rist * specific language governing permissions and limitations 18*d4a7ee09SAndrew Rist * under the License. 19*d4a7ee09SAndrew Rist * 20*d4a7ee09SAndrew Rist *************************************************************/ 21*d4a7ee09SAndrew Rist 22*d4a7ee09SAndrew Rist 23cdf0e10cSrcweir #ifndef SC_VBA_COMBOBOX_HXX 24cdf0e10cSrcweir #define SC_VBA_COMBOBOX_HXX 25cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> 26cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 28cdf0e10cSrcweir #include <com/sun/star/script/XDefaultProperty.hpp> 29cdf0e10cSrcweir #include <ooo/vba/msforms/XComboBox.hpp> 30cdf0e10cSrcweir #include <comphelper/proparrhlp.hxx> 31cdf0e10cSrcweir #include <comphelper/propertycontainer.hxx> 32cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include "vbacontrol.hxx" 35cdf0e10cSrcweir #include "vbalistcontrolhelper.hxx" 36cdf0e10cSrcweir #include <vbahelper/vbahelper.hxx> 37cdf0e10cSrcweir 38cdf0e10cSrcweir typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XComboBox, css::script::XDefaultProperty > ComboBoxImpl_BASE; 39cdf0e10cSrcweir class ScVbaComboBox : public ComboBoxImpl_BASE 40cdf0e10cSrcweir { 41cdf0e10cSrcweir std::auto_ptr< ListControlHelper > mpListHelper; 42cdf0e10cSrcweir rtl::OUString sSourceName; 43cdf0e10cSrcweir rtl::OUString msDftPropName; 44cdf0e10cSrcweir bool mbDialogType; 45cdf0e10cSrcweir 46cdf0e10cSrcweir public: 47cdf0e10cSrcweir ScVbaComboBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, bool bDialogType = false ); 48cdf0e10cSrcweir 49cdf0e10cSrcweir // Attributes 50cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException); 51cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException); 52cdf0e10cSrcweir virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException); 53cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); 54cdf0e10cSrcweir virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); 55cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException); 56cdf0e10cSrcweir virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException); 57cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getStyle() throw (css::uno::RuntimeException); 58cdf0e10cSrcweir virtual void SAL_CALL setStyle( sal_Int32 nStyle ) throw (css::uno::RuntimeException); 59cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getDropButtonStyle() throw (css::uno::RuntimeException); 60cdf0e10cSrcweir virtual void SAL_CALL setDropButtonStyle( sal_Int32 nDropButtonStyle ) throw (css::uno::RuntimeException); 61cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getDragBehavior() throw (css::uno::RuntimeException); 62cdf0e10cSrcweir virtual void SAL_CALL setDragBehavior( sal_Int32 nDragBehavior ) throw (css::uno::RuntimeException); 63cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getEnterFieldBehavior() throw (css::uno::RuntimeException); 64cdf0e10cSrcweir virtual void SAL_CALL setEnterFieldBehavior( sal_Int32 nEnterFieldBehavior ) throw (css::uno::RuntimeException); 65cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getListStyle() throw (css::uno::RuntimeException); 66cdf0e10cSrcweir virtual void SAL_CALL setListStyle( sal_Int32 nListStyle ) throw (css::uno::RuntimeException); 67cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getTextAlign() throw (css::uno::RuntimeException); 68cdf0e10cSrcweir virtual void SAL_CALL setTextAlign( sal_Int32 nTextAlign ) throw (css::uno::RuntimeException); 69cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getTextLength() throw (css::uno::RuntimeException); 70cdf0e10cSrcweir virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() throw (css::uno::RuntimeException); 71cdf0e10cSrcweir 72cdf0e10cSrcweir // Methods 73cdf0e10cSrcweir virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException); 74cdf0e10cSrcweir virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException); 75cdf0e10cSrcweir virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException); 76cdf0e10cSrcweir virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException); 77cdf0e10cSrcweir // XControl 78cdf0e10cSrcweir virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException); 79cdf0e10cSrcweir 80cdf0e10cSrcweir // XDefaultProperty getDefaultPropertyName()81cdf0e10cSrcweir ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } 82cdf0e10cSrcweir //XHelperInterface 83cdf0e10cSrcweir virtual rtl::OUString& getServiceImplName(); 84cdf0e10cSrcweir virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 85cdf0e10cSrcweir }; 86cdf0e10cSrcweir 87cdf0e10cSrcweir #endif // 88