#include "abstractcommand.h"
+namespace AniDBUdpClient {
+
AbstractCommand::AbstractCommand(QObject *parent) : QObject(parent)
{
m_replyCode = UNKNOWN_REPLY;
{
return m_replyCode;
}
+
+} // namespace AniDBUdpClient
#include <QPair>
#include <QVariantMap>
+
+namespace AniDBUdpClient {
+
class AniDBUdpClient;
typedef QPair<QString, QVariantMap> Command;
ReplyCode m_replyCode;
};
+} // namespace AniDBUdpClient
+
#include <QScriptEngine>
-Q_SCRIPT_DECLARE_QMETAOBJECT(AbstractCommand, QObject*);
+Q_SCRIPT_DECLARE_QMETAOBJECT(AniDBUdpClient::AbstractCommand, QObject*);
#endif // ABSTRACTCOMMAND_H
#include <QUdpSocket>
#include <QTimer>
-#include <rawcommand.h>
-#include <logoutcommand.h>
-#include <uptimecommand.h>
+#include "rawcommand.h"
+#include "logoutcommand.h"
+#include "uptimecommand.h"
#include <QtDebug>
+namespace AniDBUdpClient {
+
const QByteArray AniDBUdpClient::clientName = CLIENT_NAME;
const int AniDBUdpClient::clientVersion = CLIENT_VERSION;
const int AniDBUdpClient::protocolVersion = PROTOCOL_VERSION;
m_floodInterval = interval * 1000;
}
-AniDBUdpClient::IdlePolicy AniDBUdpClient::idlePolicy() const
+IdlePolicy AniDBUdpClient::idlePolicy() const
{
return m_idlePolicy;
}
m_idlePolicy = policy;
}
-AniDBUdpClient::Error AniDBUdpClient::error() const
+Error AniDBUdpClient::error() const
{
return m_error;
}
{
emit timeout(commandId);
}
+
+} // namespace AniDBUdpClient
#include <QHostInfo>
#include <QVariantMap>
+#include "anidbudpclient_global.h"
#include "authcommand.h"
class QtStateMachine;
class QtState;
class QtHistoryState;
-
class QUdpSocket;
class QTimer;
+namespace AniDBUdpClient {
+
class AbstractCommand;
class AuthCommand;
class LogoutCommand;
static const int clientVersion;
static const int protocolVersion;
- enum Error
- {
- NoError,
- BindError,
- HostLookupError,
- HostUnreachableError,
- AuthenticationError,
- BannedError,
- ServerError,
- UnknownError,
- };
-
- enum IdlePolicy
- {
- DoNothingIdlePolicy,
- LogoutIdlePolicy,
- ImmediateLogoutIdlePolicy,
- KeepAliveIdlePolicy,
- };
-
AniDBUdpClient(QObject *parent = 0);
virtual ~AniDBUdpClient();
void timerTimeout();
};
+} // namespace AniDBUdpClient
+
#include <QScriptEngine>
-Q_SCRIPT_DECLARE_QMETAOBJECT(AniDBUdpClient, QObject*);
+Q_SCRIPT_DECLARE_QMETAOBJECT(AniDBUdpClient::AniDBUdpClient, QObject*);
#endif // ANIDBUDPCLIENT_H
# define ANIDBUDPCLIENTSHARED_EXPORT Q_DECL_IMPORT
#endif
+namespace AniDBUdpClient
+{
+ enum Error
+ {
+ NoError,
+ BindError,
+ HostLookupError,
+ HostUnreachableError,
+ AuthenticationError,
+ BannedError,
+ ServerError,
+ UnknownError,
+ };
+
+ enum IdlePolicy
+ {
+ DoNothingIdlePolicy,
+ LogoutIdlePolicy,
+ ImmediateLogoutIdlePolicy,
+ KeepAliveIdlePolicy,
+ };
+}
+
#endif // ANIDBUDPCLIENT_GLOBAL_H
#include "anidbudpclient.h"
+namespace AniDBUdpClient {
+
AuthCommand::AuthCommand(QObject *parent) : AbstractCommand(parent)
{
m_compression = false;
emit replyReady(false);
}
}
+
+} // namespace AniDBUdpClient
#include "abstractcommand.h"
+namespace AniDBUdpClient {
+
class AuthCommand : public AbstractCommand
{
Q_OBJECT
Command rawCommand() const;
void setRawReply(ReplyCode replyCode, const QString &reply, AniDBUdpClient *client);
-
-
private:
QString m_user;
QString m_pass;
bool m_compression;
};
+} // namespace AniDBUdpClient
+
#endif // AUTHCOMMAND_H
#include "logoutcommand.h"
+namespace AniDBUdpClient {
+
LogoutCommand::LogoutCommand(QObject *parent) : AbstractCommand(parent)
{
}
return command;
}
+
+} // namespace AniDBUdpClient
#include "abstractcommand.h"
+namespace AniDBUdpClient {
+
class ANIDBUDPCLIENTSHARED_EXPORT LogoutCommand : public AbstractCommand
{
Q_OBJECT
Command rawCommand() const;
};
+} // namespace AniDBUdpClient
+
#endif // LOGOUTCOMMAND_H
#include "anidbudpclient.h"
+namespace AniDBUdpClient {
+
MylistAddCommand::MylistAddCommand(QString file, QObject *parent) : AbstractCommand(parent)
{
m_file = file;
qDebug() << "hashing... complete!";
return ed2k.result().toHex();
}
+
+} // namespace AniDBUdpClient
#ifndef MYLISTADDCOMMAND_H
#define MYLISTADDCOMMAND_H
-#include "anidbudpclient_global.h"
#include "abstractcommand.h"
#include <QFuture>
#include <QFutureWatcher>
+namespace AniDBUdpClient {
class ANIDBUDPCLIENTSHARED_EXPORT MylistAddCommand : public AbstractCommand
{
static const qint64 ED2K_PART_SIZE = 9728000;
};
+} // namespace AniDBUdpClient
+
#endif // MYLISTADDCOMMAND_H
#include <QStringList>
+namespace AniDBUdpClient {
+
MyListCommand::MyListCommand(QObject *parent) : AbstractCommand(parent)
{
init();
m_state = State(0);
m_fileState = FileState(0);
}
+
+} // namespace AniDBUdpClient
#ifndef MYLISTCOMMAND_H
#define MYLISTCOMMAND_H
+#include "abstractcommand.h"
+
#include <QDateTime>
#include <QStringList>
-#include "abstractcommand.h"
+namespace AniDBUdpClient {
class ANIDBUDPCLIENTSHARED_EXPORT MyListCommand : public AbstractCommand
{
Q_PROPERTY(FileState fileState READ fileState);
Q_PROPERTY(QStringList multipleEntries READ multipleEntries);
+
public:
MyListCommand(QObject *parent = 0);
MyListCommand(int lid, QObject *parent = 0);
};
+} // namespace AniDBUdpClient
#include <QScriptEngine>
-Q_SCRIPT_DECLARE_QMETAOBJECT(MyListCommand, QObject*);
+Q_SCRIPT_DECLARE_QMETAOBJECT(AniDBUdpClient::MyListCommand, QObject*);
#endif // MYLISTCOMMAND_H
#include "rawcommand.h"
+namespace AniDBUdpClient {
+
RawCommand::RawCommand(const QString &command, QObject *parent) : AbstractCommand(parent)
{
m_command = command;
{
return Command(m_command, QVariantMap());
}
+
+} // namespace AniDBUdpClient
#ifndef RAWCOMMAND_H
#define RAWCOMMAND_H
-#include "anidbudpclient_global.h"
#include "abstractcommand.h"
+namespace AniDBUdpClient {
+
class ANIDBUDPCLIENTSHARED_EXPORT RawCommand : public AbstractCommand
{
Q_OBJECT
public:
-
RawCommand(const QString &command, QObject *parent = 0);
Command rawCommand() const;
+
private:
QString m_command;
};
+} // namespace AniDBUdpClient
+
#endif // RAWCOMMAND_H
#include "uptimecommand.h"
+namespace AniDBUdpClient {
+
UptimeCommand::UptimeCommand(QObject *parent) : AbstractCommand(parent)
{
m_uptime = 0;
break;
}
}
+
+} // namespace AniDBUdpClient
#include "abstractcommand.h"
+namespace AniDBUdpClient {
+
class ANIDBUDPCLIENTSHARED_EXPORT UptimeCommand : public AbstractCommand
{
Q_OBJECT
int m_uptime;
};
+} // namespace AniDBUdpClient
+
#include <QScriptEngine>
-Q_SCRIPT_DECLARE_QMETAOBJECT(UptimeCommand, QObject*);
+Q_SCRIPT_DECLARE_QMETAOBJECT(AniDBUdpClient::UptimeCommand, QObject*);
#endif // UPTIMECOMMAND_H