OSDN Git Service

Please ignore this commit.
[greensite/jasmine.git] / ui / jasmine_mainwindow.h
1 #pragma once
2 #include "ui_jasmine_main.h"
3 #include "memberlist.h"
4 #include "settingdialog.h"
5 #include "rtfeditor.h"
6 #include "../settings.h"
7 #include "../validator/ipaddressvalidator.h"
8 #include "../network/tcpnetwork.h"
9
10 using namespace structures;
11 using namespace network;
12
13 class mainWindow:public QMainWindow,private Ui::MainWindow{
14     Q_OBJECT
15 public:
16     mainWindow();
17     ~mainWindow();
18 private slots:
19     //These functions work automatically by automatic connection.
20     void on_sendButton_clicked();
21     void on_runServerAction_triggered(bool);
22     void on_serverSettingAction_triggered();
23     void on_clientSettingAction_triggered();
24     void on_miscAction_triggered();
25     void on_sendFileAction_triggered();
26     void on_aboutAction_triggered();
27     void on_openMemberListAction_triggered();
28     void on_saveLogAction_triggered();
29     void on_saveMemberListAction_triggered();
30     void on_actionExit_triggered();
31     void on_clearAction_triggered();
32     void on_addButton_clicked();
33     void on_removeButton_clicked();
34     void on_saveConfigAction_triggered();
35     void on_openConfigAction_triggered();
36     //This function works manually.
37     void settingDialog_accepted();
38     //These are for saving stuff.
39     void saveConfig(const QString &);
40     void saveMember(const QString &);
41     void saveLog(const QString &);
42     //This is for links.
43     void linkClicked(const QUrl &);
44     //These slots are for receiveText.
45     void invalidLink(const QString &);
46     void selectedLink(const QUrl &);
47     //These functions are for tcpclient.
48     void sentData();
49     //These functions are for tcpserver.
50     bool tcpserver_pending(const AddressAndPort &);
51     void tcpserver_accepted(const threadedTcpSocket &);
52     void tcpserver_msg_received(const QString &);
53 public slots:
54     //These are for opening stuff.
55     void openConfig(const QString &);
56     void openMember(const QString &);
57 protected:
58     //Events
59     void closeEvent(QCloseEvent *);
60     void showEvent(QShowEvent *);
61 private:
62     QObject                     *beforesender;
63     QStringList         memberFilters,logFilters;
64
65     MemberList          *memberList;
66     RtfEditor           *sendTextEditor;
67     tcpServer           *mainServer;
68     SettingDialog       *settingdialog;
69     settings            setting;
70
71     bool isInMember(const AddressAndPort &,bool matchIPOnly);
72     void configAndShowSettingDialog(const SettingDialog::tab);
73 public:
74     settings app_setting() const;
75 };
76