Version: 8.3.0
Menus.hxx
Go to the documentation of this file.
1 // Copyright (C) 2006-2016 CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef _MENUS_HXX_
21 #define _MENUS_HXX_
22 
23 #include <QObject>
24 #include <QWidget>
25 #include <QAction>
26 #include <QPoint>
27 
28 namespace YACS
29 {
30  namespace HMI
31  {
32  class MenusBase: public QObject
33  {
34  Q_OBJECT
35  public:
36  MenusBase();
37  virtual ~MenusBase();
38  virtual void popupMenu(QWidget *caller,
39  const QPoint &globalPos,
40  const QString& m = "MenuBase");
41  virtual void addForEachMenu(QMenu *m, QActionGroup* actgroup);
42  virtual void addForEachMenuToPutGraph(QMenu *m, QActionGroup* actgroup);
43  protected slots:
44  void dummyAction();
45  void foreachAction(QAction*);
46  void putGraphInForeachAction(QAction*);
47  protected:
48  virtual void buildForEachMenu(QMenu *m, QActionGroup* actgroup);
49  virtual void addHeader(QMenu &m, const QString &h);
50  QAction *_dummyAct;
51  };
52 
53  class NodeMenu: public MenusBase
54  {
55  Q_OBJECT
56  public:
57  NodeMenu();
58  virtual ~NodeMenu();
59  virtual void popupMenu(QWidget *caller,
60  const QPoint &globalPos,
61  const QString& m = "Node Menu");
62  };
63 
65  {
66  Q_OBJECT
67  public:
69  virtual ~ComposedNodeMenu();
70  virtual void popupMenu(QWidget *caller,
71  const QPoint &globalPos,
72  const QString& m = "Composed Node Menu");
73  };
74 
75  class ProcMenu: public MenusBase
76  {
77  Q_OBJECT
78  public:
79  ProcMenu();
80  virtual ~ProcMenu();
81  virtual void popupMenu(QWidget *caller,
82  const QPoint &globalPos,
83  const QString& m = "Proc Menu");
84  };
85 
86  class HeaderNodeMenu: public MenusBase
87  {
88  Q_OBJECT
89  public:
91  virtual ~HeaderNodeMenu();
92  virtual void popupMenu(QWidget *caller,
93  const QPoint &globalPos,
94  const QString& m = "Header Node Menu");
95  };
96 
97  class LinkMenu: public MenusBase
98  {
99  Q_OBJECT
100  public:
101  LinkMenu();
102  virtual ~LinkMenu();
103  virtual void popupMenu(QWidget *caller,
104  const QPoint &globalPos,
105  const QString& m = "Link Menu");
106  };
107 
109  {
110  Q_OBJECT
111  public:
113  virtual ~ElementaryNodeMenu();
114  virtual void popupMenu(QWidget *caller,
115  const QPoint &globalPos,
116  const QString& m = "Elementary Node Menu");
117  };
118 
119  class InPortMenu: public MenusBase
120  {
121  Q_OBJECT
122  public:
123  InPortMenu();
124  virtual ~InPortMenu();
125  virtual void popupMenu(QWidget *caller,
126  const QPoint &globalPos,
127  const QString& m = "In Port Menu");
128  };
129 
130  class OutPortMenu: public MenusBase
131  {
132  Q_OBJECT
133  public:
134  OutPortMenu();
135  virtual ~OutPortMenu();
136  virtual void popupMenu(QWidget *caller,
137  const QPoint &globalPos,
138  const QString& m = "Out Port Menu");
139  };
140 
141  class CtrlInPortMenu: public MenusBase
142  {
143  Q_OBJECT
144  public:
145  CtrlInPortMenu();
146  virtual ~CtrlInPortMenu();
147  virtual void popupMenu(QWidget *caller,
148  const QPoint &globalPos,
149  const QString& m = "Control In Port Menu");
150  };
151 
153  {
154  Q_OBJECT
155  public:
156  CtrlOutPortMenu();
157  virtual ~CtrlOutPortMenu();
158  virtual void popupMenu(QWidget *caller,
159  const QPoint &globalPos,
160  const QString& m = "Control Out Port Menu");
161  };
162 
163  class ReferenceMenu: public MenusBase
164  {
165  Q_OBJECT
166  public:
167  ReferenceMenu();
168  virtual ~ReferenceMenu();
169  virtual void popupMenu(QWidget *caller,
170  const QPoint &globalPos,
171  const QString& m = "Reference Menu");
172  };
173 
175  {
176  Q_OBJECT
177  public:
179  virtual ~ContainerDirMenu();
180  virtual void popupMenu(QWidget *caller,
181  const QPoint &globalPos,
182  const QString& m = "Containers Menu");
183  };
184 
186  {
187  Q_OBJECT
188  public:
190  virtual ~ComponentInstanceMenu();
191  virtual void popupMenu(QWidget *caller,
192  const QPoint &globalPos,
193  const QString& m = "ComponentInstance Menu");
194  };
195 
196  class ContainerMenu: public MenusBase
197  {
198  Q_OBJECT
199  public:
200  ContainerMenu();
201  virtual ~ContainerMenu();
202  virtual void popupMenu(QWidget *caller,
203  const QPoint &globalPos,
204  const QString& m = "Container Menu");
205  };
206  }
207 }
208 
209 #endif