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 #ifndef IDAV_DAV_CONTROLLER_H
30 #define IDAV_DAV_CONTROLLER_H
31
32 #include <ui/ui.h>
33 #include <libidav/webdav.h>
34 #include <libidav/config.h>
35
36 #include "application.h"
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 #define DAVBROWSER_MAX_NAVLIST 128
43
44 typedef struct TransferProgress {
45 size_t total_bytes;
46 size_t total_files;
47 size_t total_directories;
48 size_t transferred_bytes;
49 size_t transferred_files;
50 size_t transferred_directories;
51
52 size_t current_file_size;
53 size_t current_file_transferred;
54
55 time_t speedtest_start;
56 size_t speedtest_bytes;
57 } TransferProgress;
58
59 DavBrowser* davbrowser_create(UiObject *toplevel);
60
61 int jobthr_davbrowser_auth(DavSession *sn,
void *data);
62 void davbrowser_auth_set_user_pwd(SessionAuthData *auth,
const char *user,
const char *password);
63
64 void davbrowser_set_collection(UiObject *ui, DavBrowser *browser, DavResource *collection);
65
66 int davbrowser_connect2repo(UiObject *ui, DavBrowser *browser, DavCfgRepository *repo,
const char *path);
67
68 void davbrowser_query_path(UiObject *ui, DavBrowser *browser,
const char *path);
69
70 void davbrowser_query_url(UiObject *ui, DavBrowser *browser,
const char *url);
71
72 void davbrowser_open_resource(UiObject *ui, DavBrowser *browser, DavResource *res,
const char *contenttype);
73
74 void davbrowser_add2navstack(DavBrowser *browser,
const char *base,
const char *path);
75
76 void davbrowser_navigation_parent(UiObject *ui, DavBrowser *browser);
77 void davbrowser_navigation_back(UiObject *ui, DavBrowser *browser);
78 void davbrowser_navigation_forward(UiObject *ui, DavBrowser *browser);
79
80 void davbrowser_upload_files(UiObject *ui, DavBrowser *browser, UiFileList files);
81
82 void davbrowser_download(UiObject *ui, DavBrowser *browser, DavResource *reslist,
const char *local_path);
83
84 void davbrowser_delete(UiObject *ui, DavBrowser *browser, UiListSelection selection);
85
86 void davbrowser_create_resource(UiObject *ui, DavBrowser *browser,
const char *name, DavBool iscollection);
87
88 void davbrowser_mkcol(UiObject *ui, DavBrowser *browser,
const char *name);
89 void davbrowser_newfile(UiObject *ui, DavBrowser *browser,
const char *name);
90
91 void davbrowser_rename(UiObject *ui, DavBrowser *browser, UiListSelection selection);
92
93
94 DavResourceViewer* dav_resourceviewer_create(UiObject *toplevel, DavSession *sn,
const char *path, DavResourceViewType type);
95
96 void dav_resourceviewer_load(UiObject *ui, DavResourceViewer *res);
97
98 void dav_resourceviewer_save(UiObject *ui, DavResourceViewer *res);
99
100 void dav_resourceviewer_destroy(DavResourceViewer *res);
101
102 void dav_resourceviewer_property_remove(DavResourceViewer *res, DavPropertyList *prop);
103 void dav_resourceviewer_property_update_text(DavResourceViewer *res, DavPropertyList *prop,
const char *text);
104 void dav_resourceviewer_property_update_xml(DavResourceViewer *res, DavPropertyList *prop, DavXmlNode *xml);
105 void dav_resourceviewer_property_add_text(DavResourceViewer *res,
const char *ns,
const char *name,
const char *text);
106 void dav_resourceviewer_property_add_xml(DavResourceViewer *res,
const char *ns,
const char *name,
const char *nsdef, DavXmlNode *xml);
107
108
109 uint64_t dav_transfer_speed(TransferProgress *progress,
time_t current);
110
111 #ifdef __cplusplus
112 }
113 #endif
114
115 #endif
116
117