1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 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. 14 * 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). 20 * 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. 25 * 26 ************************************************************************/ 27 28 #ifndef _TREEVIEW_TVFACTORY_HXX_ 29 #define _TREEVIEW_TVFACTORY_HXX_ 30 31 #include <rtl/ref.hxx> 32 #include <rtl/ustring.hxx> 33 #include <cppuhelper/weak.hxx> 34 #include <ucbhelper/macros.hxx> 35 #include <com/sun/star/uno/XInterface.hpp> 36 #include <com/sun/star/lang/XServiceInfo.hpp> 37 #include <com/sun/star/lang/XTypeProvider.hpp> 38 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 39 40 41 42 namespace treeview { 43 44 class TVFactory: 45 public cppu::OWeakObject, 46 public com::sun::star::lang::XServiceInfo, 47 public com::sun::star::lang::XTypeProvider, 48 public com::sun::star::lang::XMultiServiceFactory 49 { 50 public: 51 52 TVFactory( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF ); 53 54 ~TVFactory(); 55 56 // XInterface 57 virtual com::sun::star::uno::Any SAL_CALL 58 queryInterface( 59 const com::sun::star::uno::Type& aType ) 60 throw( com::sun::star::uno::RuntimeException); 61 62 virtual void SAL_CALL 63 acquire( 64 void ) 65 throw(); 66 67 virtual void SAL_CALL 68 release( 69 void ) 70 throw(); 71 72 73 // XTypeProvider 74 75 XTYPEPROVIDER_DECL() 76 77 78 // XServiceInfo 79 virtual rtl::OUString SAL_CALL 80 getImplementationName( 81 void ) 82 throw( com::sun::star::uno::RuntimeException ); 83 84 virtual sal_Bool SAL_CALL 85 supportsService( 86 const rtl::OUString& ServiceName ) 87 throw(com::sun::star::uno::RuntimeException ); 88 89 virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 90 getSupportedServiceNames( 91 void ) 92 throw( com::sun::star::uno::RuntimeException ); 93 94 // XMultiServiceFactory 95 96 virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL 97 createInstance( 98 const rtl::OUString& aServiceSpecifier ) 99 throw( com::sun::star::uno::Exception, 100 com::sun::star::uno::RuntimeException ); 101 102 virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL 103 createInstanceWithArguments( 104 const rtl::OUString& ServiceSpecifier, 105 const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& Arguments ) 106 throw( com::sun::star::uno::Exception, 107 com::sun::star::uno::RuntimeException); 108 109 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL 110 getAvailableServiceNames( ) 111 throw( com::sun::star::uno::RuntimeException ); 112 113 // Other 114 115 static rtl::OUString SAL_CALL getImplementationName_static(); 116 117 static com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames_static(); 118 119 static com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > SAL_CALL 120 createServiceFactory( 121 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr ); 122 123 static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL 124 CreateInstance( 125 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMultiServiceFactory ); 126 127 128 private: 129 130 // Members 131 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF; 132 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xHDS; 133 }; 134 135 } 136 137 138 #endif 139