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