summaryrefslogtreecommitdiff
path: root/include/docmodel/uno/UnoTheme.hxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-01-27 12:13:29 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-01-28 12:52:52 +0000
commit312f83bcf52d2f681eb9fa1bbdbb98bfd063a3b4 (patch)
treeb488bdd6024b0ba6f8f2641781b4fcad69d5edb8 /include/docmodel/uno/UnoTheme.hxx
parent10c340c2b59dd677d6f598901506b08ff2cbd49c (diff)
introduce XTheme and UnoTheme implementation
Needed to transprt model::Theme around using throught UNO API as xmloff can't access SdrPage directly. Change-Id: I5931e42352186d62e7f09b112d8e8c9e4fb79440 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146224 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/docmodel/uno/UnoTheme.hxx')
-rw-r--r--include/docmodel/uno/UnoTheme.hxx46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/docmodel/uno/UnoTheme.hxx b/include/docmodel/uno/UnoTheme.hxx
new file mode 100644
index 000000000000..f1abc4ccaede
--- /dev/null
+++ b/include/docmodel/uno/UnoTheme.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <cppuhelper/implbase.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/servicehelper.hxx>
+
+#include <com/sun/star/util/Color.hpp>
+#include <com/sun/star/util/XTheme.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <utility>
+#include <docmodel/dllapi.h>
+#include <docmodel/theme/Theme.hxx>
+
+class DOCMODEL_DLLPUBLIC UnoTheme final : public cppu::WeakImplHelper<css::util::XTheme>
+{
+private:
+ model::Theme maTheme;
+
+public:
+ UnoTheme(model::Theme const& rTheme)
+ : maTheme(rTheme)
+ {
+ }
+
+ model::Theme const& getTheme() const { return maTheme; }
+
+ // XTheme
+ OUString SAL_CALL getName() override;
+ css::uno::Sequence<sal_Int32> SAL_CALL getColorSet() override;
+};
+
+namespace model::theme
+{
+DOCMODEL_DLLPUBLIC css::uno::Reference<css::util::XTheme> createXTheme(model::Theme const& rTheme);
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */