1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * plugin-downloader.h: Plugin downloader
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
14 #ifndef __PLUGIN_DOWNLOADER_H__
15 #define __PLUGIN_DOWNLOADER_H__
17 class PluginDownloader
;
19 #include "moonlight.h"
21 #include "downloader.h"
23 #include "plugin-class.h"
28 guint32
plugin_downloader_started (DownloaderResponse
*response
, gpointer state
);
29 guint32
plugin_downloader_available (DownloaderResponse
*response
, gpointer state
, char *buffer
, guint32 length
);
30 guint32
plugin_downloader_finished (DownloaderResponse
*response
, gpointer state
, gpointer data
);
34 class PluginDownloader
{
36 DownloaderResponse
*response
;
37 DownloaderRequest
*request
;
38 DownloaderResponseHeaderCallback response_header_callback
;
39 gpointer response_header_context
;
48 PluginDownloader (Downloader
*dl
);
49 virtual ~PluginDownloader ();
52 void Open (const char *verb
, const char *uri
, bool custom_header_support
, bool disable_cache
);
55 guint32
Read (char *buffer
, guint32 length
);
57 void Finished (bool success
, gpointer data
, const char *uri
);
59 void SetHttpHeader (const char *header
, const char *value
);
60 void SetBody (void *body
, guint32 length
);
62 void SetResponseHeaderCallback (DownloaderResponseHeaderCallback callback
, gpointer context
);
64 PluginInstance
*GetPlugin ();
66 void setResponse (DownloaderResponse
*response
);
67 DownloaderResponse
*getResponse () { return response
; }
68 DownloaderRequest
*getRequest ();
73 void npstream_request_set_stream_data (Downloader
*downloader
, NPP npp
, NPStream
*stream
);
74 void downloader_initialize (void);
75 void downloader_destroy (void);
77 #endif // __PLUGIN_DOWNLOADER_H__