10#ifndef INCLUDED_SW_INC_RDFHELPER_HXX
11#define INCLUDED_SW_INC_RDFHELPER_HXX
15#include <rtl/ustring.hxx>
19#include <com/sun/star/uno/Reference.h>
20#include <com/sun/star/uno/Sequence.h>
29 class XDocumentMetadataAccess;
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);
45 static css::uno::Sequence<css::uno::Reference<css::rdf::XURI>>
46 getGraphNames(
const css::uno::Reference<css::frame::XModel>& xModel,
const OUString& rType);
49 static std::map<OUString, OUString>
51 const css::uno::Sequence<css::uno::Reference<css::rdf::XURI>>& rGraphNames,
52 const css::uno::Reference<css::rdf::XResource>& xSubject);
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);
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);
66 static bool hasMetadataGraph(
const css::uno::Reference<css::frame::XModel>& xModel,
67 const OUString& rType);
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);
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);
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);
88 static std::map<OUString, OUString> getTextNodeStatements(
const OUString& rType,
SwTextNode& rTextNode);
91 static void addTextNodeStatement(
const OUString& rType,
const OUString& rPath,
SwTextNode& rTextNode,
const OUString& rKey,
const OUString& rValue);
94 static void removeTextNodeStatement(
const OUString& rType,
SwTextNode& rTextNode,
const OUString& rKey,
const OUString& rValue);
97 static void updateTextNodeStatement(
const OUString& rType,
const OUString& rPath,
SwTextNode& rTextNode,
const OUString& rKey,
const OUString& rOldValue,
const OUString& rNewValue);
Provides access to RDF metadata on core objects.
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.