LibreOffice Module ucb (master) 1
ucpext_content.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <com/sun/star/sdbc/XRow.hpp>
23#include <com/sun/star/beans/PropertyValue.hpp>
24
26
27#include <optional>
28
29
30namespace ucb::ucp::ext
31{
32
33
34 //= ExtensionContentType
35
37 {
41
43 };
44
45
46 //= ContentProvider
47
49 class Content : public Content_Base
50 {
51 public:
53 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
55 const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier
56 );
57
58 static css::uno::Reference< css::sdbc::XRow >
60 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
61 const css::uno::Sequence< css::beans::Property >& rProperties,
62 const OUString& rTitle
63 );
64
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
69 );
70
71 static OUString
72 encodeIdentifier( const OUString& i_rIdentifier );
73 static OUString
74 decodeIdentifier( const OUString& i_rIdentifier );
75
76 virtual OUString getParentURL() override;
77
79
83 OUString getPhysicalURL() const;
84
85 protected:
86 virtual ~Content() override;
87
88 // XServiceInfo
89 virtual OUString SAL_CALL getImplementationName( ) override;
90 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
91
92 // XContent
93 virtual OUString SAL_CALL getContentType() override;
94
95 // XCommandProcessor
96 virtual css::uno::Any SAL_CALL
98 const css::ucb::Command& aCommand,
99 sal_Int32 CommandId,
100 const css::uno::Reference< css::ucb::XCommandEnvironment >& Environment
101 ) override;
102
103 virtual void SAL_CALL
104 abort(
105 sal_Int32 CommandId
106 ) override;
107
108 private:
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;
111
112 css::uno::Sequence< css::uno::Any >
114 const css::uno::Sequence< css::beans::PropertyValue >& rValues
115 );
116
117 static bool denotesRootContent( std::u16string_view i_rContentIdentifier );
118
119 bool impl_isFolder();
121
122 private:
124 ::std::optional< bool > m_aIsFolder;
125 ::std::optional< OUString > m_aContentType;
128 };
129
130
131} // namespace ucb::ucp::ext
132
133
134/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Sequence< css::uno::Any > setPropertyValues(const css::uno::Sequence< css::beans::PropertyValue > &rValues)
ExtensionContentType m_eExtContentType
virtual OUString SAL_CALL getContentType() override
::std::optional< OUString > m_aContentType
virtual css::uno::Any SAL_CALL execute(const css::ucb::Command &aCommand, sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &Environment) override
css::uno::Reference< css::sdbc::XRow > getPropertyValues(const css::uno::Sequence< css::beans::Property > &rProperties, const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)
Content(const css::uno::Reference< css::uno::XComponentContext > &rxContext, ::ucbhelper::ContentProviderImplHelper *pProvider, const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier)
static OUString encodeIdentifier(const OUString &i_rIdentifier)
virtual css::uno::Sequence< css::ucb::CommandInfo > getCommands(const css::uno::Reference< css::ucb::XCommandEnvironment > &i_rEnv) override
static css::uno::Reference< css::sdbc::XRow > getArtificialNodePropertyValues(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Sequence< css::beans::Property > &rProperties, const OUString &rTitle)
ExtensionContentType getExtensionContentType() const
virtual OUString getParentURL() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static bool denotesRootContent(std::u16string_view i_rContentIdentifier)
virtual ~Content() override
::std::optional< bool > m_aIsFolder
static OUString decodeIdentifier(const OUString &i_rIdentifier)
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< css::beans::Property > getProperties(const css::uno::Reference< css::ucb::XCommandEnvironment > &i_rEnv) override
OUString getPhysicalURL() const
retrieves the URL of the underlying physical content.
virtual void SAL_CALL abort(sal_Int32 CommandId) override
::ucbhelper::ContentImplHelper Content_Base