LibreOffice Module sfx2 (master) 1
DocumentMetadataAccess.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#ifndef INCLUDED_SFX2_DOCUMENTMETADATAACCESS_HXX
21#define INCLUDED_SFX2_DOCUMENTMETADATAACCESS_HXX
22
23#include <sal/config.h>
24
25#include <sfx2/dllapi.h>
26
27#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
28
30
31#include <memory>
32
33
42namespace com::sun::star::embed {
43 class XStorage;
44}
45namespace com::sun::star::frame {
46 class XModel;
47}
48
49namespace com::sun::star::uno { class XComponentContext; }
50
51class SfxObjectShell;
52
53namespace sfx2 {
54
55
65css::uno::Reference< css::rdf::XURI> SFX2_DLLPUBLIC
67 css::uno::Reference<css::uno::XComponentContext> const & i_xContext,
68 css::uno::Reference<css::frame::XModel> const & i_xModel,
69 OUString const & i_rPkgURI,
70 std::u16string_view i_rSubDocument = std::u16string_view());
71
72
74
76 public cppu::WeakImplHelper<css::rdf::XDocumentMetadataAccess>
77{
80public:
81 explicit DocumentMetadataAccess(css::uno::Reference< css::uno::XComponentContext > const & i_xContext,
82 SfxObjectShell const & i_rRegistrySupplier,
83 OUString const & i_rBaseURI);
84 // N.B.: in contrast to previous, this constructor does _not_ initialize!
85 // caller must immediately call loadFromStorage/Medium!
86 explicit DocumentMetadataAccess(css::uno::Reference< css::uno::XComponentContext > const & i_xContext,
87 SfxObjectShell const & i_rRegistrySupplier);
88 virtual ~DocumentMetadataAccess() override;
89
90 // css::rdf::XNode:
91 virtual OUString SAL_CALL getStringValue() override;
92
93 // css::rdf::XURI:
94 virtual OUString SAL_CALL getNamespace() override;
95 virtual OUString SAL_CALL getLocalName() override;
96
97 // css::rdf::XRepositorySupplier:
98 virtual css::uno::Reference<
99 css::rdf::XRepository > SAL_CALL getRDFRepository() override;
100
101 // css::rdf::XDocumentMetadataAccess:
102 virtual css::uno::Reference<
103 css::rdf::XMetadatable > SAL_CALL
105 const css::beans::StringPair & i_rReference) override;
106 virtual css::uno::Reference< css::rdf::XMetadatable > SAL_CALL
107 getElementByURI(const css::uno::Reference< css::rdf::XURI > & i_xURI) override;
108 virtual css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(
109 const css::uno::Reference< css::rdf::XURI > & i_xType) override;
110 virtual css::uno::Reference< css::rdf::XURI> SAL_CALL
111 addMetadataFile(const OUString & i_rFileName,
112 const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > & i_rTypes) override;
113 virtual css::uno::Reference< css::rdf::XURI> SAL_CALL
114 importMetadataFile(::sal_Int16 i_Format,
115 const css::uno::Reference< css::io::XInputStream > & i_xInStream,
116 const OUString & i_rFileName,
117 const css::uno::Reference< css::rdf::XURI > & i_xBaseURI,
118 const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > & i_rTypes) override;
119 virtual void SAL_CALL removeMetadataFile(
120 const css::uno::Reference<
121 css::rdf::XURI > & i_xGraphName) override;
122 virtual void SAL_CALL addContentOrStylesFile(
123 const OUString & i_rFileName) override;
124 virtual void SAL_CALL removeContentOrStylesFile(
125 const OUString & i_rFileName) override;
126
127 virtual void SAL_CALL loadMetadataFromStorage(
128 const css::uno::Reference<
129 css::embed::XStorage > & i_xStorage,
130 const css::uno::Reference<
131 css::rdf::XURI > & i_xBaseURI,
132 const css::uno::Reference<
133 css::task::XInteractionHandler> & i_xHandler) override;
134 virtual void SAL_CALL storeMetadataToStorage(
135 const css::uno::Reference<
136 css::embed::XStorage > & i_xStorage) override;
137 virtual void SAL_CALL loadMetadataFromMedium(
138 const css::uno::Sequence<
139 css::beans::PropertyValue > & i_rMedium) override;
140 virtual void SAL_CALL storeMetadataToMedium(
141 const css::uno::Sequence<
142 css::beans::PropertyValue > & i_rMedium) override;
143
144private:
145 std::unique_ptr<DocumentMetadataAccess_Impl> m_pImpl;
146};
147
148} // namespace sfx2
149
150#endif // INCLUDED_SFX2_DOCUMENTMETADATAACCESS_HXX
151
152/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL removeContentOrStylesFile(const OUString &i_rFileName) override
virtual OUString SAL_CALL getLocalName() override
virtual void SAL_CALL loadMetadataFromMedium(const css::uno::Sequence< css::beans::PropertyValue > &i_rMedium) override
virtual OUString SAL_CALL getNamespace() override
std::unique_ptr< DocumentMetadataAccess_Impl > m_pImpl
virtual css::uno::Reference< css::rdf::XURI > SAL_CALL importMetadataFile(::sal_Int16 i_Format, const css::uno::Reference< css::io::XInputStream > &i_xInStream, const OUString &i_rFileName, const css::uno::Reference< css::rdf::XURI > &i_xBaseURI, const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > &i_rTypes) override
virtual css::uno::Reference< css::rdf::XURI > SAL_CALL addMetadataFile(const OUString &i_rFileName, const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > &i_rTypes) override
virtual void SAL_CALL storeMetadataToStorage(const css::uno::Reference< css::embed::XStorage > &i_xStorage) override
virtual void SAL_CALL storeMetadataToMedium(const css::uno::Sequence< css::beans::PropertyValue > &i_rMedium) override
virtual void SAL_CALL loadMetadataFromStorage(const css::uno::Reference< css::embed::XStorage > &i_xStorage, const css::uno::Reference< css::rdf::XURI > &i_xBaseURI, const css::uno::Reference< css::task::XInteractionHandler > &i_xHandler) override
DocumentMetadataAccess & operator=(const DocumentMetadataAccess &)=delete
virtual void SAL_CALL removeMetadataFile(const css::uno::Reference< css::rdf::XURI > &i_xGraphName) override
DocumentMetadataAccess(css::uno::Reference< css::uno::XComponentContext > const &i_xContext, SfxObjectShell const &i_rRegistrySupplier, OUString const &i_rBaseURI)
virtual css::uno::Reference< css::rdf::XRepository > SAL_CALL getRDFRepository() override
DocumentMetadataAccess(const DocumentMetadataAccess &)=delete
virtual css::uno::Reference< css::rdf::XMetadatable > SAL_CALL getElementByURI(const css::uno::Reference< css::rdf::XURI > &i_xURI) override
virtual void SAL_CALL addContentOrStylesFile(const OUString &i_rFileName) override
virtual css::uno::Reference< css::rdf::XMetadatable > SAL_CALL getElementByMetadataReference(const css::beans::StringPair &i_rReference) override
virtual OUString SAL_CALL getStringValue() override
DocumentMetadataAccess(css::uno::Reference< css::uno::XComponentContext > const &i_xContext, SfxObjectShell const &i_rRegistrySupplier)
virtual css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > SAL_CALL getMetadataGraphsWithType(const css::uno::Reference< css::rdf::XURI > &i_xType) override
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
Implementation of the interface com.sun.star.rdf.XDocumentMetadataAccess.
uno::Reference< rdf::XURI > createBaseURI(uno::Reference< uno::XComponentContext > const &i_xContext, uno::Reference< frame::XModel > const &i_xModel, OUString const &i_rPkgURI, std::u16string_view i_rSubDocument)