merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / inc / confsvccomponent.hxx
blob237f3a6f1f38b8dcb0af3799a171ff62e36a9a07
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: confsvccomponent.hxx,v $
10 * $Revision: 1.6 $
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 #ifndef CONFIGMGR_API_SVCCOMPONENT_HXX_
32 #define CONFIGMGR_API_SVCCOMPONENT_HXX_
34 #include "serviceinfohelper.hxx"
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <cppuhelper/compbase1.hxx>
37 #include <cppuhelper/typeprovider.hxx>
39 #ifndef _OSL_MUTEX_HXX_
40 #include <osl/Mutex.hxx>
41 #endif
42 #include <rtl/ustring.hxx>
44 namespace configmgr
47 //----------------------------------------------------------------------------
48 namespace css = ::com::sun::star;
49 namespace uno = css::uno;
50 namespace lang = css::lang;
52 //----------------------------------------------------------------------------
53 class ServiceComponentImpl
54 : public ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >
56 protected:
57 ServiceImplementationInfo const*const m_info;
58 public:
59 ServiceComponentImpl(ServiceImplementationInfo const* aInfo);
61 // XTypeProvider
62 virtual uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(uno::RuntimeException);
63 //virtual uno::Sequence<uno::Type> SAL_CALL getTypes( ) throw(uno::RuntimeException) = 0;
65 // XServiceInfo
66 virtual rtl::OUString SAL_CALL getImplementationName( ) throw(uno::RuntimeException);
67 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException);
68 virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(uno::RuntimeException);
70 // Component Helper - force override
71 virtual void SAL_CALL disposing() = 0;
72 // Component Helper - check object state
73 virtual void checkAlive() throw (uno::RuntimeException);
74 void checkAlive(char const* message) throw (uno::RuntimeException)
75 { checkAlive( rtl::OUString::createFromAscii(message) ); }
76 void checkAlive(rtl::OUString const& message) throw (uno::RuntimeException);
78 // Extra helpers
79 static uno::Sequence<sal_Int8> getStaticImplementationId(ServiceImplementationInfo const* pServiceInfo) throw(uno::RuntimeException);
81 private: // no implementation
82 ServiceComponentImpl(ServiceComponentImpl&);
83 void operator=(ServiceComponentImpl&);
85 //----------------------------------------------------------------------------
87 } // namespace configmgr
89 #endif // CONFIGMGR_API_SVCCOMPONENT_HXX_