tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / ucb / source / ucp / ext / ucpext_content.hxx
blob99df646f73c47f0c8c05666008c6b0f15d2ee9b3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <com/sun/star/sdbc/XRow.hpp>
23 #include <com/sun/star/beans/PropertyValue.hpp>
25 #include <ucbhelper/contenthelper.hxx>
27 #include <optional>
30 namespace ucb::ucp::ext
34 //= ExtensionContentType
36 enum ExtensionContentType
38 E_ROOT,
39 E_EXTENSION_ROOT,
40 E_EXTENSION_CONTENT,
42 E_UNKNOWN
46 //= ContentProvider
48 typedef ::ucbhelper::ContentImplHelper Content_Base;
49 class Content : public Content_Base
51 public:
52 Content(
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 >
66 getPropertyValues(
67 const css::uno::Sequence< css::beans::Property >& rProperties,
68 const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv
71 static OUString
72 encodeIdentifier( const OUString& i_rIdentifier );
73 static OUString
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()
81 returns E_ROOT.
83 OUString getPhysicalURL() const;
85 protected:
86 virtual ~Content() override;
88 // XServiceInfo
89 virtual OUString SAL_CALL getImplementationName( ) override;
90 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
92 // XContent
93 virtual OUString SAL_CALL getContentType() override;
95 // XCommandProcessor
96 virtual css::uno::Any SAL_CALL
97 execute(
98 const css::ucb::Command& aCommand,
99 sal_Int32 CommandId,
100 const css::uno::Reference< css::ucb::XCommandEnvironment >& Environment
101 ) override;
103 virtual void SAL_CALL
104 abort(
105 sal_Int32 CommandId
106 ) override;
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;
112 css::uno::Sequence< css::uno::Any >
113 setPropertyValues(
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();
122 private:
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: */