LibreOffice Module sd (master) 1
TableDesignPane.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <svtools/valueset.hxx>
25#include <vcl/weld.hxx>
26
27namespace com::sun::star::beans { class XPropertySet; }
28namespace com::sun::star::container { class XIndexAccess; class XNameContainer; }
29namespace com::sun::star::drawing { class XDrawView; }
30
31namespace sd
32{
33
34namespace tools {
35class EventMultiplexerEvent;
36}
37
38class ViewShellBase;
39
40enum TableCheckBox : sal_uInt16
41{
49};
50
51class TableValueSet final : public ValueSet
52{
53private:
56public:
57 TableValueSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow);
58 virtual bool Command(const CommandEvent& rEvent) override;
59 virtual void Resize() override;
60 virtual void StyleUpdated() override;
61 void updateSettings();
62 void setModal(bool bModal) { m_bModal = bModal; }
64 static constexpr int getMaxRowCount() { return 3; }
65};
66
68{
69public:
72
73 // callbacks
74 void onSelectionChanged();
75
76 void ApplyOptions();
77 void ApplyStyle();
78 void InsertStyle();
79 void CloneStyle();
80 void ResetStyle();
81 void DeleteStyle();
82 void EditStyle(const OUString& rCommand);
83
84private:
85 void addListener();
86 void removeListener();
87 void updateControls();
88 void selectStyle(std::u16string_view rStyle);
89 void endTextEditForStyle(const css::uno::Reference<css::uno::XInterface>& rStyle);
91
93
94 DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent&, void);
95 DECL_LINK(implContextMenuHandler, const Point*, void);
96 DECL_LINK(implValueSetHdl, ValueSet*, void);
97 DECL_LINK(implCheckBoxHdl, weld::Toggleable&, void);
98
100
101 std::unique_ptr<weld::Menu> m_xMenu;
102 std::unique_ptr<TableValueSet> m_xValueSet;
103 std::unique_ptr<weld::CustomWeld> m_xValueSetWin;
104 std::unique_ptr<weld::CheckButton> m_aCheckBoxes[CB_COUNT];
105
106 css::uno::Reference< css::beans::XPropertySet > mxSelectedTable;
107 css::uno::Reference< css::drawing::XDrawView > mxView;
108 css::uno::Reference< css::container::XIndexAccess > mxTableFamily;
109 css::uno::Reference< css::container::XNameContainer > mxCellFamily;
110};
111
112class TableDesignPane final : public PanelLayout
113 , public sfx2::sidebar::ILayoutableWindow
114{
115private:
116 std::unique_ptr<TableDesignWidget> m_xImpl;
117public:
119 : PanelLayout(pParent, "TableDesignPanel",
120 "modules/simpress/ui/tabledesignpanel.ui")
121 , m_xImpl(new TableDesignWidget(*m_xBuilder, rBase))
122 {
123 }
124 virtual css::ui::LayoutSize GetHeightForWidth(const sal_Int32 /*nWidth*/) override
125 {
126 sal_Int32 nMinimumHeight = get_preferred_size().Height();
127 return css::ui::LayoutSize(nMinimumHeight, -1, nMinimumHeight);
128 }
129};
130
131}
132
133/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Builder > m_xBuilder
Size get_preferred_size() const
constexpr tools::Long Height() const
virtual css::ui::LayoutSize GetHeightForWidth(const sal_Int32) override
TableDesignPane(weld::Widget *pParent, ViewShellBase &rBase)
std::unique_ptr< TableDesignWidget > m_xImpl
ViewShellBase & mrBase
css::uno::Reference< css::drawing::XDrawView > mxView
css::uno::Reference< css::container::XIndexAccess > mxTableFamily
void endTextEditForStyle(const css::uno::Reference< css::uno::XInterface > &rStyle)
css::uno::Reference< css::container::XNameContainer > mxCellFamily
std::unique_ptr< weld::Menu > m_xMenu
std::unique_ptr< TableValueSet > m_xValueSet
css::uno::Reference< css::beans::XPropertySet > mxSelectedTable
void selectStyle(std::u16string_view rStyle)
void EditStyle(const OUString &rCommand)
DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent &, void)
std::unique_ptr< weld::CheckButton > m_aCheckBoxes[CB_COUNT]
TableDesignWidget(weld::Builder &rBuilder, ViewShellBase &rBase)
DECL_LINK(implValueSetHdl, ValueSet *, void)
DECL_LINK(implContextMenuHandler, const Point *, void)
DECL_LINK(implCheckBoxHdl, weld::Toggleable &, void)
std::unique_ptr< weld::CustomWeld > m_xValueSetWin
virtual void StyleUpdated() override
Link< const Point *, void > maContextMenuHandler
virtual void Resize() override
void SetContextMenuHandler(const Link< const Point *, void > &rLink)
TableValueSet(std::unique_ptr< weld::ScrolledWindow > pScrolledWindow)
void setModal(bool bModal)
virtual bool Command(const CommandEvent &rEvent) override
static constexpr int getMaxRowCount()
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
class SAL_NO_VTABLE XPropertySet
@ CB_FIRST_COLUMN
@ CB_TOTAL_ROW
@ CB_HEADER_ROW
@ CB_LAST_COLUMN
@ CB_BANDED_ROWS
@ CB_BANDED_COLUMNS