Alarm browser improved
[public/netxms.git] / src / client / console / plugins / AlarmBrowser / alarm_browser.h
1 /*
2 ** NetXMS - Network Management System
3 ** Portable management console - Alarm Browser plugin
4 ** Copyright (C) 2007 Victor Kirhenshtein
5 **
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 of the License, or
9 ** (at your option) any later version.
10 **
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU General Public License for more details.
15 **
16 ** You should have received a copy of the GNU General Public License
17 ** along with this program; if not, write to the Free Software
18 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 **
20 ** File: alarm_browser.h
21 **
22 **/
23
24 #ifndef _alarm_browser_h_
25 #define _alarm_browser_h_
26
27 #include <nms_common.h>
28 #include <nms_util.h>
29 #include <nxclapi.h>
30 #include <nxmc_api.h>
31
32
33 //
34 // Alarm view class
35 //
36
37 class nxAlarmView : public wxWindow
38 {
39 private:
40 wxListView *m_wndListCtrl;
41 long m_sortMode;
42 long m_sortDir;
43 wxString m_context;
44
45 void AddAlarm(NXC_ALARM *alarm);
46 void UpdateAlarm(long item, NXC_ALARM *alarm);
47 void SortAlarmList();
48
49 public:
50 nxAlarmView(wxWindow *parent, const TCHAR *context);
51 virtual ~nxAlarmView();
52
53 void RefreshView();
54
55 // Event handlers
56 protected:
57 void OnSize(wxSizeEvent &event);
58 void OnListItemRightClick(wxListEvent &event);
59 void OnListColumnClick(wxListEvent &event);
60
61 DECLARE_EVENT_TABLE()
62 };
63
64
65 //
66 // Alarm browser class
67 //
68
69 class nxAlarmBrowser : public nxView
70 {
71 private:
72 nxAlarmView *m_view;
73
74 public:
75 nxAlarmBrowser();
76 virtual ~nxAlarmBrowser();
77
78 // Event handlers
79 protected:
80 void OnSize(wxSizeEvent &event);
81 void OnViewRefresh(wxCommandEvent &event);
82
83 DECLARE_EVENT_TABLE()
84 };
85
86 #endif