bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / table / TableDesignPane.hxx
blobecf324078546938b4e43a2ff1898ad32f8825097
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SD_SOURCE_UI_TABLE_TABLEDESIGNPANE_HXX
21 #define INCLUDED_SD_SOURCE_UI_TABLE_TABLEDESIGNPANE_HXX
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/ui/XUIElement.hpp>
25 #include <com/sun/star/ui/LayoutSize.hpp>
26 #include <com/sun/star/drawing/XDrawView.hpp>
27 #include <com/sun/star/container/XIndexAccess.hpp>
29 #include <svtools/valueset.hxx>
30 #include <vcl/dialog.hxx>
31 #include <vcl/fixed.hxx>
32 #include <vcl/button.hxx>
33 #include <svx/sidebar/PanelLayout.hxx>
35 #include <boost/scoped_ptr.hpp>
37 namespace sd
40 namespace tools {
41 class EventMultiplexerEvent;
44 class ViewShellBase;
46 #define CB_HEADER_ROW 0
47 #define CB_TOTAL_ROW 1
48 #define CB_BANDED_ROWS 2
49 #define CB_FIRST_COLUMN 3
50 #define CB_LAST_COLUMN 4
51 #define CB_BANDED_COLUMNS 5
52 #define CB_COUNT CB_BANDED_COLUMNS-CB_HEADER_ROW+1
54 class TableValueSet : public ValueSet
56 private:
57 bool m_bModal;
58 public:
59 TableValueSet(vcl::Window *pParent, WinBits nStyle);
60 virtual void Resize() SAL_OVERRIDE;
61 virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
62 void updateSettings();
63 void setModal(bool bModal) { m_bModal = bModal; }
66 class TableDesignWidget
68 public:
69 TableDesignWidget( VclBuilderContainer* pParent, ViewShellBase& rBase, bool bModal );
70 virtual ~TableDesignWidget();
72 // callbacks
73 void onSelectionChanged();
75 void ApplyOptions();
76 void ApplyStyle();
78 bool isStyleChanged() const { return mbStyleSelected; }
79 bool isOptionsChanged() const { return mbOptionsChanged; }
81 private:
82 void addListener();
83 void removeListener();
84 void updateControls();
86 void FillDesignPreviewControl();
88 DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
89 DECL_LINK(implValueSetHdl, void *);
90 DECL_LINK(implCheckBoxHdl, void *);
92 private:
93 ViewShellBase& mrBase;
95 VclPtr<TableValueSet> m_pValueSet;
96 VclPtr<CheckBox> m_aCheckBoxes[CB_COUNT];
98 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSelectedTable;
99 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
100 ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxTableFamily;
101 ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > mxToolbar;
103 bool mbModal;
104 bool mbStyleSelected;
105 bool mbOptionsChanged;
108 class TableDesignPane : public PanelLayout
110 private:
111 TableDesignWidget aImpl;
112 public:
113 TableDesignPane( vcl::Window* pParent, ViewShellBase& rBase )
114 : PanelLayout(pParent, "TableDesignPanel",
115 "modules/simpress/ui/tabledesignpanel.ui", com::sun::star::uno::Reference<css::frame::XFrame>())
116 , aImpl(this, rBase, false)
121 class TableDesignDialog : public ModalDialog
123 private:
124 TableDesignWidget aImpl;
125 public:
126 TableDesignDialog( vcl::Window* pParent, ViewShellBase& rBase )
127 : ModalDialog(pParent, "TableDesignDialog",
128 "modules/sdraw/ui/tabledesigndialog.ui")
129 , aImpl(this, rBase, true)
132 virtual short Execute() SAL_OVERRIDE;
135 void showTableDesignDialog( vcl::Window*, ViewShellBase& );
139 #endif // _SD_TABLEFORMATPANE_HXX
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */