MAK RTIspy API Documentation for HLA 1.3
trayIconMgr.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2013 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
6 #ifndef trayIconMgr_H_
7 #define trayIconMgr_H_
8 
11 
12 #include "rtiMsConfig.h"
13 #include "assistantMgr.h"
14 #include "rtiAssistantClient.h"
15 #include <QtGui/QIcon>
16 #include <QtGui/QSystemTrayIcon>
17 #include <vlutil/vlSmartPointers.h>
18 #include <vlutil/vlPrint.h>
19 #include <map>
20 
22 class DtRtiAssistantPeer;
23 class DtAssistantComponentMenu;
25 class DtConsoleDialog;
27 class DtAboutBox;
34 class QMenu;
35 class QAction;
36 class QProcess;
37 
43 {
44  Q_OBJECT
45 
46 public:
47 
49  DtAssistantTrayIconMgr( DtBoost::shared_ptr<DtRtiAssistantServer> server,
50  DtBoost::shared_ptr<DtRtiAssistantPeer> peer,
51  DtAssistantSignalRouter& signalRouter,
52  DtBoost::shared_ptr<DtAssistantComponentMgr> compMgr );
53 
55  virtual ~DtAssistantTrayIconMgr();
56 
57 private:
58 
61 
64 
65 public:
66 
68  virtual void startShutdown();
69 
70 protected:
71 
73 
74 
76  static void processNotifyMsg(const DtAssistantNotifyMsg& msg, void* usr);
77 
79  virtual void processNotifyMsg(const DtAssistantNotifyMsg& msg);
80 
82  static void processShowDialogMsg(const DtAssistantShowDialogMsg& msg, void* usr);
83 
85  virtual void processShowDialogMsg(const DtAssistantShowDialogMsg& msg);
86 
88  static void processNotifyObserveMsg(const DtAssistantNotifyObserveMsg& msg, void* usr);
89 
92  virtual void processNotifyObserveMsg(const DtAssistantNotifyObserveMsg& msg);
93 
95 
97  virtual void loadBrowserPage(const QString &page);
98 
99 signals:
100 
102  void shutdown();
103 
105  void displayActiveWarningDialogs();
106 
108  void showConfigDialog( DtPreferencesPage pageNum = DtInvalidPreferencesPage );
109 
111  void showFederationsDialog();
112 
113 public slots:
114 
117  void showNotifyConsole();
118 
120  void showVersionsWebpage();
121 
123  void showAboutDialog();
124 
126  void showHelpDialog();
127 
129  void processHelpDialogClose();
130 
132  void notification( const MAKRti::DtString& message,
133  MAKRti::DtNotifyLevelType notifyLevel, int sourceCompId = -1,
134  bool logOnly = false, bool forward = true);
135 
137  void notification( const MAKRti::DtString& message,
138  MAKRti::DtNotifyLevelType notifyLevel, const MAKRti::DtString& source,
139  bool logOnly = false, bool forward = true);
140 
144  void showNotifyIcon();
145 
147  void clearNotifyIcon();
148 
151  void showWarningIcon();
152 
155  void clearWarningIcon();
156 
158  void processTrayIconActivation( QSystemTrayIcon::ActivationReason reason );
159 
161  void setEnableNotifications( bool enable );
162 
165  void setObservingNotifications( bool isObserving );
166 
168  void sendNotifyObserveMsg();
169 
171  void pruneStaleNotifyObservers();
172 
173 #ifdef DtDIAGNOSTIC
174 
175  void showMsgDump();
176 #endif
177 
178 
179 protected:
180 
182  DtBoost::shared_ptr<DtAssistantComponentMgr> myCompMgr;
183 
185  QSystemTrayIcon* myTrayIcon;
186 
188  QMenu* myMenu;
189 
192 
195 
199 
202 
205 
208 
211 
214 
218 
221 
223  QProcess* myHelpAssistant;
224 
227 
231 
234 
237  std::map<int, MAKRti::DtString> myLastNotifyNames;
238 
241 
243  std::map< DtAssistantInfo, bool > myNotifyObservers;
244 
245 #ifdef _WIN32
246 
247  bool myShowingMsgDump;
248  std::streambuf* myOriginalRdbuf;
249  DtWindowsConsolePrinter *myWinConsole;
250  std::ofstream* myConsoleStream;
251 #endif
252 
253 
254 };
255 
256 #endif

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)