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 #ifndef _EXTENSIONS_DBP_UNOAUTOPILOT_HXX_
25 #define _EXTENSIONS_DBP_UNOAUTOPILOT_HXX_
26 
27 #include <svtools/genericunodialog.hxx>
28 #include <comphelper/proparrhlp.hxx>
29 #include "componentmodule.hxx"
30 #include <cppuhelper/typeprovider.hxx>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/beans/PropertyValue.hpp>
33 
34 //.........................................................................
35 namespace dbp
36 {
37 //.........................................................................
38 
39 	//=====================================================================
40 	//= IServiceInfo
41 	//=====================================================================
42 	/** interface for the SERVICEINFO template parameter of the OUnoAutoPilot class
43 	*/
44 	struct IServiceInfo
45 	{
46 	public:
47 		::rtl::OUString		getImplementationName() const;
48 		::com::sun::star::uno::Sequence< ::rtl::OUString >
49 							getServiceNames() const;
50 	};
51 
52 	//=====================================================================
53 	//= OUnoAutoPilot
54 	//=====================================================================
55 	typedef ::svt::OGenericUnoDialog	OUnoAutoPilot_Base;
56 	template <class TYPE, class SERVICEINFO>
57 	class OUnoAutoPilot
58 			:public OUnoAutoPilot_Base
59 			,public ::comphelper::OPropertyArrayUsageHelper< OUnoAutoPilot< TYPE, SERVICEINFO > >
60 			,public OModuleResourceClient
61 	{
62 		OUnoAutoPilot(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
63 
64 	protected:
65 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
66 					m_xObjectModel;
67 
68 	public:
69 		// XTypeProvider
70 		virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
71 
72 		// XServiceInfo
73 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
74 		virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
75 
76 		// XServiceInfo - static methods
77 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
78 		static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
79 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
80 				SAL_CALL Create(const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&);
81 
82 		// XPropertySet
83 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo>  SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
84 		virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
85 
86 		// OPropertyArrayUsageHelper
87 		virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
88 
89 	protected:
90 	// OGenericUnoDialog overridables
91 		virtual Dialog*	createDialog(Window* _pParent);
92 		virtual void implInitialize(const com::sun::star::uno::Any& _rValue);
93 	};
94 
95 #include "unoautopilot.inl"
96 
97 //.........................................................................
98 }	// namespace dbp
99 //.........................................................................
100 
101 #endif // _EXTENSIONS_DBP_UNOAUTOPILOT_HXX_
102 
103