OpenMS
3.6.0
Main Page
Related Pages
Topics
Namespaces
Concepts
Classes
Files
File List
File Members
Loading...
Searching...
No Matches
TOPPViewMenu.h
Go to the documentation of this file.
1
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2
// SPDX-License-Identifier: BSD-3-Clause
3
//
4
// --------------------------------------------------------------------------
5
// $Maintainer: Chris Bielow $
6
// $Authors: Chris Bielow $
7
// --------------------------------------------------------------------------
8
9
#pragma once
10
11
// OpenMS_GUI config
12
#include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13
14
#include <
OpenMS/DATASTRUCTURES/FlagSet.h
>
15
#include <
OpenMS/KERNEL/StandardTypes.h
>
16
#include <
OpenMS/VISUAL/EnhancedWorkspace.h
>
17
#include <
OpenMS/VISUAL/LayerDataBase.h
>
18
19
#include <QObject>
20
21
#include <vector>
22
23
class
QAction;
24
class
QMenu;
25
26
namespace
OpenMS
27
{
28
class
TOPPViewBase;
29
class
EnhancedWorkspace;
30
class
RecentFilesMenu;
31
32
enum class
TV_STATUS
33
{
34
HAS_CANVAS
,
35
HAS_LAYER
,
36
HAS_MIRROR_MODE
,
// implies 1D View
37
IS_1D_VIEW
,
38
TOPP_IDLE
39
};
40
41
using
FS_TV
=
FlagSet<TV_STATUS>
;
43
FS_TV
OPENMS_GUI_DLLAPI
operator+
(
const
TV_STATUS
left,
const
TV_STATUS
right);
44
45
using
FS_LAYER
=
FlagSet<LayerDataBase::DataType>
;
47
FS_LAYER
OPENMS_GUI_DLLAPI
operator+
(
const
LayerDataBase::DataType
left,
const
LayerDataBase::DataType
right);
48
49
56
class
TOPPViewMenu
57
:
public
QObject
58
{
59
Q_OBJECT
60
public
:
67
TOPPViewMenu
(
TOPPViewBase
*
const
parent,
EnhancedWorkspace
*
const
ws,
RecentFilesMenu
*
const
recent_files);
68
70
void
addWindowToggle
(QAction*
const
window_toggle);
71
72
public
slots:
74
void
update
(
const
FS_TV
status,
const
LayerDataBase::DataType
layer_type);
75
76
private
:
77
struct
ActionRequirement_
78
{
79
ActionRequirement_
(QAction* action,
const
FS_TV
& needs,
const
FS_LAYER
layer_set)
80
:
action_
(action),
needs_
(needs),
layer_set_
(layer_set) {}
81
ActionRequirement_
(QAction* action,
const
TV_STATUS
& needs,
const
FS_LAYER
layer_set)
82
:
action_
(action),
needs_
(needs),
layer_set_
(layer_set) {}
83
87
void
enableAction
(
const
FS_TV
status,
const
LayerDataBase::DataType
layer_type);
88
89
private
:
90
QAction*
action_
;
91
FS_TV
needs_
;
92
FS_LAYER
layer_set_
;
93
};
94
98
QAction*
addAction_
(QAction* action,
const
TV_STATUS
req,
const
FS_LAYER
layer_set =
FS_LAYER
());
100
QAction*
addAction_
(QAction* action,
const
FS_TV
req,
const
FS_LAYER
layer_set =
FS_LAYER
());
101
103
std::vector<ActionRequirement_>
menu_items_
;
104
106
QMenu*
m_windows_
;
107
};
108
109
}
//namespace
110
EnhancedWorkspace.h
FlagSet.h
LayerDataBase.h
StandardTypes.h
OpenMS::EnhancedWorkspace
Definition
EnhancedWorkspace.h:27
OpenMS::FlagSet< TV_STATUS >
OpenMS::RecentFilesMenu
Manages recent files opened by the user and provides a QMenu to go with it.
Definition
RecentFilesMenu.h:35
OpenMS::TOPPViewBase
Main window of TOPPView tool.
Definition
TOPPViewBase.h:103
OpenMS::TOPPViewMenu
The file menu items for TOPPView.
Definition
TOPPViewMenu.h:58
OpenMS::TOPPViewMenu::menu_items_
std::vector< ActionRequirement_ > menu_items_
holds all actions which have a set of requirements, i.e. depend on the state of TOPPViewBase
Definition
TOPPViewMenu.h:103
OpenMS::TOPPViewMenu::update
void update(const FS_TV status, const LayerDataBase::DataType layer_type)
enable/disable entries according to a given state of TOPPViewBase
OpenMS::TOPPViewMenu::addAction_
QAction * addAction_(QAction *action, const TV_STATUS req, const FS_LAYER layer_set=FS_LAYER())
OpenMS::TOPPViewMenu::m_windows_
QMenu * m_windows_
the windows submenu (holds all windows added via addWindowToggle())
Definition
TOPPViewMenu.h:106
OpenMS::TOPPViewMenu::TOPPViewMenu
TOPPViewMenu(TOPPViewBase *const parent, EnhancedWorkspace *const ws, RecentFilesMenu *const recent_files)
Constructor which connects slots/signals of this class with the objects given as arguments.
OpenMS::TOPPViewMenu::addAction_
QAction * addAction_(QAction *action, const FS_TV req, const FS_LAYER layer_set=FS_LAYER())
overload for multiple requirements
OpenMS::TOPPViewMenu::addWindowToggle
void addWindowToggle(QAction *const window_toggle)
add a menu entry at 'Windows -> [Windowname]' to allow hiding/showing a TOPPView subwindow (e....
QObject
OpenMS
Main OpenMS namespace.
Definition
openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
OpenMS::FS_LAYER
FlagSet< LayerDataBase::DataType > FS_LAYER
Definition
TOPPViewMenu.h:45
OpenMS::operator+
FS_TV operator+(const TV_STATUS left, const TV_STATUS right)
allow + operations on the enum, e.g. 'HAS_CANVAS + HAS_LAYER + IS_1D_VIEW'
OpenMS::TV_STATUS
TV_STATUS
Definition
TOPPViewMenu.h:33
OpenMS::TV_STATUS::HAS_MIRROR_MODE
@ HAS_MIRROR_MODE
OpenMS::TV_STATUS::IS_1D_VIEW
@ IS_1D_VIEW
OpenMS::TV_STATUS::HAS_LAYER
@ HAS_LAYER
OpenMS::TV_STATUS::HAS_CANVAS
@ HAS_CANVAS
OpenMS::TV_STATUS::TOPP_IDLE
@ TOPP_IDLE
OpenMS::LayerDataDefs::DataType
DataType
Definition
LayerDataBase.h:74
OpenMS::TOPPViewMenu::ActionRequirement_
Definition
TOPPViewMenu.h:78
OpenMS::TOPPViewMenu::ActionRequirement_::action_
QAction * action_
Definition
TOPPViewMenu.h:90
OpenMS::TOPPViewMenu::ActionRequirement_::needs_
FS_TV needs_
Definition
TOPPViewMenu.h:91
OpenMS::TOPPViewMenu::ActionRequirement_::layer_set_
FS_LAYER layer_set_
Definition
TOPPViewMenu.h:92
OpenMS::TOPPViewMenu::ActionRequirement_::ActionRequirement_
ActionRequirement_(QAction *action, const FS_TV &needs, const FS_LAYER layer_set)
Definition
TOPPViewMenu.h:79
OpenMS::TOPPViewMenu::ActionRequirement_::ActionRequirement_
ActionRequirement_(QAction *action, const TV_STATUS &needs, const FS_LAYER layer_set)
Definition
TOPPViewMenu.h:81
OpenMS::TOPPViewMenu::ActionRequirement_::enableAction
void enableAction(const FS_TV status, const LayerDataBase::DataType layer_type)
OpenMS
VISUAL
TOPPViewMenu.h
Generated on Sun Jan 11 2026 01:47:55 for OpenMS by
1.9.8