• SDKConnection
  • SDKConnection Class

    class ScreenPlay::SDKConnection

    Contains 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

    void close()
    void readyRead()
    void 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] void 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:

    1. ping: Used to check if wallpaper is still alive
    2. appID: First message of an app must contain the ID to match it to our list of running apps
    3. command: Used mainly for requestRaise. This will get fired if the user tries to open a second ScreenPlay instance
    4. general Json object

    [slot] void SDKConnection::sendMessage(const QByteArray &message)

    Sends a message to the connected socket.