Line data Source code
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 : #ifndef INCLUDED_SD_SOURCE_UI_TABLE_TABLEDESIGNPANE_HXX
21 : #define INCLUDED_SD_SOURCE_UI_TABLE_TABLEDESIGNPANE_HXX
22 :
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>
28 :
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>
34 :
35 : #include <boost/scoped_ptr.hpp>
36 :
37 : namespace sd
38 : {
39 :
40 : namespace tools {
41 : class EventMultiplexerEvent;
42 : }
43 :
44 : class ViewShellBase;
45 :
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
53 :
54 0 : class TableValueSet : public ValueSet
55 : {
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 0 : void setModal(bool bModal) { m_bModal = bModal; }
64 : };
65 :
66 : class TableDesignWidget
67 : {
68 : public:
69 : TableDesignWidget( VclBuilderContainer* pParent, ViewShellBase& rBase, bool bModal );
70 : virtual ~TableDesignWidget();
71 :
72 : // callbacks
73 : void onSelectionChanged();
74 :
75 : void ApplyOptions();
76 : void ApplyStyle();
77 :
78 0 : bool isStyleChanged() const { return mbStyleSelected; }
79 0 : bool isOptionsChanged() const { return mbOptionsChanged; }
80 :
81 : private:
82 : void addListener();
83 : void removeListener();
84 : void updateControls();
85 :
86 : void FillDesignPreviewControl();
87 :
88 : DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
89 : DECL_LINK(implValueSetHdl, void *);
90 : DECL_LINK(implCheckBoxHdl, void *);
91 :
92 : private:
93 : ViewShellBase& mrBase;
94 :
95 : TableValueSet* m_pValueSet;
96 : CheckBox* m_aCheckBoxes[CB_COUNT];
97 :
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;
102 :
103 : bool mbModal;
104 : bool mbStyleSelected;
105 : bool mbOptionsChanged;
106 : };
107 :
108 0 : class TableDesignPane : public PanelLayout
109 : {
110 : private:
111 : TableDesignWidget aImpl;
112 : public:
113 0 : 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 0 : , aImpl(this, rBase, false)
117 : {
118 0 : }
119 : };
120 :
121 0 : class TableDesignDialog : public ModalDialog
122 : {
123 : private:
124 : TableDesignWidget aImpl;
125 : public:
126 0 : TableDesignDialog( vcl::Window* pParent, ViewShellBase& rBase )
127 : : ModalDialog(pParent, "TableDesignDialog",
128 : "modules/sdraw/ui/tabledesigndialog.ui")
129 0 : , aImpl(this, rBase, true)
130 : {
131 0 : }
132 : virtual short Execute() SAL_OVERRIDE;
133 : };
134 :
135 : void showTableDesignDialog( vcl::Window*, ViewShellBase& );
136 :
137 : }
138 :
139 : #endif // _SD_TABLEFORMATPANE_HXX
140 :
141 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|