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