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 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_ucb.hxx" 26 27 /************************************************************************** 28 TODO 29 ************************************************************************** 30 31 *************************************************************************/ 32 #include "ftpcontentidentifier.hxx" 33 #include "ftpcontentprovider.hxx" 34 35 using namespace ftp; 36 using namespace com::sun::star::uno; 37 using namespace com::sun::star::ucb; 38 using namespace com::sun::star::lang; 39 40 41 FTPContentIdentifier::FTPContentIdentifier( 42 const rtl::OUString& ident 43 ) 44 : m_ident(ident) 45 { 46 } 47 48 49 FTPContentIdentifier::~FTPContentIdentifier() 50 { 51 } 52 53 54 Any SAL_CALL 55 FTPContentIdentifier::queryInterface( 56 const Type& rType 57 ) 58 throw( 59 RuntimeException 60 ) 61 { 62 Any aRet = 63 ::cppu::queryInterface(rType, 64 SAL_STATIC_CAST(XTypeProvider*,this), 65 SAL_STATIC_CAST(XContentIdentifier*,this)); 66 67 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); 68 } 69 70 71 void SAL_CALL FTPContentIdentifier::acquire( void ) throw() { 72 OWeakObject::acquire(); 73 } 74 75 76 void SAL_CALL FTPContentIdentifier::release( void ) throw() { 77 OWeakObject::release(); 78 } 79 80 81 Sequence<sal_Int8> SAL_CALL 82 FTPContentIdentifier::getImplementationId() 83 throw(RuntimeException) 84 { 85 static cppu::OImplementationId* pId = NULL; 86 if(!pId) 87 { 88 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 89 if ( !pId ) 90 { 91 static cppu::OImplementationId id( sal_False ); 92 pId = &id; 93 } 94 } 95 return (*pId).getImplementationId(); 96 } 97 98 99 Sequence<Type> SAL_CALL 100 FTPContentIdentifier::getTypes( 101 void ) 102 throw(RuntimeException) 103 { 104 static cppu::OTypeCollection* pCollection = NULL; 105 if ( !pCollection ) { 106 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 107 if ( !pCollection ) 108 { 109 static cppu::OTypeCollection collection( 110 getCppuType( 111 static_cast<Reference<XTypeProvider>*>(0)), 112 getCppuType( 113 static_cast<Reference<XContentIdentifier>*>(0))); 114 pCollection = &collection; 115 } 116 } 117 return (*pCollection).getTypes(); 118 } 119 120 121 rtl::OUString SAL_CALL 122 FTPContentIdentifier::getContentIdentifier( 123 ) 124 throw ( 125 com::sun::star::uno::RuntimeException 126 ) 127 { 128 return m_ident; 129 } 130 131 132 rtl::OUString SAL_CALL 133 FTPContentIdentifier::getContentProviderScheme( 134 ) 135 throw ( 136 com::sun::star::uno::RuntimeException 137 ) 138 { 139 return rtl::OUString::createFromAscii("ftp"); 140 } 141 142 143 144 145 146 147