~ubuntu-branches/ubuntu/karmic/moon/karmic

« back to all changes in this revision

Viewing changes to plugin/npstream-request.h

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 /*
 
2
 * npstream-downloader.h: NPStream Browser Request
 
3
 *
 
4
 * Contact:
 
5
 *   Moonlight List (moonlight-list@lists.ximian.com)
 
6
 *
 
7
 * Copyright 2008 Novell, Inc. (http://www.novell.com)
 
8
 *
 
9
 * See the LICENSE file included with the distribution for details.
 
10
 *
 
11
 */
 
12
 
 
13
#ifndef __NPSTREAM_DOWNLOADER_H
 
14
#define __NPSTREAM_DOWNLOADER_H
 
15
 
 
16
#include "moonlight.h"
 
17
#include "browser-bridge.h"
 
18
#include "plugin-downloader.h"
 
19
 
 
20
class NPStreamRequest : public DownloaderRequest {
 
21
 private:
 
22
        NPP npp;
 
23
        NPStream *stream;
 
24
        char *buffer;
 
25
        PluginInstance *instance;
 
26
 
 
27
        uint32_t offset;
 
28
 
 
29
 public:
 
30
        NPStreamRequest (const char *verb, const char *uri, PluginInstance *instance) : DownloaderRequest (verb, uri)
 
31
        {
 
32
                this->npp = NULL;
 
33
                this->stream = NULL;
 
34
                this->buffer = NULL;
 
35
                this->offset = 0;
 
36
                this->instance = instance;
 
37
        }
 
38
 
 
39
        virtual ~NPStreamRequest ()
 
40
        {
 
41
                g_free (buffer);
 
42
        }
 
43
 
 
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);
 
49
        
 
50
        void SetNPP (NPP npp) { this->npp = npp; }
 
51
        void SetStream (NPStream *stream) { this->stream = stream; }
 
52
        void StreamDestroyed () { stream = NULL; }
 
53
};
 
54
 
 
55
#endif