20 #ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERCONFIGURATIONACCESS_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERCONFIGURATIONACCESS_HXX
23 #include <rtl/ustring.hxx>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/container/XNameAccess.hpp>
26 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
52 typedef ::std::function<bool (
54 const css::uno::Reference<css::beans::XPropertySet>&)>
Predicate;
56 u"/org.openoffice.Office.PresenterScreen/";
68 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
69 const OUString& rsRootName,
79 const OUString& rsPathToNode);
90 bool GoToChild (
const OUString& rsPathToNode);
94 bool GoToChild (
const Predicate& rPredicate);
100 bool SetProperty (
const OUString& rsPropertyName,
const css::uno::Any& rValue);
113 const css::uno::Reference<css::container::XHierarchicalNameAccess>& rxNode,
114 const OUString& rsPathToNode);
117 const css::uno::Reference<css::container::XHierarchicalNameAccess>& rxNode,
118 const OUString& rsPathToNode);
126 typedef ::std::function<
void (
128 typedef ::std::function<
void (
145 const css::uno::Reference<css::container::XNameAccess>& rxContainer,
146 const ::std::vector<OUString>& rArguments,
147 const ItemProcessor& rProcessor);
149 const css::uno::Reference<css::container::XNameAccess>& rxContainer,
150 const PropertySetProcessor& rProcessor);
152 static css::uno::Any
Find (
153 const css::uno::Reference<css::container::XNameAccess>& rxContainer,
154 const Predicate& rPredicate);
157 std::u16string_view rsValue,
158 const OUString& rsPropertyName,
159 const css::uno::Reference<css::beans::XPropertySet>& rxNode);
166 const css::uno::Reference<css::beans::XPropertySet>& rxProperties,
167 const OUString& rsKey);
170 css::uno::Reference<css::uno::XInterface>
mxRoot;
static void ForAll(const css::uno::Reference< css::container::XNameAccess > &rxContainer, const ::std::vector< OUString > &rArguments, const ItemProcessor &rProcessor)
Execute a functor for all elements of the given container.
static css::uno::Any GetProperty(const css::uno::Reference< css::beans::XPropertySet > &rxProperties, const OUString &rsKey)
This method wraps a call to getPropertyValue() and returns an empty Any instead of throwing an except...
css::uno::Reference< css::uno::XInterface > mxRoot
static constexpr OUStringLiteral msPresenterScreenRootName
~PresenterConfigurationAccess()
void CommitChanges()
Write any changes that have been made back to the configuration.
::std::function< bool(const OUString &, const css::uno::Reference< css::beans::XPropertySet > &)> Predicate
static css::uno::Reference< css::beans::XPropertySet > GetNodeProperties(const css::uno::Reference< css::container::XHierarchicalNameAccess > &rxNode, const OUString &rsPathToNode)
::std::function< void(const OUString &, const css::uno::Reference< css::beans::XPropertySet > &) > PropertySetProcessor
This class gives access to the configuration.
bool SetProperty(const OUString &rsPropertyName, const css::uno::Any &rValue)
Modify the property child of the currently focused node.
bool IsValid() const
Return when opening the configuration (via creating a new PresenterConfigurationAccess object)...
static css::uno::Any Find(const css::uno::Reference< css::container::XNameAccess > &rxContainer, const Predicate &rPredicate)
css::uno::Any GetConfigurationNode(const OUString &rsPathToNode)
Return a configuration node below the root of the called object.
static bool IsStringPropertyEqual(std::u16string_view rsValue, const OUString &rsPropertyName, const css::uno::Reference< css::beans::XPropertySet > &rxNode)
PresenterConfigurationAccess(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const OUString &rsRootName, WriteMode eMode)
Create a new object to access the configuration entries below the given root.
::std::function< void(const ::std::vector< css::uno::Any > &) > ItemProcessor
bool GoToChild(const OUString &rsPathToNode)
Move the focused node to the (possibly indirect) child specified by the given path.