2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 // no include protection
20 // this file is included from unoautopilot.hxx directly
22 //=====================================================================
24 //=====================================================================
25 template <class TYPE, class SERVICEINFO>
26 OUnoAutoPilot<TYPE, SERVICEINFO>::OUnoAutoPilot(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB)
27 :OUnoAutoPilot_Base(_rxORB)
31 //---------------------------------------------------------------------
32 template <class TYPE, class SERVICEINFO>
33 ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationId( ) throw(::com::sun::star::uno::RuntimeException)
35 static ::cppu::OImplementationId aId;
36 return aId.getImplementationId();
39 //---------------------------------------------------------------------
40 template <class TYPE, class SERVICEINFO>
41 ::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)
43 return *(new OUnoAutoPilot<TYPE, SERVICEINFO>( comphelper::getComponentContext(_rxFactory) ));
46 //---------------------------------------------------------------------
47 template <class TYPE, class SERVICEINFO>
48 ::rtl::OUString SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName() throw(::com::sun::star::uno::RuntimeException)
50 return getImplementationName_Static();
53 //---------------------------------------------------------------------
54 template <class TYPE, class SERVICEINFO>
55 ::rtl::OUString OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName_Static() throw(::com::sun::star::uno::RuntimeException)
57 return SERVICEINFO().getImplementationName();
60 //---------------------------------------------------------------------
61 template <class TYPE, class SERVICEINFO>
62 ::comphelper::StringSequence SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
64 return getSupportedServiceNames_Static();
67 //---------------------------------------------------------------------
68 template <class TYPE, class SERVICEINFO>
69 ::comphelper::StringSequence OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames_Static() throw(::com::sun::star::uno::RuntimeException)
71 return SERVICEINFO().getServiceNames();
74 //---------------------------------------------------------------------
75 template <class TYPE, class SERVICEINFO>
76 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)
78 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
82 //---------------------------------------------------------------------
83 template <class TYPE, class SERVICEINFO>
84 ::cppu::IPropertyArrayHelper& OUnoAutoPilot<TYPE, SERVICEINFO>::getInfoHelper()
86 return *const_cast<OUnoAutoPilot*>(this)->getArrayHelper();
89 //--------------------------------------------------------------------------
90 template <class TYPE, class SERVICEINFO>
91 ::cppu::IPropertyArrayHelper* OUnoAutoPilot<TYPE, SERVICEINFO>::createArrayHelper( ) const
93 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aProps;
94 describeProperties(aProps);
95 return new ::cppu::OPropertyArrayHelper(aProps);
98 //--------------------------------------------------------------------------
99 template <class TYPE, class SERVICEINFO>
100 Dialog* OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(Window* _pParent)
102 return new TYPE(_pParent, m_xObjectModel, m_aContext);
105 //--------------------------------------------------------------------------
106 template <class TYPE, class SERVICEINFO>
107 void OUnoAutoPilot<TYPE, SERVICEINFO>::implInitialize(const com::sun::star::uno::Any& _rValue)
109 ::com::sun::star::beans::PropertyValue aArgument;
110 if (_rValue >>= aArgument)
111 if (0 == aArgument.Name.compareToAscii("ObjectModel"))
113 aArgument.Value >>= m_xObjectModel;
117 OUnoAutoPilot_Base::implInitialize(_rValue);