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 .
22 #include <com/sun/star/sdbc/XRow.hpp>
23 #include <com/sun/star/beans/PropertyValue.hpp>
25 #include <ucbhelper/contenthelper.hxx>
30 namespace ucb::ucp::ext
34 //= ExtensionContentType
36 enum ExtensionContentType
48 typedef ::ucbhelper::ContentImplHelper Content_Base
;
49 class Content
: public Content_Base
53 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
54 ::ucbhelper::ContentProviderImplHelper
* pProvider
,
55 const css::uno::Reference
< css::ucb::XContentIdentifier
>& Identifier
58 static css::uno::Reference
< css::sdbc::XRow
>
59 getArtificialNodePropertyValues(
60 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
61 const css::uno::Sequence
< css::beans::Property
>& rProperties
,
62 const OUString
& rTitle
65 css::uno::Reference
< css::sdbc::XRow
>
67 const css::uno::Sequence
< css::beans::Property
>& rProperties
,
68 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
72 encodeIdentifier( const OUString
& i_rIdentifier
);
74 decodeIdentifier( const OUString
& i_rIdentifier
);
76 virtual OUString
getParentURL() override
;
78 ExtensionContentType
getExtensionContentType() const { return m_eExtContentType
; }
80 /** retrieves the URL of the underlying physical content. Not to be called when getExtensionContentType()
83 OUString
getPhysicalURL() const;
86 virtual ~Content() override
;
89 virtual OUString SAL_CALL
getImplementationName( ) override
;
90 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
93 virtual OUString SAL_CALL
getContentType() override
;
96 virtual css::uno::Any SAL_CALL
98 const css::ucb::Command
& aCommand
,
100 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& Environment
103 virtual void SAL_CALL
109 virtual css::uno::Sequence
< css::beans::Property
> getProperties( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& i_rEnv
) override
;
110 virtual css::uno::Sequence
< css::ucb::CommandInfo
> getCommands( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& i_rEnv
) override
;
112 css::uno::Sequence
< css::uno::Any
>
114 const css::uno::Sequence
< css::beans::PropertyValue
>& rValues
117 static bool denotesRootContent( std::u16string_view i_rContentIdentifier
);
119 bool impl_isFolder();
120 void impl_determineContentType();
123 ExtensionContentType m_eExtContentType
;
124 ::std::optional
< bool > m_aIsFolder
;
125 ::std::optional
< OUString
> m_aContentType
;
126 OUString m_sExtensionId
;
127 OUString m_sPathIntoExtension
;
131 } // namespace ucb::ucp::ext
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */