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 EXTENSIONS_ABP_UNODIALOG_HXX
29 #define EXTENSIONS_ABP_UNODIALOG_HXX
30 
31 #include <svtools/genericunodialog.hxx>
32 #include <comphelper/proparrhlp.hxx>
33 #include "componentmodule.hxx"
34 #include <com/sun/star/task/XJob.hpp>
35 #include <cppuhelper/implbase1.hxx>
36 
37 //.........................................................................
38 namespace abp
39 {
40 //.........................................................................
41 
42 	//=====================================================================
43 	//= OABSPilotUno
44 	//=====================================================================
45 	class OABSPilotUno;
46 	typedef ::svt::OGenericUnoDialog								OABSPilotUno_DBase;
47 	typedef ::cppu::ImplHelper1< ::com::sun::star::task::XJob >		OABSPilotUno_JBase;
48 	typedef ::comphelper::OPropertyArrayUsageHelper< OABSPilotUno >	OABSPilotUno_PBase;
49 	/// the UNO wrapper for the address book source pilot
50 	class OABSPilotUno
51 			:public OABSPilotUno_DBase
52 			,public OABSPilotUno_JBase
53 			,public OABSPilotUno_PBase
54 			,public OModuleResourceClient
55 	{
56         ::rtl::OUString m_sDataSourceName;
57 		OABSPilotUno(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
58 
59 	public:
60 		// XInterface (disambiguation)
61 		virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
62 		virtual void SAL_CALL acquire(  ) throw ();
63 		virtual void SAL_CALL release(  ) throw ();
64 
65 		// XTypeProvider
66 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
67 		virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
68 
69 		// XServiceInfo
70 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
71 		virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
72 
73 		// XServiceInfo - static methods
74 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
75 		static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
76 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
77 				SAL_CALL Create(const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&);
78 
79 		// XPropertySet
80 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo>  SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException);
81 		virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
82 
83 		// OPropertyArrayUsageHelper
84 		virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
85 
86 		// XJob
87         virtual ::com::sun::star::uno::Any SAL_CALL execute( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& lArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
88 
89         using OABSPilotUno_DBase::execute;
90 	protected:
91 	// OGenericUnoDialog overridables
92 		virtual Dialog*	createDialog(Window* _pParent);
93         virtual void executedDialog(sal_Int16 _nExecutionResult);
94 	};
95 
96 //.........................................................................
97 }	// namespace abp
98 //.........................................................................
99 
100 #endif // EXTENSIONS_ABP_UNODIALOG_HXX
101 
102