i2pd/android/jni/DaemonAndroid.h

88 lines
1.3 KiB
C
Raw Normal View History

2016-07-09 23:54:11 +03:00
#ifndef DAEMON_ANDROID_H
#define DAEMON_ANDROID_H
2016-07-10 04:42:42 +03:00
#include <string>
2016-07-09 23:54:11 +03:00
namespace i2p
{
namespace android
{
class DaemonAndroidImpl
{
public:
2016-07-09 23:54:11 +03:00
DaemonAndroidImpl ();
~DaemonAndroidImpl ();
//typedef void (*runningChangedCallback)();
/**
* @return success
*/
bool init(int argc, char* argv[]);
void start();
void stop();
void restart();
//void setRunningCallback(runningChangedCallback cb);
//bool isRunning();
private:
//void setRunning(bool running);
2016-07-09 23:54:11 +03:00
private:
//QMutex* mutex;
//bool m_IsRunning;
2016-07-10 04:42:42 +03:00
//runningChangedCallback m_RunningChangedCallback;
};
2016-07-09 23:54:11 +03:00
/**
2016-07-10 04:42:42 +03:00
* returns "ok" if daemon init failed
* returns errinfo if daemon initialized and started okay
2016-07-09 23:54:11 +03:00
*/
std::string start();
2016-07-09 23:54:11 +03:00
// stops the daemon
void stop();
2016-07-09 23:54:11 +03:00
/*
2016-07-09 23:54:11 +03:00
class Worker : public QObject
{
Q_OBJECT
2016-07-09 23:54:11 +03:00
public:
Worker (DaemonAndroidImpl& daemon);
private:
DaemonAndroidImpl& m_Daemon;
public slots:
void startDaemon();
void restartDaemon();
void stopDaemon();
signals:
void resultReady();
};
class Controller : public QObject
{
Q_OBJECT
QThread workerThread;
public:
Controller(DaemonAndroidImpl& daemon);
~Controller();
2016-07-09 23:54:11 +03:00
private:
DaemonAndroidImpl& m_Daemon;
public slots:
void handleResults(){}
signals:
void startDaemon();
void stopDaemon();
void restartDaemon();
};
*/
2016-07-09 23:54:11 +03:00
}
}
#endif // DAEMON_ANDROID_H