~ubuntu-branches/ubuntu/trusty/moon/trusty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * downloader.h: Downloader class.
 *
 * Contact:
 *   Moonlight List (moonlight-list@lists.ximian.com)
 *
 * Copyright 2008 Novell, Inc. (http://www.novell.com)
 *
 * See the LICENSE file included with the distribution for details.
 * 
 */

#ifndef __INTERNAL_DOWNLOADER_H__
#define __INTERNAL_DOWNLOADER_H__

#include <stdint.h>

class Downloader;

class InternalDownloader {
 public:
 	enum DownloaderType {
	 	MmsDownloader,
	 	FileDownloader,
 	};
 protected:
	Downloader *dl;

 public:
	InternalDownloader (Downloader *dl)
	{
		this->dl = dl;
	}

	virtual ~InternalDownloader ()
	{
	}

	virtual void Open (const char *verb, const char *uri) = 0;
	virtual void Write (void *buf, gint32 offset, gint32 n) = 0;
	virtual char *GetResponseText (const char *partname, guint64 *size) = 0; 
	virtual char *GetDownloadedFilename (const char *partname) = 0;
	virtual DownloaderType GetType () = 0;
};

#endif