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 #pragma once
43
44 #include "ui_viewMode.h"
45
46 struct ViewMode;
47
48 class viewModeWidget : public QDialog, public Ui::viewMode
49 {
50 Q_OBJECT
51 private:
52 // Vector holding list of all available modes
53 const QVector< ViewMode* >& modes_;
54 public:
55 viewModeWidget(const QVector< ViewMode* >& _modes, QWidget *parent = 0 );
56 void show(QString _lastMode);
57 //void toolbarList(Qt::ContextMenuPolicy arg1);
58 private slots:
59
60 void slotModeChanged(QString _mode);
61 void slotModeClicked(QModelIndex _id);
62
63
64 // ============================================
65 // ViewMode Buttons
66 // ============================================
71 void slotRemoveMode();
72
77 void slotCopyMode();
78
83 void slotAddMode();
84
85
86
87
88 // ============================================
89 // ViewMode Context Menu
90 // ============================================
95 void slotModeContextMenu ( const QPoint & _pos );
96
101 void slotSetIcon();
102
103 // ============================================
104 // ToolBox and ToolBar Lists update functions
105 // ============================================
110 void slotSetAllWidgets();
111
112 // ============================================
113 // ToolBar Views Context Menu
114 // ============================================
119 void slotUsedToolbarContextMenu ( const QPoint & _pos );
120
125 void slotAvailableToolbarContextMenu ( const QPoint & _pos );
126
127 // ============================================
128 // ToolBox Views Context Menu
129 // ============================================
134 void slotUsedToolboxContextMenu ( const QPoint & _pos );
135
140 void slotAvailableToolboxContextMenu ( const QPoint & _pos );
141
142 // ============================================
143 // ContextMenu Views Context Menu
144 // ============================================
149 void slotUsedContextMenuContextMenu ( const QPoint & _pos );
150
155 void slotAvailableContextMenuContextMenu ( const QPoint & _pos );
156
157
158 // ============================================
159 // ToolBar Buttons
160 // ============================================
165 void slotRightArrowToolbar();
166
171 void slotLeftArrowToolbar();
172
173 // ============================================
174 //ToolBox Buttons
175 // ============================================
180 void slotRightArrowToolbox();
181
186 void slotLeftArrowToolbox();
187
192 void slotMoveToolboxUp();
193
198 void slotMoveToolboxDown();
199
200 // ============================================
201 //ContextMenu Buttons
202 // ============================================
207 void slotRightArrowContextMenu();
208
213 void slotLeftArrowContextMenu();
214
219 void slotMoveContextMenuUp();
220
225 void slotMoveContextMenuDown();
226
227
228 // ============================================
229 // External Communication
230 // ============================================
231
232 private slots:
234 void slotChangeView();
235
240 void slotSaveMode();
241
242 signals:
244 void changeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus);
245
247 void saveMode(QString _name, bool _custom, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus);
248
250 void removeMode(QString _name);
251
252
253 };
254
viewModeWidget::slotRightArrowToolbox
void slotRightArrowToolbox()
remove Toolboxes from Mode
Definition: viewModeWidget.cc:496
viewModeWidget::slotMoveContextMenuDown
void slotMoveContextMenuDown()
Move Toolbox down.
Definition: viewModeWidget.cc:619
viewModeWidget::slotAvailableToolbarContextMenu
void slotAvailableToolbarContextMenu(const QPoint &_pos)
Context Menu Available Toolbars.
Definition: viewModeWidget.cc:383
viewModeWidget::slotModeChanged
void slotModeChanged(QString _mode)
Slot for updating removeButton when new mode is selected.
Definition: viewModeWidget.cc:886
viewModeWidget::removeMode
void removeMode(QString _name)
This signal is emitted to remove a mode.
viewModeWidget::slotRemoveMode
void slotRemoveMode()
Button slot to remove the selected view mode.
Definition: viewModeWidget.cc:150
viewModeWidget::slotModeContextMenu
void slotModeContextMenu(const QPoint &_pos)
Context Menu View Modes.
Definition: viewModeWidget.cc:241
viewModeWidget::slotUsedToolbarContextMenu
void slotUsedToolbarContextMenu(const QPoint &_pos)
Context Menu Used Toolbars.
Definition: viewModeWidget.cc:369
viewModeWidget::slotLeftArrowToolbar
void slotLeftArrowToolbar()
add Toolbars to Mode
Definition: viewModeWidget.cc:484
viewModeWidget::slotSetAllWidgets
void slotSetAllWidgets()
Update list views.
Definition: viewModeWidget.cc:297
viewModeWidget::slotChangeView
void slotChangeView()
Slot for changing the current view to currently configured one.
Definition: viewModeWidget.cc:653
viewModeWidget::changeView
void changeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus)
Changes the view mode to the currently configured one.
viewModeWidget::slotCopyMode
void slotCopyMode()
Button slot to copy the selected view mode.
Definition: viewModeWidget.cc:156
viewModeWidget::slotAvailableToolboxContextMenu
void slotAvailableToolboxContextMenu(const QPoint &_pos)
Context Menu Available Toolboxes.
Definition: viewModeWidget.cc:421
viewModeWidget::slotMoveToolboxDown
void slotMoveToolboxDown()
Move Toolbox down.
Definition: viewModeWidget.cc:542
viewModeWidget
Definition: viewModeWidget.hh:48
ViewMode
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
Definition: CoreWidget.hh:124
viewModeWidget::slotSaveMode
void slotSaveMode()
Save the current view mode configuration.
Definition: viewModeWidget.cc:735
viewModeWidget::slotUsedContextMenuContextMenu
void slotUsedContextMenuContextMenu(const QPoint &_pos)
Context Menu Used ContextMenus.
Definition: viewModeWidget.cc:439
viewModeWidget::slotMoveContextMenuUp
void slotMoveContextMenuUp()
Move ContextMenu up.
Definition: viewModeWidget.cc:591
viewModeWidget::slotAvailableContextMenuContextMenu
void slotAvailableContextMenuContextMenu(const QPoint &_pos)
Context Menu Available ContextMenus.
Definition: viewModeWidget.cc:459
viewModeWidget::slotRightArrowContextMenu
void slotRightArrowContextMenu()
remove ContextMenu from Mode
Definition: viewModeWidget.cc:573
viewModeWidget::slotMoveToolboxUp
void slotMoveToolboxUp()
Move Toolbox up.
Definition: viewModeWidget.cc:514
viewModeWidget::slotSetIcon
void slotSetIcon()
Context menu slot to change the icon for a view mode.
Definition: viewModeWidget.cc:263
viewModeWidget::slotUsedToolboxContextMenu
void slotUsedToolboxContextMenu(const QPoint &_pos)
Context Menu Used Toolboxes.
Definition: viewModeWidget.cc:401
viewModeWidget::slotAddMode
void slotAddMode()
Button slot to add a new empty mode.
Definition: viewModeWidget.cc:204
viewModeWidget::slotRightArrowToolbar
void slotRightArrowToolbar()
remove Toolbars from Mode
Definition: viewModeWidget.cc:476
viewModeWidget::slotLeftArrowContextMenu
void slotLeftArrowContextMenu()
add ContextMenu to Mode
Definition: viewModeWidget.cc:581
viewModeWidget::viewModeWidget
viewModeWidget(const QVector< ViewMode * > &_modes, QWidget *parent=0)
Constructor.
Definition: viewModeWidget.cc:51
viewModeWidget::show
void show(QString _lastMode)
overloaded show function
Definition: viewModeWidget.cc:837
viewModeWidget::slotLeftArrowToolbox
void slotLeftArrowToolbox()
add Toolboxes to Mode
Definition: viewModeWidget.cc:504
viewModeWidget::slotModeClicked
void slotModeClicked(QModelIndex _id)
Slot for updating removeButton when new mode is selected.
Definition: viewModeWidget.cc:881
viewModeWidget::saveMode
void saveMode(QString _name, bool _custom, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus)
saves the given mode