CARDS 2.4.87
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  *
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., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  *
21  *
22  */
23 
24 #ifndef CARDS_EVENT_HANDLER_H
25 #define CARDS_EVENT_HANDLER_H
26 
27 #include <cstddef>
28 #include <string>
29 #include <set>
30 
31 #include <FL/Fl.H>
32 #include <FL/Fl_Window.H>
33 #include <FL/fl_ask.H>
34 
35 #include "cards_package.h"
36 
37 namespace cards
38 {
39  using namespace std;
40 
41  enum CEH_RC
42  {
43  OK=0,
44  NO_ROOT,
45  PKG_NOT_EXIST,
46  EXCEPTION
47  };
48 
49  // Define Cards_wrapper singleton for friendship
50  class CWrapper;
51 
52  // Define Cards CLogger singleton for friednship
53  class CLogger;
62  {
63  // Wrapper and Logger can access those protected methods
64  friend CWrapper;
65  friend CLogger;
66  protected:
67 
68  virtual void OnLogMessage (const string& Message){} //NOP method like
69  virtual void OnSyncFinished (const CEH_RC rc){}
70  virtual void OnDoJobListFinished (const CEH_RC rc){}
71  virtual void OnRefreshPackageFinished (const CEH_RC rc){}
72  virtual void OnJobListChange (const CEH_RC rc){}
73  virtual void OnProgressInfo (int percent){}
74  virtual void OnPackageInfo (CPackage& package){}
75 
76  public:
77  static const string getReasonCodeString(const CEH_RC rc);
78  };
79 }
80 #endif
Definition: cards_wrapper.h:58
Definition: cards_package.h:38
Definition: cards_event_handler.h:61
Definition: cards_log.h:52
Definition: cards_client.cxx:26