18 #ifndef NURIA_HTTPNODE_HPP
19 #define NURIA_HTTPNODE_HPP
21 #include "network_global.hpp"
22 #include "httpclient.hpp"
23 #include "callback.hpp"
24 #include <QSharedData>
30 class HttpNodePrivate;
31 class SlotInfoPrivate;
43 SlotInfo (
const Callback &callback = Callback ());
55 bool isValid ()
const;
58 Callback callback ()
const;
70 bool streamPostBody ()
const;
73 void setStreamPostBody (
bool value);
79 HttpClient::HttpVerbs allowedVerbs ()
const;
82 void setAllowedVerbs (HttpClient::HttpVerbs verbs);
88 qint64 maxBodyLength ()
const;
91 void setMaxBodyLength (qint64 length);
98 bool forceEncrypted ()
const;
101 void setForceEncrypted (
bool force);
107 QSharedDataPointer< SlotInfoPrivate > d;
112 typedef QList< HttpNode * > HttpNodeList;
140 class NURIA_NETWORK_EXPORT
HttpNode :
public QObject {
151 NoStaticResources = 0,
158 UseStaticResources = 1,
164 UseNestedStaticResources = 2
186 bool isChild ()
const;
212 SlotInfo connectSlot (
const QString &name,
const Callback &callback);
232 SlotInfo connectSlot (
const QString &name, QObject *receiver,
const char *slot);
238 bool disconnectSlot (
const QString &name);
252 const QString &resourceName ()
const;
257 const QDir &staticResourceDir ()
const;
262 StaticResourcesMode staticResourceMode ()
const;
269 bool setResourceName (
const QString &name);
280 void setStaticResourceDir (QDir path);
286 void setStaticResourceMode (StaticResourcesMode mode);
291 bool hasNode (
const QString &name);
296 bool hasSlot (
const QString &name);
302 HttpNode *findNode (
const QString &name)
const;
340 virtual bool invokePath (
const QString &path,
const QStringList &parts,
368 virtual bool allowAccessToClient (
const QString &path,
const QStringList &parts,
379 virtual bool callSlotByName (
const QString &name,
HttpClient *client);
389 bool sendStaticResource (
const QString &name,
HttpClient *client);
392 bool sendStaticResource (
const QStringList &path,
int indexInPath,
406 HttpNodePrivate *d_ptr;
411 #endif // NURIA_HTTPNODE_HPP
The HttpServer class provides a simple HTTP server. This server is directed at providing interactive ...
Definition: httpserver.hpp:40
The HttpClient class represents a connection to a client.
Definition: httpclient.hpp:92
Definition: httpnode.hpp:39
The HttpNode class represents a virtual directory (or a virtual file) HttpServer uses these nodes to ...
Definition: httpnode.hpp:140
StaticResourcesMode
Definition: httpnode.hpp:148