1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef UCB_UCPEXT_CONTENT_HXX
29 #define UCB_UCPEXT_CONTENT_HXX
31 /** === begin UNO includes === **/
32 #include <com/sun/star/sdbc/XRow.hpp>
33 #include <com/sun/star/beans/PropertyValue.hpp>
34 /** === end UNO includes === **/
36 #include <rtl/ref.hxx>
37 #include <ucbhelper/contenthelper.hxx>
40 #include <boost/optional.hpp>
42 //......................................................................................................................
43 namespace ucb
{ namespace ucp
{ namespace ext
45 //......................................................................................................................
47 //==================================================================================================================
48 //= ExtensionContentType
49 //==================================================================================================================
50 enum ExtensionContentType
59 //==================================================================================================================
61 //==================================================================================================================
62 typedef ::ucbhelper::ContentImplHelper Content_Base
;
63 class Content
: public Content_Base
67 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& rxSMgr
,
68 ::ucbhelper::ContentProviderImplHelper
* pProvider
,
69 const ::com::sun::star::uno::Reference
< ::com::sun::star::ucb::XContentIdentifier
>& Identifier
72 static ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRow
>
73 getArtificialNodePropertyValues(
74 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& rSMgr
,
75 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& rProperties
,
76 const ::rtl::OUString
& rTitle
79 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRow
>
81 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& rProperties
,
82 const ::com::sun::star::uno::Reference
< ::com::sun::star::ucb::XCommandEnvironment
>& xEnv
85 static ::rtl::OUString
86 encodeIdentifier( const ::rtl::OUString
& i_rIdentifier
);
87 static ::rtl::OUString
88 decodeIdentifier( const ::rtl::OUString
& i_rIdentifier
);
90 virtual ::rtl::OUString
getParentURL();
92 ExtensionContentType
getExtensionContentType() const { return m_eExtContentType
; }
94 /** retrieves the URL of the underlying physical content. Not to be called when getExtensionContentType()
97 ::rtl::OUString
getPhysicalURL() const;
103 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
);
104 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException
);
107 virtual rtl::OUString SAL_CALL
getContentType() throw( com::sun::star::uno::RuntimeException
);
110 virtual com::sun::star::uno::Any SAL_CALL
112 const com::sun::star::ucb::Command
& aCommand
,
114 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& Environment
116 throw ( ::com::sun::star::uno::Exception
117 , ::com::sun::star::ucb::CommandAbortedException
118 , ::com::sun::star::uno::RuntimeException
121 virtual void SAL_CALL
125 throw ( ::com::sun::star::uno::RuntimeException
129 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
> getProperties( const ::com::sun::star::uno::Reference
< ::com::sun::star::ucb::XCommandEnvironment
>& i_rEnv
);
130 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::ucb::CommandInfo
> getCommands( const ::com::sun::star::uno::Reference
< ::com::sun::star::ucb::XCommandEnvironment
>& i_rEnv
);
132 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>
134 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rValues
,
135 const ::com::sun::star::uno::Reference
< ::com::sun::star::ucb::XCommandEnvironment
>& xEnv
138 static bool denotesRootContent( const ::rtl::OUString
& i_rContentIdentifier
);
140 bool impl_isFolder();
141 void impl_determineContentType();
144 ExtensionContentType m_eExtContentType
;
145 ::boost::optional
< bool > m_aIsFolder
;
146 ::boost::optional
< ::rtl::OUString
> m_aContentType
;
147 ::rtl::OUString m_sExtensionId
;
148 ::rtl::OUString m_sPathIntoExtension
;
151 //......................................................................................................................
152 } } } // namespace ucb::ucp::ext
153 //......................................................................................................................
155 #endif // UCB_UCPEXT_CONTENT_HXX
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */