18 #define GET_AND_CALL(type, func, res) \
19 type obj = qscriptvalue_cast<type>(thisObject()); \
23 #define MERGE2(result, errmsg) \
24 QVariant(QList<QVariant>() << result << errmsg);
26 #define DEF_TYPE0(type, retType, func, call) \
28 type##Prototype::func \
30 type *obj = qscriptvalue_cast<type *>(thisObject()); \
35 #define DEF_TYPE1(type, resType, func, call) \
37 type##Prototype::func \
42 type *obj = qscriptvalue_cast<type *>(thisObject()); \
45 QList<QVariant> vals; \
46 vals << res << QVariant(errmsg); \
51 #define DEF_TYPE2(type, resType, ansType, func, call) \
53 type##Prototype::func \
59 type *obj = qscriptvalue_cast<type *>(thisObject()); \
62 QList<QVariant> vals; \
63 vals << QVariant(ans) << res << QVariant(errmsg); \
69 : QObject(), QScriptable() {}
73 return qMetaTypeId<TorControl *>();
78 return QString(
"TorControl");
82 start(
const QString &tor,
const QStringList &args),
95 isVidaliaRunningTor())
102 connect(const QHostAddress &address, quint16 port),
150 isCircuitEstablished())
153 getInfo(QHash<QString,QString> &map),
198 TorControl *obj = qscriptvalue_cast<TorControl *>(thisObject());
206 getSocksPort(&errmsg))
219 getTorVersionString(),
220 getTorVersionString())
235 setConf(QHash<QString,QString> map),
239 setConf(QString key, QString value),
254 TorControl *obj = qscriptvalue_cast<TorControl *>(thisObject());
257 return obj->
getConf(map, errmsg);
267 return obj->
getConf(map, errmsg);
271 getConf(QString key),
272 getConf(key, ans, &errmsg))
281 return obj->
getConf(key, value, errmsg);
291 return obj->
getConf(keys, errmsg);
305 getHiddenServiceConf(
const QString &key),
306 getHiddenServiceConf(key, &errmsg))
316 TorControl *obj = qscriptvalue_cast<TorControl *>(thisObject());
323 resetConf(QString key),
324 resetConf(key, &errmsg))
407 ipToCountry(
const QHostAddress &ip),
408 ipToCountry(ip, &errmsg))
bool getConf(QHash< QString, QString > &map, QString *errmsg=0)
QList< quint16 > getSocksPortList(QString *errmsg=0)
Q_INVOKABLE CircuitList getCircuits(QString *errmsg=0)
bool closeStream(const StreamId &streamId, QString *errmsg=0)
StreamList getStreams(QString *errmsg=0)
NetworkStatus getNetworkStatus(QString *errmsg=0)
Q_INVOKABLE NetworkStatus getNetworkStatus(QString *errmsg=0)
#define DEF_TYPE2(type, resType, ansType, func, call)
setEvent(TorEvents::Event e, bool add, bool set)
stop errmsg closeTorStdout()
QStringList getRouterDescriptorText(const QString &id, QString *errmsg=0)
#define DEF_TYPE1(type, resType, func, call)
bool closeStream(const StreamId &streamId, QString *errmsg=0)
AddressMap getAddressMap(AddressMap::AddressMapType type=AddressMap::AddressMapAll, QString *errmsg=0)
QList< Stream > StreamList
Q_INVOKABLE RouterStatus getRouterStatus(const QString &id, QString *errmsg=0)
stop errmsg getInfo(QHash< QString, QString > &map)
bool closeCircuit(const CircuitId &circId, bool ifUnused=false, QString *errmsg=0)
DescriptorAnnotations getDescriptorAnnotations(const QString &id, QString *errmsg=0)
RouterDescriptor getRouterDescriptor(const QString &id, QString *errmsg=0)
RouterStatus getRouterStatus(const QString &id, QString *errmsg=0)
Q_INVOKABLE RouterDescriptor getRouterDescriptor(const QString &id, QString *errmsg=0)
stop errmsg signal(TorSignal::Signal sig)
stop errmsg connect(const QHostAddress &address, quint16 port)
QStringList getSocksAddressList(QString *errmsg=0)
stop errmsg isVidaliaRunningTor()
stop errmsg authenticate(const QByteArray cookie)
stop errmsg isCircuitEstablished()
QList< Circuit > CircuitList
CircuitList getCircuits(QString *errmsg=0)
bool resetConf(QStringList keys, QString *errmsg=0)
QHash< QString, QString > DescriptorAnnotations
Q_INVOKABLE StreamList getStreams(QString *errmsg=0)
Q_INVOKABLE DescriptorAnnotations getDescriptorAnnotations(const QString &id, QString *errmsg=0)
setEvents errmsg setConf(QString key, QString value)
QList< RouterStatus > NetworkStatus
#define DEF_TYPE0(type, retType, func, call)
Q_INVOKABLE bool getConf(QHash< QString, QString > &map, QString *errmsg)
stop errmsg isConnected()
Q_INVOKABLE AddressMap getAddressMap(AddressMap::AddressMapType type=AddressMap::AddressMapAll, QString *errmsg=0)