2009-10-05 Chris Toshok <toshok@ximian.com>
[moon.git] / plugin / npstream-request.h
blobf0787f0d6cceecb41cc81ea40c5d8d41c9b75c63
1 /*
2 * npstream-downloader.h: NPStream Browser Request
4 * Contact:
5 * Moonlight List (moonlight-list@lists.ximian.com)
7 * Copyright 2008 Novell, Inc. (http://www.novell.com)
9 * See the LICENSE file included with the distribution for details.
13 #ifndef __NPSTREAM_DOWNLOADER_H
14 #define __NPSTREAM_DOWNLOADER_H
16 #include "moonlight.h"
17 #include "browser-bridge.h"
18 #include "plugin-downloader.h"
20 class NPStreamRequest : public DownloaderRequest {
21 private:
22 NPP npp;
23 NPStream *stream;
24 char *buffer;
25 PluginInstance *instance;
27 uint32_t offset;
29 public:
30 NPStreamRequest (const char *verb, const char *uri, PluginInstance *instance) : DownloaderRequest (verb, uri)
32 this->npp = NULL;
33 this->stream = NULL;
34 this->buffer = NULL;
35 this->offset = 0;
36 this->instance = instance;
39 virtual ~NPStreamRequest ()
41 g_free (buffer);
44 void Abort ();
45 bool GetResponse (DownloaderResponseStartedHandler started, DownloaderResponseDataAvailableHandler available, DownloaderResponseFinishedHandler finished, gpointer context);
46 const bool IsAborted () { return this->aborted; }
47 void SetHttpHeader (const char *name, const char *value);
48 void SetBody (void *body, int size);
50 void SetNPP (NPP npp) { this->npp = npp; }
51 void SetStream (NPStream *stream) { this->stream = stream; }
52 void StreamDestroyed () { stream = NULL; }
55 #endif