123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #ifndef QMLHANDLER_H
- #define QMLHANDLER_H
- #include <QDebug>
- #include <QObject>
- #include <QUrl>
- #include <string>
- class QMLHandler : public QObject {
- Q_OBJECT
- private:
- void handleJSON(std::string buffer);
- void readPipeLoop();
- 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);
- // Messages
- void message(QString msg);
- // Settings
- void settingsOpenSwitchServerPopup();
- // Ip Popup
- // Switch Popup
- // 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 onReceivingGetFileButton(QString fileName);
- // Messages
- void onMessagesSendButton(QString msg);
- // Settings
- void onSettingsSwitchServerButton();
- // Ip Popup
- void onIpPopupEnterIp(QString ip);
- // Switch Popup
- void onSwitchPopupEnterIp(QString ip);
- // Footer
- void onFooterGetStatusButton();
- };
- #endif // QMLHANDLER_H
|