#ifndef QTSINGLEAPPLICATION_H
#define QTSINGLEAPPLICATION_H

#include <QObject>
#include <QTranslator>
#include <QStringList>

class QtSingleApplication : public QObject
{
    Q_OBJECT
public:
    QtSingleApplication(const QString &id, int &argc, char **argv);

    bool isRunning() const;
    bool sendMessage(const QString &message, int timeout = 5000);

    static QStringList arguments();
    static int exec();
    static void installTranslator(QTranslator *translator);

    static void reset();
    static void setRunning(bool running);
    static void setExecResult(int result);
    static QString lastId();
    static QString lastMessage();
    static int execCallCount();
    static int translatorInstallCount();

Q_SIGNALS:
    void messageReceived(const QString &message);
};

#endif
