libyui-qt-rest-api
Loading...
Searching...
No Matches
YQHttpUI.h
1/*
2 Copyright (C) 2018-2019 SUSE LLC
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) version 3.0 of the License. This library
7 is distributed in the hope that it will be useful, but WITHOUT ANY
8 WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 License for more details. You should have received a copy of the GNU
11 Lesser General Public License along with this library; if not, write
12 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 Floor, Boston, MA 02110-1301 USA
14*/
15
16
17/*-/
18
19 File: YQHttpUI.h
20 Purpose: Introducing rest-api related changes to qt libyui library
21 Extends YQUI, overrides initialization to handle events coming
22 from the http server
23/-*/
24
25#ifndef YQHttpUI_h
26#define YQHttpUI_h
27
28#include <yui/qt/YQUI.h>
29
30
32// To be used in connect(foo, &pclass(foo)::mysignal, bar, &pclass(bar)::myslot);
33// That checks types at compile time,
34// unlike the string based SIGNAL and SLOT macros.
35#define pclass(ptr) std::remove_reference<decltype(*ptr)>::type
36
37class QSocketNotifier;
39
40
41class YQHttpUI: public YQUI
42{
43 friend class YQHttpUISignalReceiver;
44
45public:
46
50 YQHttpUI( bool withThreads );
51
55 virtual ~YQHttpUI();
56
61 void initUI();
62
63};
64
70class YQHttpUISignalReceiver : public YQUISignalReceiver
71{
72
73public:
75 ~YQHttpUISignalReceiver() { clearHttpNotifiers(); }
76
77public slots:
78 void httpData();
79
80public:
81 void clearHttpNotifiers();
82 void createHttpNotifiers();
83
84private:
85 std::vector<QSocketNotifier*> _http_notifiers;
86};
87
94extern "C" {
95 YUI * createYQHttpUI( bool withThreads );
96}
97
98#endif // YQHttpUI_h
Definition YQHttpUI.h:71
Definition YQHttpUI.h:42
void initUI()
Definition YQHttpUI.cc:38
virtual ~YQHttpUI()
Definition YQHttpUI.cc:68