1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 // no include protecttion
29 // this file is included from unoautopilot.hxx directly
31 //using namespace ::com::sun::star::uno;
32 //using namespace ::com::sun::star::lang;
33 //using namespace ::com::sun::star::beans;
35 //=====================================================================
37 //=====================================================================
38 //---------------------------------------------------------------------
39 template <class TYPE, class SERVICEINFO>
40 OUnoAutoPilot<TYPE, SERVICEINFO>::OUnoAutoPilot(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB)
41 :OUnoAutoPilot_Base(_rxORB)
45 //---------------------------------------------------------------------
46 template <class TYPE, class SERVICEINFO>
47 ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationId( ) throw(::com::sun::star::uno::RuntimeException)
49 static ::cppu::OImplementationId aId;
50 return aId.getImplementationId();
53 //---------------------------------------------------------------------
54 template <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)
57 return *(new OUnoAutoPilot<TYPE, SERVICEINFO>(_rxFactory));
60 //---------------------------------------------------------------------
61 template <class TYPE, class SERVICEINFO>
62 ::rtl::OUString SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName() throw(::com::sun::star::uno::RuntimeException)
64 return getImplementationName_Static();
67 //---------------------------------------------------------------------
68 template <class TYPE, class SERVICEINFO>
69 ::rtl::OUString OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName_Static() throw(::com::sun::star::uno::RuntimeException)
71 return SERVICEINFO().getImplementationName();
74 //---------------------------------------------------------------------
75 template <class TYPE, class SERVICEINFO>
76 ::comphelper::StringSequence SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
78 return getSupportedServiceNames_Static();
81 //---------------------------------------------------------------------
82 template <class TYPE, class SERVICEINFO>
83 ::comphelper::StringSequence OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames_Static() throw(::com::sun::star::uno::RuntimeException)
85 return SERVICEINFO().getServiceNames();
88 //---------------------------------------------------------------------
89 template <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)
92 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
96 //---------------------------------------------------------------------
97 template <class TYPE, class SERVICEINFO>
98 ::cppu::IPropertyArrayHelper& OUnoAutoPilot<TYPE, SERVICEINFO>::getInfoHelper()
100 return *const_cast<OUnoAutoPilot*>(this)->getArrayHelper();
103 //--------------------------------------------------------------------------
104 template <class TYPE, class SERVICEINFO>
105 ::cppu::IPropertyArrayHelper* OUnoAutoPilot<TYPE, SERVICEINFO>::createArrayHelper( ) const
107 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aProps;
108 describeProperties(aProps);
109 return new ::cppu::OPropertyArrayHelper(aProps);
112 //--------------------------------------------------------------------------
113 template <class TYPE, class SERVICEINFO>
114 Dialog* OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(Window* _pParent)
116 return new TYPE(_pParent, m_xObjectModel, m_aContext.getLegacyServiceFactory());
119 //--------------------------------------------------------------------------
120 template <class TYPE, class SERVICEINFO>
121 void OUnoAutoPilot<TYPE, SERVICEINFO>::implInitialize(const com::sun::star::uno::Any& _rValue)
123 ::com::sun::star::beans::PropertyValue aArgument;
124 if (_rValue >>= aArgument)
125 if (0 == aArgument.Name.compareToAscii("ObjectModel"))
127 aArgument.Value >>= m_xObjectModel;
131 OUnoAutoPilot_Base::implInitialize(_rValue);