Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryQActionContributionItem.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef BERRYQACTIONCONTRIBUTIONITEM_H
15 #define BERRYQACTIONCONTRIBUTIONITEM_H
16 
17 #include "berryContributionItem.h"
18 
19 namespace berry {
20 
29 {
30 
31 public:
32 
39  QActionContributionItem(QAction* action, const QString& id);
40 
41  ~QActionContributionItem() override;
42 
47  bool operator==(const Object* o) const override;
48 
49  uint HashCode() const override;
50 
58  void Fill(QStatusBar* parent) override;
59 
68  void Fill(QMenu* parent, QAction *before) override;
69 
78  void Fill(QToolBar* parent, QAction* before) override;
79 
81 
87  QAction* GetAction() const;
88 
97  Modes GetMode() const;
98 
104  bool IsDynamic() const override;
105 
106  /*
107  * Method declared on IContributionItem.
108  */
109  bool IsEnabled() const override;
110 
117  bool IsVisible() const override;
118 
126  void SetMode(Modes mode);
127 
132  void Update() override;
133 
141  void Update(const QString& propertyName) override;
142 
143 protected:
144 
151  bool IsEnabledAllowed() const;
152 
166  //QString ShortenText(const QString& textValue, QToolButton* item);
167 
168 private:
169 
175  //Listener GetToolItemListener();
176 
180  //void HandleWidgetDispose(Event e);
181 
185  //void HandleWidgetSelection(Event e, bool selection);
186 
195  //bool HasImages(Action* actionToCheck) const;
196 
200  bool IsCommandActive() const;
201 
212  //bool UpdateImages(bool forceImage);
213 
217  //void DisposeOldImages();
218 
225  //Listener getMenuCreatorListener();
226 
233  //void HandleShowProxy(QMenu* proxy);
234 
244  //void CopyMenu(QMenu* realMenu, QMenu* proxy);
245 
252  //void HandleHideProxy(QMenu* proxy);
253 
254 private:
255 
260  //QMenu* holdMenu = null;
261 
262  //bool menuCreatorCalled = false;
263 
264 
266  //static const QString ellipsis = "...";
267 
271  Modes mode; // = 0;
272 
276  QAction* action;
277 
278 };
279 
280 }
281 
282 #endif // BERRYQACTIONCONTRIBUTIONITEM_H
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:31
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
void Fill(QStatusBar *parent) override
unsigned int uint
#define BERRY_UI_QT