diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-08-25 13:32:04 -0400 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2017-08-26 23:45:19 +0200 |
commit | 714282573cd6fe8c9d95d3072c15d1e6cb94dc73 (patch) | |
tree | 7d3fde000e10ea1cdaee1fe7fa2a50d11acadc79 /sw/inc | |
parent | 60c5955cb9f75a066cde0be3a3e39de83845279b (diff) |
sw: new RDF helpers
These are to help with adding paragraph
signature metadata.
Change-Id: Icac32c9e7937696f755ff3c99d619e97d56fc2e8
Reviewed-on: https://gerrit.libreoffice.org/41590
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/rdfhelper.hxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sw/inc/rdfhelper.hxx b/sw/inc/rdfhelper.hxx index c47ba0b5c9a6..dccd152d026f 100644 --- a/sw/inc/rdfhelper.hxx +++ b/sw/inc/rdfhelper.hxx @@ -16,20 +16,58 @@ #include <swdllapi.h> +#include <com/sun/star/uno/Reference.hxx> + class SwTextNode; +namespace com { namespace sun { namespace star { + namespace frame { + class XModel; + } + namespace rdf { + class XResource; + } +}}} + /// Provides access to RDF metadata on core objects. class SW_DLLPUBLIC SwRDFHelper { public: + + /// Gets all (XResource, key, value) statements in RDF graphs of type rType. + static std::map<OUString, OUString> getStatements(const css::uno::Reference<css::frame::XModel>& xModel, + const OUString& rType, + const css::uno::Reference<css::rdf::XResource>& xSubject); + + /// Add an (XResource, key, value) statement in the graph of type rType -- or if it does not exist, create a graph at rPath first. + static void addStatement(const css::uno::Reference<css::frame::XModel>& xModel, + const OUString& rType, const OUString& rPath, + const css::uno::Reference<css::rdf::XResource>& xSubject, + const OUString& rKey, const OUString& rValue); + + /// Remove an (XResource, key, value) statement in the graph of type rType, if it exists. + static void removeStatement(const css::uno::Reference<css::frame::XModel>& xModel, + const OUString& rType, + const css::uno::Reference<css::rdf::XResource>& xSubject, + const OUString& rKey, const OUString& rValue); + + /// Remove all statements in the graph of type rType, if any exists. + static void clearStatements(const css::uno::Reference<css::frame::XModel>& xModel, + const OUString& rType, + const css::uno::Reference<css::rdf::XResource>& xSubject); + /// Gets all (rTextNode, key, value) statements in RDF graphs of type rType. static std::map<OUString, OUString> getTextNodeStatements(const OUString& rType, SwTextNode& rTextNode); /// Add an (rTextNode, key, value) statement in the graph of type rType -- or if it does not exist, create a graph at rPath first. static void addTextNodeStatement(const OUString& rType, const OUString& rPath, SwTextNode& rTextNode, const OUString& rKey, const OUString& rValue); + /// Remove an (rTextNode, key, value) statement in the graph of type rType. + static void removeTextNodeStatement(const OUString& rType, SwTextNode& rTextNode, const OUString& rKey, const OUString& rValue); + /// Update an (rTextNode, key, value) statement in the graph of type rType from old value to new. Creates the graph at rPath if doesn't exist. static void updateTextNodeStatement(const OUString& rType, const OUString& rPath, SwTextNode& rTextNode, const OUString& rKey, const OUString& rOldValue, const OUString& rNewValue); + }; #endif // INCLUDED_SW_INC_RDFHELPER_HXX |