LibreOffice Module sw (master) 1
rdfhelper.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
10#ifndef INCLUDED_SW_INC_RDFHELPER_HXX
11#define INCLUDED_SW_INC_RDFHELPER_HXX
12
13#include <map>
14
15#include <rtl/ustring.hxx>
16
17#include "swdllapi.h"
18
19#include <com/sun/star/uno/Reference.h>
20#include <com/sun/star/uno/Sequence.h>
21
22class SwTextNode;
23
24namespace com::sun::star {
25 namespace frame {
26 class XModel;
27 }
28 namespace rdf {
29 class XDocumentMetadataAccess;
30 class XResource;
31 class XURI;
32 }
33}
34
37{
38public:
40 static css::uno::Sequence<css::uno::Reference<css::rdf::XURI>>
41 getGraphNames(const css::uno::Reference<css::rdf::XDocumentMetadataAccess>& xDocumentMetadataAccess,
42 const css::uno::Reference<css::rdf::XURI>& xType);
43
45 static css::uno::Sequence<css::uno::Reference<css::rdf::XURI>>
46 getGraphNames(const css::uno::Reference<css::frame::XModel>& xModel, const OUString& rType);
47
49 static std::map<OUString, OUString>
50 getStatements(const css::uno::Reference<css::frame::XModel>& xModel,
51 const css::uno::Sequence<css::uno::Reference<css::rdf::XURI>>& rGraphNames,
52 const css::uno::Reference<css::rdf::XResource>& xSubject);
53
55 static std::map<OUString, OUString>
56 getStatements(const css::uno::Reference<css::frame::XModel>& xModel, const OUString& rType,
57 const css::uno::Reference<css::rdf::XResource>& xSubject);
58
60 static void addStatement(const css::uno::Reference<css::frame::XModel>& xModel,
61 const OUString& rType, const OUString& rPath,
62 const css::uno::Reference<css::rdf::XResource>& xSubject,
63 const OUString& rKey, const OUString& rValue);
64
66 static bool hasMetadataGraph(const css::uno::Reference<css::frame::XModel>& xModel,
67 const OUString& rType);
68
70 static void removeStatement(const css::uno::Reference<css::frame::XModel>& xModel,
71 const OUString& rType,
72 const css::uno::Reference<css::rdf::XResource>& xSubject,
73 const OUString& rKey, const OUString& rValue);
74
76 static void cloneStatements(const css::uno::Reference<css::frame::XModel>& xSrcModel,
77 const css::uno::Reference<css::frame::XModel>& xDstModel,
78 const OUString& rType,
79 const css::uno::Reference<css::rdf::XResource>& xSrcSubject,
80 const css::uno::Reference<css::rdf::XResource>& xDstSubject);
81
83 static void clearStatements(const css::uno::Reference<css::frame::XModel>& xModel,
84 const OUString& rType,
85 const css::uno::Reference<css::rdf::XResource>& xSubject);
86
88 static std::map<OUString, OUString> getTextNodeStatements(const OUString& rType, SwTextNode& rTextNode);
89
91 static void addTextNodeStatement(const OUString& rType, const OUString& rPath, SwTextNode& rTextNode, const OUString& rKey, const OUString& rValue);
92
94 static void removeTextNodeStatement(const OUString& rType, SwTextNode& rTextNode, const OUString& rKey, const OUString& rValue);
95
97 static void updateTextNodeStatement(const OUString& rType, const OUString& rPath, SwTextNode& rTextNode, const OUString& rKey, const OUString& rOldValue, const OUString& rNewValue);
98
99};
100
101#endif // INCLUDED_SW_INC_RDFHELPER_HXX
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides access to RDF metadata on core objects.
Definition: rdfhelper.hxx:37
static std::map< OUString, OUString > getStatements(const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > &rGraphNames, const css::uno::Reference< css::rdf::XResource > &xSubject)
Gets all (XResource, key, value) statements in RDF graphs given the graph-names.
static css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > getGraphNames(const css::uno::Reference< css::rdf::XDocumentMetadataAccess > &xDocumentMetadataAccess, const css::uno::Reference< css::rdf::XURI > &xType)
Gets all graph-names in RDF of a given type.
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
#define SW_DLLPUBLIC
Definition: swdllapi.h:28