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 _UCBHELPER_CONTENTIDENTIFIER_HXX 25 #define _UCBHELPER_CONTENTIDENTIFIER_HXX 26 27 #include <cppuhelper/weak.hxx> 28 #include <com/sun/star/lang/XTypeProvider.hpp> 29 #include <com/sun/star/ucb/XContentIdentifier.hpp> 30 #include "ucbhelper/ucbhelperdllapi.h" 31 32 namespace com { namespace sun { namespace star { namespace lang { 33 class XMultiServiceFactory; 34 } } } } 35 36 namespace rtl { 37 class OUString; 38 } 39 40 namespace ucbhelper 41 { 42 43 struct ContentIdentifier_Impl; 44 45 //========================================================================= 46 47 /** 48 * This class implements a simple identifier object for UCB contents. 49 * It mainly stores and returns the URL as it was passed to the constructor - 50 * The only difference is that the URL scheme will be lower cased. This can 51 * be done, because URL schemes are never case sensitive. 52 */ 53 class UCBHELPER_DLLPUBLIC ContentIdentifier : 54 public cppu::OWeakObject, 55 public com::sun::star::lang::XTypeProvider, 56 public com::sun::star::ucb::XContentIdentifier 57 { 58 public: 59 ContentIdentifier( const com::sun::star::uno::Reference< 60 com::sun::star::lang::XMultiServiceFactory >& rxSMgr, 61 const rtl::OUString& rURL ); 62 ContentIdentifier( const rtl::OUString& rURL ); 63 virtual ~ContentIdentifier(); 64 65 // XInterface 66 virtual com::sun::star::uno::Any SAL_CALL 67 queryInterface( const com::sun::star::uno::Type & rType ); 68 virtual void SAL_CALL 69 acquire() throw(); 70 virtual void SAL_CALL 71 release() throw(); 72 73 // XTypeProvider 74 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL 75 getImplementationId(); 76 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL 77 getTypes(); 78 79 // XContentIdentifier 80 virtual rtl::OUString SAL_CALL 81 getContentIdentifier(); 82 virtual rtl::OUString SAL_CALL 83 getContentProviderScheme(); 84 85 private: 86 ContentIdentifier_Impl* m_pImpl; 87 }; 88 89 } /* namespace ucbhelper */ 90 91 #endif /* !_UCBHELPER_CONTENTIDENTIFIER_HXX */ 92