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  // ============================================
208 
214 
219  void slotMoveContextMenuUp();
220 
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 
void slotSetAllWidgets()
Update list views.
void slotMoveToolboxDown()
Move Toolbox down.
ViewMode struct This struct contains a ViewMode and its status information such as used widgets...
Definition: CoreWidget.hh:124
void slotModeContextMenu(const QPoint &_pos)
Context Menu View Modes.
void slotChangeView()
Slot for changing the current view to currently configured one.
void slotUsedContextMenuContextMenu(const QPoint &_pos)
Context Menu Used ContextMenus.
void slotLeftArrowContextMenu()
add ContextMenu to Mode
void slotModeChanged(QString _mode)
Slot for updating removeButton when new mode is selected.
void slotAvailableToolbarContextMenu(const QPoint &_pos)
Context Menu Available Toolbars.
void slotLeftArrowToolbox()
add Toolboxes to Mode
void changeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus)
Changes the view mode to the currently configured one.
void slotMoveToolboxUp()
Move Toolbox up.
void slotMoveContextMenuUp()
Move ContextMenu up.
void slotRightArrowToolbox()
remove Toolboxes from Mode
void removeMode(QString _name)
This signal is emitted to remove a mode.
void slotSetIcon()
Context menu slot to change the icon for a view mode.
void slotSaveMode()
Save the current view mode configuration.
void slotUsedToolbarContextMenu(const QPoint &_pos)
Context Menu Used Toolbars.
void show(QString _lastMode)
overloaded show function
void slotMoveContextMenuDown()
Move Toolbox down.
void slotRightArrowContextMenu()
remove ContextMenu from Mode
void slotAvailableToolboxContextMenu(const QPoint &_pos)
Context Menu Available Toolboxes.
void slotUsedToolboxContextMenu(const QPoint &_pos)
Context Menu Used Toolboxes.
void slotAvailableContextMenuContextMenu(const QPoint &_pos)
Context Menu Available ContextMenus.
void slotModeClicked(QModelIndex _id)
Slot for updating removeButton when new mode is selected.
void saveMode(QString _name, bool _custom, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus)
saves the given mode
void slotLeftArrowToolbar()
add Toolbars to Mode
void slotCopyMode()
Button slot to copy the selected view mode.
viewModeWidget(const QVector< ViewMode * > &_modes, QWidget *parent=0)
Constructor.
void slotAddMode()
Button slot to add a new empty mode.
void slotRightArrowToolbar()
remove Toolbars from Mode
void slotRemoveMode()
Button slot to remove the selected view mode.