CARDS 2.4.87
Package manager for the NuTyX GNU/Linux distribution
mainWindow.h
1 /*
2  * mainWindow.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 MAINWINDOW_H
25 #define MAINWINDOW_H
26 
27 //Global Includes
28 #include <FL/Fl.H>
29 #include <FL/Fl_Double_Window.H>
30 #include <FL/fl_ask.H>
31 #include <FL/Fl_Input.H>
32 #include <FL/Fl_Menu_Bar.H>
33 #include <FL/Fl_Tabs.H>
34 #include <FL/Fl_Table.H>
35 #include <FL/Fl_Text_Display.H>
36 #include <FL/Fl_Multiline_Output.H>
37 #include <FL/Fl_Button.H>
38 #include <FL/Fl_Preferences.H>
39 #include <FL/Fl_Check_Button.H>
40 #include <string>
41 #include <vector>
42 
43 //Project Includes
44 #include "pixmaps/flcards.xpm"
45 #include "table_package.h"
46 #include "table_collection.h"
47 #include "cards_wrapper.h"
48 #include "progressbox.h"
49 #include "cards_log.h"
50 
51 using namespace std;
52 using namespace cards;
53 
54 
55 enum widgetID
56 {
57  BTN_SYNC,
58  BTN_APPLY,
59  SEARCH_CHANGE,
60  CHKB_PACKAGE,
61  CHKB_COLLECT,
62  EVT_EXIT
63 };
64 
75 class mainWindow : public Fl_Double_Window, public CEventHandler
76 {
77 public:
84  mainWindow(bool pInstaller=false);
85 
86  virtual ~mainWindow();
87  void LoadConfig();
88 
89 protected:
90 //Fltk callbacks
91  static void onWindowEvent(Fl_Widget* pWidget,long pID);
92 
93 //Cards Wrapper callbacks
94  void OnSyncFinished(const CEH_RC rc);
95  void OnJobListChange(const CEH_RC rc);
96  void OnLogMessage(const string& pMessage);
97  void OnPackageInfo(CPackage& pPackage);
98 
99 private:
100  void SaveConfig();
101  TableBase* _tablePackages;
102  TableBase* _tableCollections;
103  //PackList* _packList;
104  Fl_Input* _search;
105  Fl_Text_Display* _console;
106  Fl_Text_Display* _info;
107  Fl_Text_Buffer * _consoleBuff;
108  Fl_Text_Buffer * _infoBuff;
109  Fl_Button* _btnSync;
110  Fl_Button* _btnApply;
111  Fl_Group* _grpPackage;
112  Fl_Group* _grpCollection;
113  Fl_Tabs* _tabs;
114  CWrapper* _cards;
115  Fl_Preferences* _config;
116  CLogger* _log;
117 };
118 
119 #endif // MAINWINDOW_H
Definition: table_base.h:77
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
FTLTK Main window of application.
Definition: mainWindow.h:75