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 :
47 :
48 : #define CB_HEADER_ROW 0
49 : #define CB_TOTAL_ROW 1
50 : #define CB_BANDED_ROWS 2
51 : #define CB_FIRST_COLUMN 3
52 : #define CB_LAST_COLUMN 4
53 : #define CB_BANDED_COLUMNS 5
54 : #define CB_COUNT CB_BANDED_COLUMNS-CB_HEADER_ROW+1
55 :
56 0 : class TableValueSet : public ValueSet
57 : {
58 : private:
59 : bool m_bModal;
60 : public:
61 : TableValueSet(Window *pParent, WinBits nStyle);
62 : virtual void Resize() SAL_OVERRIDE;
63 : virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
64 : void updateSettings();
65 0 : void setModal(bool bModal) { m_bModal = bModal; }
66 : };
67 :
68 : class TableDesignWidget
69 : {
70 : public:
71 : TableDesignWidget( VclBuilderContainer* pParent, ViewShellBase& rBase, bool bModal );
72 : virtual ~TableDesignWidget();
73 :
74 : // callbacks
75 : void onSelectionChanged();
76 :
77 : void ApplyOptions();
78 : void ApplyStyle();
79 :
80 0 : bool isStyleChanged() const { return mbStyleSelected; }
81 0 : bool isOptionsChanged() const { return mbOptionsChanged; }
82 :
83 : private:
84 : void addListener();
85 : void removeListener();
86 : void updateControls();
87 :
88 : void FillDesignPreviewControl();
89 :
90 : DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
91 : DECL_LINK(implValueSetHdl, void *);
92 : DECL_LINK(implCheckBoxHdl, void *);
93 :
94 : private:
95 : ViewShellBase& mrBase;
96 : const OUString msTableTemplate;
97 :
98 : TableValueSet* m_pValueSet;
99 : CheckBox* m_aCheckBoxes[CB_COUNT];
100 :
101 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSelectedTable;
102 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
103 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxTableFamily;
104 : ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > mxToolbar;
105 :
106 : bool mbModal;
107 : bool mbStyleSelected;
108 : bool mbOptionsChanged;
109 : };
110 :
111 0 : class TableDesignPane : public PanelLayout
112 : {
113 : private:
114 : TableDesignWidget aImpl;
115 : public:
116 0 : TableDesignPane( ::Window* pParent, ViewShellBase& rBase )
117 : : PanelLayout(pParent, "TableDesignPanel",
118 : "modules/simpress/ui/tabledesignpanel.ui", com::sun::star::uno::Reference<css::frame::XFrame>())
119 0 : , aImpl(this, rBase, false)
120 : {
121 0 : }
122 : };
123 :
124 :
125 :
126 0 : class TableDesignDialog : public ModalDialog
127 : {
128 : private:
129 : TableDesignWidget aImpl;
130 : public:
131 0 : TableDesignDialog( ::Window* pParent, ViewShellBase& rBase )
132 : : ModalDialog(pParent, "TableDesignDialog",
133 : "modules/sdraw/ui/tabledesigndialog.ui")
134 0 : , aImpl(this, rBase, true)
135 : {
136 0 : }
137 : virtual short Execute() SAL_OVERRIDE;
138 : };
139 :
140 : }
141 :
142 : #endif // _SD_TABLEFORMATPANE_HXX
143 :
144 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|