1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #ifndef QMLHANDLER_H
- #define QMLHANDLER_H
- #include <QObject>
- #include <QUrl>
- extern bool _RESTART;
- class QMLHandler : public QObject {
- Q_OBJECT
- private:
- void handleJSON(std::string buffer);
- void readPipeLoop();
- void reopenCLI(QString ip);
- void closeCLI();
- void fileExists(std::string name);
- public:
- explicit QMLHandler(QObject *parent = 0);
- void onExit();
- // C++ -> QML
- signals:
- // Sending
- void sendingSetFileUrlText(QString signalText);
- void sendingEnableSendButton();
- void sendingDisableSendButton();
- // Receiving
- void receivingClearFileList();
- void receivingListFile(QString fileName, bool existsLocally);
- void receivingDisableDownloadButton(QString fileName);
- // Messages
- void message(QString msg);
- // Settings
- void closeWindow();
- // Ip Popup
- void ipPopupSetStatus(QString status);
- void ipPopupClose();
- void ipPopupOpen();
- void ipPopupEnableConnectButton();
- void ipPopupDisableConnectButton();
- // Login Signup Popup
- void loginSignupPopupClose();
- void loginSignupPopupOpen();
- // Login
- void loginSetStatus(QString status);
- void loginEnableLoginButton();
- void loginDisableLoginButton();
- // Signup
- void signupSetStatus(QString status);
- void signupEnableRegisterButton();
- void signupDisableRegisterButton();
- // Footer
- void log(QString logText);
- void footerSetStatus(QString status);
- // QML -> C++
- public slots:
- // Sending
- void onSendingSelectFileButton(QUrl url);
- void onSendingSendFileButton();
- void onSendingClearSelectionButton();
- // Receiving
- void onReceivingListFilesButton();
- void onReceivingDownloadFileButton(QString fileName);
- // Messages
- void onMessagesSendButton(QString msg);
- // Settings
- void onSettingsDeleteMeButton();
- // Ip Popup
- void onIpPopupConnectButton(QString ip);
- // Login
- void onLoginLoginButton(QString username, QString password);
- // Signup
- void onSignupRegisterButton(QString username, QString passwordOne, QString passwordTwo);
- // Footer
- void onFooterGetStatusButton();
- };
- #endif // QMLHANDLER_H
|