xref: /aoo42x/main/ucb/source/ucp/file/filid.hxx (revision cdf0e10c)
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 #ifndef _FILID_HXX_
28 #define _FILID_HXX_
29 
30 #include <rtl/ustring.hxx>
31 #include <cppuhelper/weak.hxx>
32 #include <com/sun/star/lang/XTypeProvider.hpp>
33 #include <com/sun/star/ucb/XContentIdentifier.hpp>
34 
35 namespace fileaccess {
36 
37 	class shell;
38 
39 	class FileContentIdentifier :
40 		public cppu::OWeakObject,
41 		public com::sun::star::lang::XTypeProvider,
42 		public com::sun::star::ucb::XContentIdentifier
43 	{
44 
45 		// This implementation has to be reworked
46 	public:
47 		FileContentIdentifier( shell* pMyShell,
48 							   const rtl::OUString& aUnqPath,
49 							   sal_Bool IsNormalized = true );
50 
51 		virtual ~FileContentIdentifier();
52 
53 		// XInterface
54 		virtual com::sun::star::uno::Any SAL_CALL
55 		queryInterface(
56 			const com::sun::star::uno::Type& aType )
57 			throw( com::sun::star::uno::RuntimeException );
58 
59 		virtual void SAL_CALL
60 		acquire(
61 			void )
62 			throw();
63 
64 		virtual void SAL_CALL
65 		release(
66 			void )
67 			throw();
68 
69 		// XTypeProvider
70 		virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
71 		getTypes(
72 			void )
73 			throw( com::sun::star::uno::RuntimeException );
74 
75 		virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
76 		getImplementationId(
77 			void )
78 			throw( com::sun::star::uno::RuntimeException );
79 
80 		// XContentIdentifier
81 		virtual rtl::OUString SAL_CALL
82 		getContentIdentifier(
83 			void )
84 			throw( com::sun::star::uno::RuntimeException );
85 
86 		virtual rtl::OUString SAL_CALL
87 		getContentProviderScheme(
88 			void )
89 			throw( com::sun::star::uno::RuntimeException );
90 
91 	private:
92 		shell* m_pMyShell;
93 		rtl::OUString m_aContentId;              // The URL string
94 		rtl::OUString m_aNormalizedId;           // The somehow normalized string
95 		rtl::OUString m_aProviderScheme;
96 		sal_Bool      m_bNormalized;
97 	};
98 
99 } // end namespace fileaccess
100 
101 
102 #endif
103