1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_UCB_SOURCE_UCP_EXT_UCPEXT_CONTENT_HXX
21 #define INCLUDED_UCB_SOURCE_UCP_EXT_UCPEXT_CONTENT_HXX
23 #include <com/sun/star/sdbc/XRow.hpp>
24 #include <com/sun/star/beans/PropertyValue.hpp>
26 #include <rtl/ref.hxx>
27 #include <ucbhelper/contenthelper.hxx>
30 #include <boost/optional.hpp>
33 namespace ucb
{ namespace ucp
{ namespace ext
38 //= ExtensionContentType
40 enum ExtensionContentType
52 typedef ::ucbhelper::ContentImplHelper Content_Base
;
53 class Content
: public Content_Base
57 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& rxContext
,
58 ::ucbhelper::ContentProviderImplHelper
* pProvider
,
59 const ::com::sun::star::uno::Reference
< ::com::sun::star::ucb::XContentIdentifier
>& Identifier
62 static ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRow
>
63 getArtificialNodePropertyValues(
64 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& rxContext
,
65 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& rProperties
,
66 const OUString
& rTitle
69 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRow
>
71 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& rProperties
,
72 const ::com::sun::star::uno::Reference
< ::com::sun::star::ucb::XCommandEnvironment
>& xEnv
76 encodeIdentifier( const OUString
& i_rIdentifier
);
78 decodeIdentifier( const OUString
& i_rIdentifier
);
80 virtual OUString
getParentURL() SAL_OVERRIDE
;
82 ExtensionContentType
getExtensionContentType() const { return m_eExtContentType
; }
84 /** retrieves the URL of the underlying physical content. Not to be called when getExtensionContentType()
87 OUString
getPhysicalURL() const;
93 virtual OUString SAL_CALL
getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
94 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 virtual OUString SAL_CALL
getContentType() throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual com::sun::star::uno::Any SAL_CALL
102 const com::sun::star::ucb::Command
& aCommand
,
104 const com::sun::star::uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& Environment
106 throw ( ::com::sun::star::uno::Exception
107 , ::com::sun::star::ucb::CommandAbortedException
108 , ::com::sun::star::uno::RuntimeException
, std::exception
111 virtual void SAL_CALL
115 throw ( ::com::sun::star::uno::RuntimeException
, std::exception
119 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
) SAL_OVERRIDE
;
120 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
) SAL_OVERRIDE
;
122 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>
124 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rValues
,
125 const ::com::sun::star::uno::Reference
< ::com::sun::star::ucb::XCommandEnvironment
>& xEnv
128 static bool denotesRootContent( const OUString
& i_rContentIdentifier
);
130 bool impl_isFolder();
131 void impl_determineContentType();
134 ExtensionContentType m_eExtContentType
;
135 ::boost::optional
< bool > m_aIsFolder
;
136 ::boost::optional
< OUString
> m_aContentType
;
137 OUString m_sExtensionId
;
138 OUString m_sPathIntoExtension
;
142 } } } // namespace ucb::ucp::ext
145 #endif // INCLUDED_UCB_SOURCE_UCP_EXT_UCPEXT_CONTENT_HXX
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */