summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
authorSumit Chauhan <sumitcn25@gmail.com>2019-07-15 22:19:00 +0530
committerSzymon Kłos <szymon.klos@collabora.com>2019-07-19 11:51:36 +0200
commitfbcd5f074ca3dc105f4fe45b6975c6de2bf60f35 (patch)
treec37b2ef5d2534de3bb32581381a3941cc3be3bed /include/vcl
parent147e820cc1bd7110331a6ea73db678a4a6c324e0 (diff)
Engine to add Extension inside extension tab in NotebookBar
The patch provides backend for adding the extension.Schema for the adding extension in notebookbar can be seen here https://gerrit.libreoffice.org/#/c/75134/ Change-Id: I10f0e83d1aaec5330c80b3b53cf59a21b93be015 Reviewed-on: https://gerrit.libreoffice.org/75650 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/NotebookBarAddonsMerger.hxx72
-rw-r--r--include/vcl/builder.hxx17
-rw-r--r--include/vcl/notebookbar.hxx5
-rw-r--r--include/vcl/syswin.hxx2
4 files changed, 86 insertions, 10 deletions
diff --git a/include/vcl/NotebookBarAddonsMerger.hxx b/include/vcl/NotebookBarAddonsMerger.hxx
new file mode 100644
index 000000000000..c3b9998c7750
--- /dev/null
+++ b/include/vcl/NotebookBarAddonsMerger.hxx
@@ -0,0 +1,72 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_VCL_NOTEBOOKBARADDONSMERGER_HXX
+#define INCLUDED_VCL_NOTEBOOKBARADDONSMERGER_HXX
+
+#include <vcl/dllapi.h>
+#include <vcl/window.hxx>
+#include <vcl/vclptr.hxx>
+#include <vcl/image.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/uno/Sequence.h>
+#include <memory>
+#include <vector>
+
+struct NotebookBarAddonsItem
+{
+ Image aImage;
+ std::vector<Image> aImageValues;
+ std::vector<css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>>> aAddonValues;
+};
+
+struct AddonsParams
+{
+ OUString sImageId;
+ OUString sControlType;
+ sal_uInt16 nWidth;
+};
+
+struct AddonNotebookBarItem
+{
+ OUString sCommandURL;
+ OUString sLabel;
+ OUString sImageIdentifier;
+ OUString sTarget;
+ OUString sContext;
+ OUString sControlType;
+ sal_uInt16 nWidth;
+ OUString sStyle;
+};
+
+class NotebookBarAddonsMerger
+{
+public:
+ NotebookBarAddonsMerger(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rFrame,
+ const NotebookBarAddonsItem& aNotebookBarAddonsItem);
+ static void MergeNotebookBarAddons(vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rFrame,
+ const NotebookBarAddonsItem& aNotebookBarAddonsItem);
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 2fa8f445199f..adefc6d39713 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -15,6 +15,7 @@
#include <unotools/resmgr.hxx>
#include <tools/fldunit.hxx>
#include <vcl/dllapi.h>
+#include <vcl/NotebookBarAddonsMerger.hxx>
#include <vcl/window.hxx>
#include <vcl/vclptr.hxx>
#include <tools/wintypes.hxx>
@@ -67,18 +68,16 @@ public:
typedef void (*customMakeWidget)(VclPtr<vcl::Window> &rRet, VclPtr<vcl::Window> &pParent, stringmap &rVec);
public:
- VclBuilder(
- vcl::Window *pParent,
- const OUString& sUIRootDir,
- const OUString& sUIFile,
- const OString& sID = OString(),
- const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>(),
- bool bLegacy = true);
+ VclBuilder(vcl::Window* pParent, const OUString& sUIRootDir, const OUString& sUIFile,
+ const OString& sID = OString(),
+ const css::uno::Reference<css::frame::XFrame>& rFrame
+ = css::uno::Reference<css::frame::XFrame>(),
+ bool bLegacy = true,
+ const NotebookBarAddonsItem& aNotebookBarAddonsItem = NotebookBarAddonsItem());
~VclBuilder();
-
///releases references and disposes all children.
void disposeBuilder();
-
+ NotebookBarAddonsItem m_pNotebookBarAddonsItem;
//sID must exist and be of type T
template <typename T> T* get(VclPtr<T>& ret, const OString& sID);
diff --git a/include/vcl/notebookbar.hxx b/include/vcl/notebookbar.hxx
index e7ed5c79dc44..4d69ced959b4 100644
--- a/include/vcl/notebookbar.hxx
+++ b/include/vcl/notebookbar.hxx
@@ -12,6 +12,7 @@
#include <vcl/builder.hxx>
#include <vcl/ctrl.hxx>
+#include <vcl/NotebookBarAddonsMerger.hxx>
#include <vcl/settings.hxx>
#include <vector>
@@ -25,7 +26,9 @@ class VCL_DLLPUBLIC NotebookBar : public Control, public VclBuilderContainer
{
friend class NotebookBarContextChangeEventListener;
public:
- NotebookBar(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame);
+ NotebookBar(Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
+ const css::uno::Reference<css::frame::XFrame>& rFrame,
+ const NotebookBarAddonsItem& aNotebookBarAddonsItem);
virtual ~NotebookBar() override;
virtual void dispose() override;
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 22dd359e927b..402aebeb381e 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -27,6 +27,7 @@
#include <vcl/window.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <memory>
+#include <vcl/NotebookBarAddonsMerger.hxx>
class MenuBar;
class NotebookBar;
@@ -217,6 +218,7 @@ public:
void SetNotebookBar(const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame>& rFrame,
+ const NotebookBarAddonsItem& aNotebookBarAddonsItem,
bool bReloadNotebookbar = false);
void CloseNotebookBar();