// Copyright © 2010-2012 sss // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include #include #include #include using namespace proto; const QString host = "127.0.0.1"; namespace Ui { class MainWindow; } struct service_ui { QGroupBox *group; QHBoxLayout *layout; std::list commands; ~service_ui() { for(std::list::iterator i = commands.begin(), end = commands.end(); i != end; ++i) delete *i; delete group; } }; class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); protected slots: void ssl_verify_error_handler(const QSslError); private slots: void disconnected(); void connected(); void handle_data(); void handle_button_click(); private: void get_socket(); void _connect(); Ui::MainWindow *ui; QSslSocket *sock; std::list *services; std::list svc_ui_list; }; #endif // MAINWINDOW_H