SDKConnection Class
class ScreenPlay::SDKConnectionContains all connections to Wallpaper and Widgets. More...
Header: | #include <SDKConnection> |
Public Functions
SDKConnection(QLocalSocket *socket, QObject *parent = nullptr) | |
QString | appID() const |
QVector<int> | monitor() const |
QString | type() const |
Public Slots
bool | close() |
void | readyRead() |
bool | sendMessage(const QByteArray &message) |
void | setAppID(QString appID) |
void | setMonitor(QVector<int> monitor) |
void | setType(QString type) |
Signals
void | appIDChanged(QString appID) |
void | monitorChanged(QVector<int> monitor) |
void | typeChanged(QString type) |
Detailed Description
Member Function Documentation
SDKConnection::SDKConnection(QLocalSocket *socket, QObject *parent = nullptr)
Constructor.
[slot]
bool SDKConnection::close()
Closes the socket connection. Before it explicitly sends a quit command to make sure the wallpaper closes (fast). This also requestDecreaseWidgetCount() because Widgets.
[slot]
void SDKConnection::readyRead()
Read incomming messages. Checks for types like:
- ping: Used to check if wallpaper is still alive
- appID: First message of an app must contain the ID to match it to our list of running apps
- command: Used mainly for requestRaise. This will get fired if the user tries to open a second ScreenPlay instance
- general Json object
[slot]
bool SDKConnection::sendMessage(const QByteArray &message)
Sends a message to the connected socket.