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// no include protecttion
29// this file is included from unoautopilot.hxx directly
30
31//using namespace ::com::sun::star::uno;
32//using namespace ::com::sun::star::lang;
33//using namespace ::com::sun::star::beans;
34//
35//=====================================================================
36//= OUnoAutoPilot
37//=====================================================================
38//---------------------------------------------------------------------
39template <class TYPE, class SERVICEINFO>
40OUnoAutoPilot<TYPE, SERVICEINFO>::OUnoAutoPilot(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB)
41	:OUnoAutoPilot_Base(_rxORB)
42{
43}
44
45//---------------------------------------------------------------------
46template <class TYPE, class SERVICEINFO>
47::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException)
48{
49	static ::cppu::OImplementationId aId;
50	return aId.getImplementationId();
51}
52
53//---------------------------------------------------------------------
54template <class TYPE, class SERVICEINFO>
55::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory)
56{
57	return *(new OUnoAutoPilot<TYPE, SERVICEINFO>(_rxFactory));
58}
59
60//---------------------------------------------------------------------
61template <class TYPE, class SERVICEINFO>
62::rtl::OUString SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName() throw(::com::sun::star::uno::RuntimeException)
63{
64	return getImplementationName_Static();
65}
66
67//---------------------------------------------------------------------
68template <class TYPE, class SERVICEINFO>
69::rtl::OUString OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName_Static() throw(::com::sun::star::uno::RuntimeException)
70{
71	return SERVICEINFO().getImplementationName();
72}
73
74//---------------------------------------------------------------------
75template <class TYPE, class SERVICEINFO>
76::comphelper::StringSequence SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
77{
78	return getSupportedServiceNames_Static();
79}
80
81//---------------------------------------------------------------------
82template <class TYPE, class SERVICEINFO>
83::comphelper::StringSequence OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames_Static() throw(::com::sun::star::uno::RuntimeException)
84{
85	return SERVICEINFO().getServiceNames();
86}
87
88//---------------------------------------------------------------------
89template <class TYPE, class SERVICEINFO>
90::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >  SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)
91{
92	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >  xInfo( createPropertySetInfo( getInfoHelper() ) );
93	return xInfo;
94}
95
96//---------------------------------------------------------------------
97template <class TYPE, class SERVICEINFO>
98::cppu::IPropertyArrayHelper& OUnoAutoPilot<TYPE, SERVICEINFO>::getInfoHelper()
99{
100	return *const_cast<OUnoAutoPilot*>(this)->getArrayHelper();
101}
102
103//--------------------------------------------------------------------------
104template <class TYPE, class SERVICEINFO>
105::cppu::IPropertyArrayHelper* OUnoAutoPilot<TYPE, SERVICEINFO>::createArrayHelper( ) const
106{
107	::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aProps;
108	describeProperties(aProps);
109	return new ::cppu::OPropertyArrayHelper(aProps);
110}
111
112//--------------------------------------------------------------------------
113template <class TYPE, class SERVICEINFO>
114Dialog*	OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(Window* _pParent)
115{
116	return new TYPE(_pParent, m_xObjectModel, m_aContext.getLegacyServiceFactory());
117}
118
119//--------------------------------------------------------------------------
120template <class TYPE, class SERVICEINFO>
121void OUnoAutoPilot<TYPE, SERVICEINFO>::implInitialize(const com::sun::star::uno::Any& _rValue)
122{
123	::com::sun::star::beans::PropertyValue aArgument;
124	if (_rValue >>= aArgument)
125		if (0 == aArgument.Name.compareToAscii("ObjectModel"))
126		{
127			aArgument.Value >>= m_xObjectModel;
128			return;
129		}
130
131	OUnoAutoPilot_Base::implInitialize(_rValue);
132}
133
134
135