xref: /AOO41X/main/vbahelper/source/msforms/vbalistbox.hxx (revision d4a7ee096095edc0140da98aca6f220cb09e0281)
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
10cdf0e10cSrcweir  *
11*d4a7ee09SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
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.
19cdf0e10cSrcweir  *
20*d4a7ee09SAndrew Rist  *************************************************************/
21*d4a7ee09SAndrew Rist 
22*d4a7ee09SAndrew Rist 
23cdf0e10cSrcweir #ifndef SC_VBA_LISTBOX_HXX
24cdf0e10cSrcweir #define SC_VBA_LISTBOX_HXX
25cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
26cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
27cdf0e10cSrcweir #include <com/sun/star/script/XDefaultProperty.hpp>
28cdf0e10cSrcweir #include <ooo/vba/msforms/XListBox.hpp>
29cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "vbacontrol.hxx"
32cdf0e10cSrcweir #include <vbahelper/vbapropvalue.hxx>
33cdf0e10cSrcweir #include "vbalistcontrolhelper.hxx"
34cdf0e10cSrcweir #include <vbahelper/vbahelper.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XListBox, css::script::XDefaultProperty > ListBoxImpl_BASE;
37cdf0e10cSrcweir class ScVbaListBox : public ListBoxImpl_BASE
38cdf0e10cSrcweir     ,public PropListener
39cdf0e10cSrcweir {
40cdf0e10cSrcweir 	std::auto_ptr< ListControlHelper > mpListHelper;
41cdf0e10cSrcweir 	rtl::OUString sSourceName;
42cdf0e10cSrcweir 	rtl::OUString msDftPropName;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir     sal_Int16 m_nIndex;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir public:
47cdf0e10cSrcweir 	ScVbaListBox( 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 );
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 	// Attributes
50cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException);
51cdf0e10cSrcweir 	virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
52cdf0e10cSrcweir 	virtual ::sal_Int32 SAL_CALL getListCount() 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_Bool SAL_CALL getMultiSelect() throw (css::uno::RuntimeException);
58cdf0e10cSrcweir     virtual void SAL_CALL setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException);
59cdf0e10cSrcweir     virtual css::uno::Reference< ov::msforms::XNewFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	// Methods
62cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Selected( ::sal_Int32 index ) throw (css::uno::RuntimeException);
63cdf0e10cSrcweir 	virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException);
64cdf0e10cSrcweir     virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException);
65cdf0e10cSrcweir 	virtual void SAL_CALL Clear(  ) throw (css::uno::RuntimeException);
66cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException);
67cdf0e10cSrcweir 	// XControl
68cdf0e10cSrcweir     virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	// XDefaultProperty
getDefaultPropertyName()71cdf0e10cSrcweir     rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     //XHelperInterface
74cdf0e10cSrcweir     virtual rtl::OUString& getServiceImplName();
75cdf0e10cSrcweir     virtual css::uno::Sequence<rtl::OUString> getServiceNames();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     //PropListener
78cdf0e10cSrcweir     virtual void setValueEvent( const css::uno::Any& value );
79cdf0e10cSrcweir     virtual css::uno::Any getValueEvent();
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 
82cdf0e10cSrcweir };
83cdf0e10cSrcweir 
84cdf0e10cSrcweir #endif //
85