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))