application/davcontroller.h

Wed, 27 Nov 2024 13:27:30 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 27 Nov 2024 13:27:30 +0100
changeset 90
f501f0efc9a8
parent 89
2fbb3cac05a5
child 91
7ee944cf53de
permissions
-rw-r--r--

implement gtk dnd

8
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2024 Olaf Wintermann. All rights reserved.
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #ifndef IDAV_DAV_CONTROLLER_H
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #define IDAV_DAV_CONTROLLER_H
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include <ui/ui.h>
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 #include <libidav/webdav.h>
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 #include <libidav/config.h>
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 #include "application.h"
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 #ifdef __cplusplus
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 extern "C" {
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 #endif
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41
15
78684a24dc52 implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 11
diff changeset
42 #define DAVBROWSER_MAX_NAVLIST 128
51
e324291ca9f8 add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
43
87
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
44 typedef struct TransferProgress {
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
45 size_t total_bytes;
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
46 size_t total_files;
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
47 size_t total_directories;
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
48 size_t transferred_bytes;
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
49 size_t transferred_files;
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
50 size_t transferred_directories;
51
e324291ca9f8 add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
51
87
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
52 size_t current_file_size;
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
53 size_t current_file_transferred;
5360027fb282 download/upload refactoring, add cancel button, resolves #498 fixes #506
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 85
diff changeset
54 } TransferProgress;
15
78684a24dc52 implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 11
diff changeset
55
8
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 DavBrowser* davbrowser_create(UiObject *toplevel);
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57
56
294d5515583a add authentication dialog
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
58 int jobthr_davbrowser_auth(DavSession *sn, void *data);
294d5515583a add authentication dialog
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
59 void davbrowser_auth_set_user_pwd(SessionAuthData *auth, const char *user, const char *password);
294d5515583a add authentication dialog
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
60
8
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 void davbrowser_set_collection(UiObject *ui, DavBrowser *browser, DavResource *collection);
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62
85
44ebbb4c8a13 add support for secret store credentials when connecting to repositories, resolves #496
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
63 int davbrowser_connect2repo(UiObject *ui, DavBrowser *browser, DavCfgRepository *repo, const char *path);
8
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 void davbrowser_query_path(UiObject *ui, DavBrowser *browser, const char *path);
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66
11
26acbfa75c1f add handler for the path bar activate events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 8
diff changeset
67 void davbrowser_query_url(UiObject *ui, DavBrowser *browser, const char *url);
8
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68
53
da05df77652e add menu items to open resource properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
69 void davbrowser_open_resource(UiObject *ui, DavBrowser *browser, DavResource *res, const char *contenttype);
51
e324291ca9f8 add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
70
15
78684a24dc52 implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 11
diff changeset
71 void davbrowser_add2navstack(DavBrowser *browser, const char *base, const char *path);
78684a24dc52 implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 11
diff changeset
72
68
79a9aadf1c70 add main menu
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 56
diff changeset
73 void davbrowser_navigation_parent(UiObject *ui, DavBrowser *browser);
15
78684a24dc52 implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 11
diff changeset
74 void davbrowser_navigation_back(UiObject *ui, DavBrowser *browser);
78684a24dc52 implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 11
diff changeset
75 void davbrowser_navigation_forward(UiObject *ui, DavBrowser *browser);
78684a24dc52 implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 11
diff changeset
76
18
af411868ab9b implement dnd upload (without progressbar)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
77 void davbrowser_upload_files(UiObject *ui, DavBrowser *browser, UiFileList files);
af411868ab9b implement dnd upload (without progressbar)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
78
29
3fc287f06305 add minimal working download
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 28
diff changeset
79 void davbrowser_download(UiObject *ui, DavBrowser *browser, DavResource *reslist, const char *local_path);
3fc287f06305 add minimal working download
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 28
diff changeset
80
26
40d6af793c1a implement resource deletion
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 18
diff changeset
81 void davbrowser_delete(UiObject *ui, DavBrowser *browser, UiListSelection selection);
8
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82
46
31bc86844659 implement action_newfile
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
83 void davbrowser_create_resource(UiObject *ui, DavBrowser *browser, const char *name, DavBool iscollection);
31bc86844659 implement action_newfile
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
84
28
1ecc1183f046 implement new-collection toolbar button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 26
diff changeset
85 void davbrowser_mkcol(UiObject *ui, DavBrowser *browser, const char *name);
46
31bc86844659 implement action_newfile
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
86 void davbrowser_newfile(UiObject *ui, DavBrowser *browser, const char *name);
28
1ecc1183f046 implement new-collection toolbar button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 26
diff changeset
87
89
2fbb3cac05a5 implement rename
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 87
diff changeset
88 void davbrowser_rename(UiObject *ui, DavBrowser *browser, UiListSelection selection);
2fbb3cac05a5 implement rename
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 87
diff changeset
89
51
e324291ca9f8 add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
90
e324291ca9f8 add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
91 DavResourceViewer* dav_resourceviewer_create(DavSession *sn, const char *path, DavResourceViewType type);
e324291ca9f8 add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
92
e324291ca9f8 add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
93 void dav_resourceviewer_load(UiObject *ui, DavResourceViewer *res);
e324291ca9f8 add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
94
78
ad7ced6cf00b implement resourceviewer textfile save button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 68
diff changeset
95 void dav_resourceviewer_save(UiObject *ui, DavResourceViewer *res);
ad7ced6cf00b implement resourceviewer textfile save button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 68
diff changeset
96
54
3ca3acefc66a add resourceviewer cleanup
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
97 void dav_resourceviewer_destroy(DavResourceViewer *res);
3ca3acefc66a add resourceviewer cleanup
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
98
8
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 #ifdef __cplusplus
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 }
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 #endif
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 #endif /* IDAV_DAV_CONTROLLER_H */
726b24766437 implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104

mercurial