1*b1cdbd2cSJim Jagielski/**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski// no include protecttion
25*b1cdbd2cSJim Jagielski// this file is included from unoautopilot.hxx directly
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski//using namespace ::com::sun::star::uno;
28*b1cdbd2cSJim Jagielski//using namespace ::com::sun::star::lang;
29*b1cdbd2cSJim Jagielski//using namespace ::com::sun::star::beans;
30*b1cdbd2cSJim Jagielski//
31*b1cdbd2cSJim Jagielski//=====================================================================
32*b1cdbd2cSJim Jagielski//= OUnoAutoPilot
33*b1cdbd2cSJim Jagielski//=====================================================================
34*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
35*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
36*b1cdbd2cSJim JagielskiOUnoAutoPilot<TYPE, SERVICEINFO>::OUnoAutoPilot(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB)
37*b1cdbd2cSJim Jagielski	:OUnoAutoPilot_Base(_rxORB)
38*b1cdbd2cSJim Jagielski{
39*b1cdbd2cSJim Jagielski}
40*b1cdbd2cSJim Jagielski
41*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
42*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
43*b1cdbd2cSJim Jagielski::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException)
44*b1cdbd2cSJim Jagielski{
45*b1cdbd2cSJim Jagielski	static ::cppu::OImplementationId aId;
46*b1cdbd2cSJim Jagielski	return aId.getImplementationId();
47*b1cdbd2cSJim Jagielski}
48*b1cdbd2cSJim Jagielski
49*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
50*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
51*b1cdbd2cSJim Jagielski::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*b1cdbd2cSJim Jagielski{
53*b1cdbd2cSJim Jagielski	return *(new OUnoAutoPilot<TYPE, SERVICEINFO>(_rxFactory));
54*b1cdbd2cSJim Jagielski}
55*b1cdbd2cSJim Jagielski
56*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
57*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
58*b1cdbd2cSJim Jagielski::rtl::OUString SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName() throw(::com::sun::star::uno::RuntimeException)
59*b1cdbd2cSJim Jagielski{
60*b1cdbd2cSJim Jagielski	return getImplementationName_Static();
61*b1cdbd2cSJim Jagielski}
62*b1cdbd2cSJim Jagielski
63*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
64*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
65*b1cdbd2cSJim Jagielski::rtl::OUString OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName_Static() throw(::com::sun::star::uno::RuntimeException)
66*b1cdbd2cSJim Jagielski{
67*b1cdbd2cSJim Jagielski	return SERVICEINFO().getImplementationName();
68*b1cdbd2cSJim Jagielski}
69*b1cdbd2cSJim Jagielski
70*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
71*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
72*b1cdbd2cSJim Jagielski::comphelper::StringSequence SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
73*b1cdbd2cSJim Jagielski{
74*b1cdbd2cSJim Jagielski	return getSupportedServiceNames_Static();
75*b1cdbd2cSJim Jagielski}
76*b1cdbd2cSJim Jagielski
77*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
78*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
79*b1cdbd2cSJim Jagielski::comphelper::StringSequence OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames_Static() throw(::com::sun::star::uno::RuntimeException)
80*b1cdbd2cSJim Jagielski{
81*b1cdbd2cSJim Jagielski	return SERVICEINFO().getServiceNames();
82*b1cdbd2cSJim Jagielski}
83*b1cdbd2cSJim Jagielski
84*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
85*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
86*b1cdbd2cSJim Jagielski::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >  SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)
87*b1cdbd2cSJim Jagielski{
88*b1cdbd2cSJim Jagielski	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >  xInfo( createPropertySetInfo( getInfoHelper() ) );
89*b1cdbd2cSJim Jagielski	return xInfo;
90*b1cdbd2cSJim Jagielski}
91*b1cdbd2cSJim Jagielski
92*b1cdbd2cSJim Jagielski//---------------------------------------------------------------------
93*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
94*b1cdbd2cSJim Jagielski::cppu::IPropertyArrayHelper& OUnoAutoPilot<TYPE, SERVICEINFO>::getInfoHelper()
95*b1cdbd2cSJim Jagielski{
96*b1cdbd2cSJim Jagielski	return *const_cast<OUnoAutoPilot*>(this)->getArrayHelper();
97*b1cdbd2cSJim Jagielski}
98*b1cdbd2cSJim Jagielski
99*b1cdbd2cSJim Jagielski//--------------------------------------------------------------------------
100*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
101*b1cdbd2cSJim Jagielski::cppu::IPropertyArrayHelper* OUnoAutoPilot<TYPE, SERVICEINFO>::createArrayHelper( ) const
102*b1cdbd2cSJim Jagielski{
103*b1cdbd2cSJim Jagielski	::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aProps;
104*b1cdbd2cSJim Jagielski	describeProperties(aProps);
105*b1cdbd2cSJim Jagielski	return new ::cppu::OPropertyArrayHelper(aProps);
106*b1cdbd2cSJim Jagielski}
107*b1cdbd2cSJim Jagielski
108*b1cdbd2cSJim Jagielski//--------------------------------------------------------------------------
109*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
110*b1cdbd2cSJim JagielskiDialog*	OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(Window* _pParent)
111*b1cdbd2cSJim Jagielski{
112*b1cdbd2cSJim Jagielski	return new TYPE(_pParent, m_xObjectModel, m_aContext.getLegacyServiceFactory());
113*b1cdbd2cSJim Jagielski}
114*b1cdbd2cSJim Jagielski
115*b1cdbd2cSJim Jagielski//--------------------------------------------------------------------------
116*b1cdbd2cSJim Jagielskitemplate <class TYPE, class SERVICEINFO>
117*b1cdbd2cSJim Jagielskivoid OUnoAutoPilot<TYPE, SERVICEINFO>::implInitialize(const com::sun::star::uno::Any& _rValue)
118*b1cdbd2cSJim Jagielski{
119*b1cdbd2cSJim Jagielski	::com::sun::star::beans::PropertyValue aArgument;
120*b1cdbd2cSJim Jagielski	if (_rValue >>= aArgument)
121*b1cdbd2cSJim Jagielski		if (0 == aArgument.Name.compareToAscii("ObjectModel"))
122*b1cdbd2cSJim Jagielski		{
123*b1cdbd2cSJim Jagielski			aArgument.Value >>= m_xObjectModel;
124*b1cdbd2cSJim Jagielski			return;
125*b1cdbd2cSJim Jagielski		}
126*b1cdbd2cSJim Jagielski
127*b1cdbd2cSJim Jagielski	OUnoAutoPilot_Base::implInitialize(_rValue);
128*b1cdbd2cSJim Jagielski}
129*b1cdbd2cSJim Jagielski
130*b1cdbd2cSJim Jagielski
131