1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unoautopilot.inl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // no include protecttion
32 // this file is included from unoautopilot.hxx directly
34 //using namespace ::com::sun::star::uno;
35 //using namespace ::com::sun::star::lang;
36 //using namespace ::com::sun::star::beans;
38 //=====================================================================
40 //=====================================================================
41 //---------------------------------------------------------------------
42 template <class TYPE, class SERVICEINFO>
43 OUnoAutoPilot<TYPE, SERVICEINFO>::OUnoAutoPilot(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB)
44 :OUnoAutoPilot_Base(_rxORB)
48 //---------------------------------------------------------------------
49 template <class TYPE, class SERVICEINFO>
50 ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationId( ) throw(::com::sun::star::uno::RuntimeException)
52 static ::cppu::OImplementationId aId;
53 return aId.getImplementationId();
56 //---------------------------------------------------------------------
57 template <class TYPE, class SERVICEINFO>
58 ::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)
60 return *(new OUnoAutoPilot<TYPE, SERVICEINFO>(_rxFactory));
63 //---------------------------------------------------------------------
64 template <class TYPE, class SERVICEINFO>
65 ::rtl::OUString SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName() throw(::com::sun::star::uno::RuntimeException)
67 return getImplementationName_Static();
70 //---------------------------------------------------------------------
71 template <class TYPE, class SERVICEINFO>
72 ::rtl::OUString OUnoAutoPilot<TYPE, SERVICEINFO>::getImplementationName_Static() throw(::com::sun::star::uno::RuntimeException)
74 return SERVICEINFO().getImplementationName();
77 //---------------------------------------------------------------------
78 template <class TYPE, class SERVICEINFO>
79 ::comphelper::StringSequence SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
81 return getSupportedServiceNames_Static();
84 //---------------------------------------------------------------------
85 template <class TYPE, class SERVICEINFO>
86 ::comphelper::StringSequence OUnoAutoPilot<TYPE, SERVICEINFO>::getSupportedServiceNames_Static() throw(::com::sun::star::uno::RuntimeException)
88 return SERVICEINFO().getServiceNames();
91 //---------------------------------------------------------------------
92 template <class TYPE, class SERVICEINFO>
93 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OUnoAutoPilot<TYPE, SERVICEINFO>::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException)
95 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
99 //---------------------------------------------------------------------
100 template <class TYPE, class SERVICEINFO>
101 ::cppu::IPropertyArrayHelper& OUnoAutoPilot<TYPE, SERVICEINFO>::getInfoHelper()
103 return *const_cast<OUnoAutoPilot*>(this)->getArrayHelper();
106 //--------------------------------------------------------------------------
107 template <class TYPE, class SERVICEINFO>
108 ::cppu::IPropertyArrayHelper* OUnoAutoPilot<TYPE, SERVICEINFO>::createArrayHelper( ) const
110 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aProps;
111 describeProperties(aProps);
112 return new ::cppu::OPropertyArrayHelper(aProps);
115 //--------------------------------------------------------------------------
116 template <class TYPE, class SERVICEINFO>
117 Dialog* OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(Window* _pParent)
119 return new TYPE(_pParent, m_xObjectModel, m_aContext.getLegacyServiceFactory());
122 //--------------------------------------------------------------------------
123 template <class TYPE, class SERVICEINFO>
124 void OUnoAutoPilot<TYPE, SERVICEINFO>::implInitialize(const com::sun::star::uno::Any& _rValue)
126 ::com::sun::star::beans::PropertyValue aArgument;
127 if (_rValue >>= aArgument)
128 if (0 == aArgument.Name.compareToAscii("ObjectModel"))
130 aArgument.Value >>= m_xObjectModel;
134 OUnoAutoPilot_Base::implInitialize(_rValue);