aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk_download-save-as.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk_download-save-as.h')
-rw-r--r--src/fs/gnunet-fs-gtk_download-save-as.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/src/fs/gnunet-fs-gtk_download-save-as.h b/src/fs/gnunet-fs-gtk_download-save-as.h
new file mode 100644
index 00000000..2196fcd8
--- /dev/null
+++ b/src/fs/gnunet-fs-gtk_download-save-as.h
@@ -0,0 +1,117 @@
1/*
2 This file is part of GNUnet.
3 (C) 2010 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/**
22 * @file src/fs/gnunet-fs-gtk_download-save-as.h
23 * @brief functions for downloading
24 * @author Christian Grothoff
25 */
26#ifndef GNUNET_FS_GTK_DOWNLOAD_SAVE_AS_H
27#define GNUNET_FS_GTK_DOWNLOAD_SAVE_AS_H
28
29#include "gnunet-fs-gtk-common.h"
30
31
32/**
33 * Information we keep for a download.
34 */
35struct DownloadContext;
36
37
38/**
39 * Information we keep for a download.
40 */
41struct DownloadContext
42{
43 /**
44 * URI for the download.
45 */
46 struct GNUNET_FS_Uri *uri;
47
48 /**
49 * Meta data.
50 */
51 struct GNUNET_CONTAINER_MetaData *meta;
52
53 /**
54 * Mime type.
55 */
56 char *mime;
57
58 /**
59 * Suggested filename, or NULL.
60 */
61 char *filename;
62
63 /**
64 * Row reference (if URI was found by search, or
65 * part of directory, etc.); otherwise NULL (download by URI).
66 */
67 GtkTreeRowReference *rr;
68
69 /**
70 * Associated search result, or NULL.
71 */
72 struct GNUNET_FS_SearchResult *sr;
73
74 /**
75 * Is this a recursive download?
76 */
77 int is_recursive;
78
79 /**
80 * Desired (default) anonymity level.
81 */
82 int anonymity;
83
84 /**
85 * Tab where this download is currently on display.
86 * (this is the same as sr->tab, but sr is opaque here).
87 */
88 struct SearchTab *tab;
89
90};
91
92
93/**
94 * Actually start the download that is specified by the given download
95 * context and its options. Will add a download entry to the
96 * respective tree model and trigger a start of the download using the
97 * FS-API.
98 *
99 * @param dc download context of the download to execute
100 */
101void
102GNUNET_FS_GTK_download_context_start_download (struct DownloadContext *dc);
103
104
105/**
106 * Open the 'save as' dialog for a download. Calls
107 * 'GNUNET_FS_GTK_download_context_start_download' when the dialog is
108 * complete. Will release the 'dc' resources if the dialog is
109 * cancelled.
110 *
111 * @param dc download context for the file/directory
112 */
113void
114GNUNET_FS_GTK_open_download_as_dialog (struct DownloadContext *dc);
115
116
117#endif