CARDS 2.4.121
Package manager for the NuTyX GNU/Linux distribution
cards_event_handler.h
1 /*
2  * cards_event_handler.h
3  *
4  * Copyright 2017 Gianni Peschiutta <artemia@nutyx.org>
5  * Copyright 2017 - 2020 Thierry Nuttens <tnut@nutyx.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20  * MA 02110-1301, USA.
21  *
22  *
23  */
24 
25 #ifndef CARDS_EVENT_HANDLER_H
26 #define CARDS_EVENT_HANDLER_H
27 
28 #include <cstddef>
29 #include <string>
30 #include <set>
31 
32 #include <FL/Fl.H>
33 #include <FL/Fl_Window.H>
34 #include <FL/fl_ask.H>
35 
36 #include "cards_package.h"
37 
38 namespace cards
39 {
40  using namespace std;
41 
42  enum CEH_RC
43  {
44  OK=0,
45  NO_ROOT,
46  PKG_NOT_EXIST,
47  EXCEPTION
48  };
49 
50  // Define Cards_wrapper singleton for friendship
51  class CWrapper;
52 
53  // Define Cards CLogger singleton for friednship
54  class CLogger;
63  {
64  // Wrapper and Logger can access those protected methods
65  friend CWrapper;
66  friend CLogger;
67  protected:
68 
69  virtual void OnLogMessage (const string& Message){} //NOP method like
70  virtual void OnSyncFinished (const CEH_RC rc){}
71  virtual void OnDoJobListFinished (const CEH_RC rc){}
72  virtual void OnRefreshPackageFinished (const CEH_RC rc){}
73  virtual void OnJobListChange (const CEH_RC rc){}
74  virtual void OnProgressInfo (int percent){}
75  virtual void OnPackageInfo (CPackage& package){}
76 
77  public:
78  static const string getReasonCodeString(const CEH_RC rc);
79  };
80 }
81 #endif
cards::CLogger
Definition: cards_log.h:54
cards::CPackage
Definition: cards_package.h:40
cards::CWrapper
Definition: cards_wrapper.h:60
cards::CEventHandler
Definition: cards_event_handler.h:63