1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _TREEVIEW_TVFACTORY_HXX_ 25 #define _TREEVIEW_TVFACTORY_HXX_ 26 27 #include <rtl/ref.hxx> 28 #include <rtl/ustring.hxx> 29 #include <cppuhelper/weak.hxx> 30 #include <ucbhelper/macros.hxx> 31 #include <com/sun/star/uno/XInterface.hpp> 32 #include <com/sun/star/lang/XServiceInfo.hpp> 33 #include <com/sun/star/lang/XTypeProvider.hpp> 34 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 35 36 37 38 namespace treeview { 39 40 class TVFactory: 41 public cppu::OWeakObject, 42 public com::sun::star::lang::XServiceInfo, 43 public com::sun::star::lang::XTypeProvider, 44 public com::sun::star::lang::XMultiServiceFactory 45 { 46 public: 47 48 TVFactory( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMSF ); 49 50 ~TVFactory(); 51 52 // XInterface 53 virtual com::sun::star::uno::Any SAL_CALL 54 queryInterface( 55 const com::sun::star::uno::Type& aType ) 56 throw( com::sun::star::uno::RuntimeException); 57 58 virtual void SAL_CALL 59 acquire( 60 void ) 61 throw(); 62 63 virtual void SAL_CALL 64 release( 65 void ) 66 throw(); 67 68 69 // XTypeProvider 70 71 XTYPEPROVIDER_DECL() 72 73 74 // XServiceInfo 75 virtual rtl::OUString SAL_CALL 76 getImplementationName( 77 void ) 78 throw( com::sun::star::uno::RuntimeException ); 79 80 virtual sal_Bool SAL_CALL 81 supportsService( 82 const rtl::OUString& ServiceName ) 83 throw(com::sun::star::uno::RuntimeException ); 84 85 virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 86 getSupportedServiceNames( 87 void ) 88 throw( com::sun::star::uno::RuntimeException ); 89 90 // XMultiServiceFactory 91 92 virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL 93 createInstance( 94 const rtl::OUString& aServiceSpecifier ) 95 throw( com::sun::star::uno::Exception, 96 com::sun::star::uno::RuntimeException ); 97 98 virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL 99 createInstanceWithArguments( 100 const rtl::OUString& ServiceSpecifier, 101 const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& Arguments ) 102 throw( com::sun::star::uno::Exception, 103 com::sun::star::uno::RuntimeException); 104 105 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL 106 getAvailableServiceNames( ) 107 throw( com::sun::star::uno::RuntimeException ); 108 109 // Other 110 111 static rtl::OUString SAL_CALL getImplementationName_static(); 112 113 static com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames_static(); 114 115 static com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > SAL_CALL 116 createServiceFactory( 117 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr ); 118 119 static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL 120 CreateInstance( 121 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xMultiServiceFactory ); 122 123 124 private: 125 126 // Members 127 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF; 128 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xHDS; 129 }; 130 131 } 132 133 134 #endif 135