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 <ucbhelper/contenthelper.hxx>
28 #include <boost/optional.hpp>
31 namespace ucb
{ namespace ucp
{ namespace ext
35 //= ExtensionContentType
37 enum ExtensionContentType
49 typedef ::ucbhelper::ContentImplHelper Content_Base
;
50 class Content
: public Content_Base
54 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
55 ::ucbhelper::ContentProviderImplHelper
* pProvider
,
56 const css::uno::Reference
< css::ucb::XContentIdentifier
>& Identifier
59 static css::uno::Reference
< css::sdbc::XRow
>
60 getArtificialNodePropertyValues(
61 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
62 const css::uno::Sequence
< css::beans::Property
>& rProperties
,
63 const OUString
& rTitle
66 css::uno::Reference
< css::sdbc::XRow
>
68 const css::uno::Sequence
< css::beans::Property
>& rProperties
,
69 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
73 encodeIdentifier( const OUString
& i_rIdentifier
);
75 decodeIdentifier( const OUString
& i_rIdentifier
);
77 virtual OUString
getParentURL() override
;
79 ExtensionContentType
getExtensionContentType() const { return m_eExtContentType
; }
81 /** retrieves the URL of the underlying physical content. Not to be called when getExtensionContentType()
84 OUString
getPhysicalURL() const;
87 virtual ~Content() override
;
90 virtual OUString SAL_CALL
getImplementationName( ) override
;
91 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
94 virtual OUString SAL_CALL
getContentType() override
;
97 virtual css::uno::Any SAL_CALL
99 const css::ucb::Command
& aCommand
,
101 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& Environment
104 virtual void SAL_CALL
110 virtual css::uno::Sequence
< css::beans::Property
> getProperties( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& i_rEnv
) override
;
111 virtual css::uno::Sequence
< css::ucb::CommandInfo
> getCommands( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& i_rEnv
) override
;
113 css::uno::Sequence
< css::uno::Any
>
115 const css::uno::Sequence
< css::beans::PropertyValue
>& rValues
118 static bool denotesRootContent( const OUString
& i_rContentIdentifier
);
120 bool impl_isFolder();
121 void impl_determineContentType();
124 ExtensionContentType m_eExtContentType
;
125 ::boost::optional
< bool > m_aIsFolder
;
126 ::boost::optional
< OUString
> m_aContentType
;
127 OUString m_sExtensionId
;
128 OUString m_sPathIntoExtension
;
132 } } } // namespace ucb::ucp::ext
135 #endif // INCLUDED_UCB_SOURCE_UCP_EXT_UCPEXT_CONTENT_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */