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 		throw( com::sun::star::uno::RuntimeException );
69     virtual void SAL_CALL
70 	acquire() throw();
71     virtual void SAL_CALL
72 	release() throw();
73 
74 	// XTypeProvider
75     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
76 	getImplementationId()
77 		throw( com::sun::star::uno::RuntimeException );
78     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
79 	getTypes()
80 		throw( com::sun::star::uno::RuntimeException );
81 
82 	// XContentIdentifier
83     virtual rtl::OUString SAL_CALL
84 	getContentIdentifier()
85 		throw( com::sun::star::uno::RuntimeException );
86     virtual rtl::OUString SAL_CALL
87 	getContentProviderScheme()
88 		throw( com::sun::star::uno::RuntimeException );
89 
90 private:
91 	ContentIdentifier_Impl* m_pImpl;
92 };
93 
94 } /* namespace ucbhelper */
95 
96 #endif /* !_UCBHELPER_CONTENTIDENTIFIER_HXX */
97