Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryQActionContributionItem.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef BERRYQACTIONCONTRIBUTIONITEM_H
19 #define BERRYQACTIONCONTRIBUTIONITEM_H
20 
21 #include "berryContributionItem.h"
22 
23 namespace berry {
24 
33 {
34 
35 public:
36 
43  QActionContributionItem(QAction* action, const QString& id);
44 
46 
51  bool operator==(const Object* o) const override;
52 
53  uint HashCode() const override;
54 
62  void Fill(QStatusBar* parent) override;
63 
72  void Fill(QMenu* parent, QAction *before) override;
73 
82  void Fill(QToolBar* parent, QAction* before) override;
83 
85 
91  QAction* GetAction() const;
92 
101  Modes GetMode() const;
102 
108  bool IsDynamic() const override;
109 
110  /*
111  * Method declared on IContributionItem.
112  */
113  bool IsEnabled() const override;
114 
121  bool IsVisible() const override;
122 
130  void SetMode(Modes mode);
131 
136  void Update() override;
137 
145  void Update(const QString& propertyName) override;
146 
147 protected:
148 
155  bool IsEnabledAllowed() const;
156 
170  //QString ShortenText(const QString& textValue, QToolButton* item);
171 
172 private:
173 
179  //Listener GetToolItemListener();
180 
184  //void HandleWidgetDispose(Event e);
185 
189  //void HandleWidgetSelection(Event e, bool selection);
190 
199  //bool HasImages(Action* actionToCheck) const;
200 
204  bool IsCommandActive() const;
205 
216  //bool UpdateImages(bool forceImage);
217 
221  //void DisposeOldImages();
222 
229  //Listener getMenuCreatorListener();
230 
237  //void HandleShowProxy(QMenu* proxy);
238 
248  //void CopyMenu(QMenu* realMenu, QMenu* proxy);
249 
256  //void HandleHideProxy(QMenu* proxy);
257 
258 private:
259 
264  //QMenu* holdMenu = null;
265 
266  //bool menuCreatorCalled = false;
267 
268 
270  //static const QString ellipsis = "...";
271 
275  bool result; // = null;
276 
280  Modes mode; // = 0;
281 
285  QAction* action;
286 
287 };
288 
289 }
290 
291 #endif // BERRYQACTIONCONTRIBUTIONITEM_H
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
void Fill(QStatusBar *parent) override
unsigned int uint
#define BERRY_UI_QT