Developer Documentation
viewModeWidget.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 
51 
52 
53 #ifndef VIEWMODEWIDGET_HH
54 #define VIEWMODEWIDGET_HH
55 
56 #include "ui_viewMode.hh"
57 #include <QStringList>
58 #include <QVector>
59 
60 struct ViewMode;
61 
62 class viewModeWidget : public QDialog, public Ui::viewMode
63 {
64  Q_OBJECT
65  private:
66  // Vector holding list of all available modes
67  const QVector< ViewMode* >& modes_;
68  public:
69  viewModeWidget(const QVector< ViewMode* >& _modes, QWidget *parent = 0 );
70  void show(QString _lastMode);
71  //void toolbarList(Qt::ContextMenuPolicy arg1);
72  private slots:
73 
74  void slotModeChanged(QString _mode);
75  void slotModeClicked(QModelIndex _id);
76 
77 
78  // ============================================
79  // ViewMode Buttons
80  // ============================================
85  void slotRemoveMode();
86 
91  void slotCopyMode();
92 
97  void slotAddMode();
98 
99 
100 
101 
102  // ============================================
103  // ViewMode Context Menu
104  // ============================================
109  void slotModeContextMenu ( const QPoint & _pos );
110 
115  void slotSetIcon();
116 
117  // ============================================
118  // ToolBox and ToolBar Lists update functions
119  // ============================================
124  void slotSetAllWidgets();
125 
126  // ============================================
127  // ToolBar Views Context Menu
128  // ============================================
133  void slotUsedToolbarContextMenu ( const QPoint & _pos );
134 
139  void slotAvailableToolbarContextMenu ( const QPoint & _pos );
140 
141  // ============================================
142  // ToolBox Views Context Menu
143  // ============================================
148  void slotUsedToolboxContextMenu ( const QPoint & _pos );
149 
154  void slotAvailableToolboxContextMenu ( const QPoint & _pos );
155 
156  // ============================================
157  // ContextMenu Views Context Menu
158  // ============================================
163  void slotUsedContextMenuContextMenu ( const QPoint & _pos );
164 
169  void slotAvailableContextMenuContextMenu ( const QPoint & _pos );
170 
171 
172  // ============================================
173  // ToolBar Buttons
174  // ============================================
179  void slotRightArrowToolbar();
180 
185  void slotLeftArrowToolbar();
186 
187  // ============================================
188  //ToolBox Buttons
189  // ============================================
194  void slotRightArrowToolbox();
195 
200  void slotLeftArrowToolbox();
201 
206  void slotMoveToolboxUp();
207 
212  void slotMoveToolboxDown();
213 
214  // ============================================
215  //ContextMenu Buttons
216  // ============================================
222 
228 
233  void slotMoveContextMenuUp();
234 
240 
241 
242  // ============================================
243  // External Communication
244  // ============================================
245 
246  private slots:
248  void slotChangeView();
249 
254  void slotSaveMode();
255 
256  signals:
258  void changeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus);
259 
261  void saveMode(QString _name, bool _custom, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus);
262 
264  void removeMode(QString _name);
265 
266 
267 };
268 
269 #endif //VIEWMODEWIDGET_HH
void slotMoveToolboxUp()
Move Toolbox up.
void slotUsedToolbarContextMenu(const QPoint &_pos)
Context Menu Used Toolbars.
void slotMoveToolboxDown()
Move Toolbox down.
viewModeWidget(const QVector< ViewMode * > &_modes, QWidget *parent=0)
Constructor.
void show(QString _lastMode)
overloaded show function
void slotSetIcon()
Context menu slot to change the icon for a view mode.
void slotCopyMode()
Button slot to copy the selected view mode.
void slotRightArrowToolbox()
remove Toolboxes from Mode
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
Definition: CoreWidget.hh:129
void slotAvailableContextMenuContextMenu(const QPoint &_pos)
Context Menu Available ContextMenus.
void slotModeContextMenu(const QPoint &_pos)
Context Menu View Modes.
void slotModeClicked(QModelIndex _id)
Slot for updating removeButton when new mode is selected.
void slotRightArrowContextMenu()
remove ContextMenu from Mode
void slotAvailableToolboxContextMenu(const QPoint &_pos)
Context Menu Available Toolboxes.
void slotSetAllWidgets()
Update list views.
void slotChangeView()
Slot for changing the current view to currently configured one.
void slotRightArrowToolbar()
remove Toolbars from Mode
void slotMoveContextMenuUp()
Move ContextMenu up.
void saveMode(QString _name, bool _custom, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus)
saves the given mode
void changeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus)
Changes the view mode to the currently configured one.
void slotAvailableToolbarContextMenu(const QPoint &_pos)
Context Menu Available Toolbars.
void slotModeChanged(QString _mode)
Slot for updating removeButton when new mode is selected.
void slotMoveContextMenuDown()
Move Toolbox down.
void slotUsedContextMenuContextMenu(const QPoint &_pos)
Context Menu Used ContextMenus.
void slotLeftArrowToolbar()
add Toolbars to Mode
void slotLeftArrowContextMenu()
add ContextMenu to Mode
void slotLeftArrowToolbox()
add Toolboxes to Mode
void slotSaveMode()
Save the current view mode configuration.
void slotUsedToolboxContextMenu(const QPoint &_pos)
Context Menu Used Toolboxes.
void removeMode(QString _name)
This signal is emitted to remove a mode.
void slotRemoveMode()
Button slot to remove the selected view mode.
void slotAddMode()
Button slot to add a new empty mode.