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