Mon, 11 Nov 2024 20:45:34 +0100
fix text/image preview loading
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 | |
e324291ca9f8
add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
46
diff
changeset
|
44 | |
15
78684a24dc52
implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
11
diff
changeset
|
45 | |
8
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | DavBrowser* davbrowser_create(UiObject *toplevel); |
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | |
56
294d5515583a
add authentication dialog
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
54
diff
changeset
|
48 | int jobthr_davbrowser_auth(DavSession *sn, void *data); |
294d5515583a
add authentication dialog
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
54
diff
changeset
|
49 | 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
|
50 | |
8
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | void davbrowser_set_collection(UiObject *ui, DavBrowser *browser, DavResource *collection); |
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | |
16
f2e79b69d233
switch DavSession in davbrowser_query_url when a different server is specified
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
15
diff
changeset
|
53 | void 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
|
54 | |
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | 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
|
56 | |
11
26acbfa75c1f
add handler for the path bar activate events
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
8
diff
changeset
|
57 | 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
|
58 | |
53
da05df77652e
add menu items to open resource properties
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
51
diff
changeset
|
59 | 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
|
60 | |
15
78684a24dc52
implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
11
diff
changeset
|
61 | 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
|
62 | |
68 | 63 | 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
|
64 | void davbrowser_navigation_back(UiObject *ui, DavBrowser *browser); |
78684a24dc52
implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
11
diff
changeset
|
65 | void davbrowser_navigation_forward(UiObject *ui, DavBrowser *browser); |
78684a24dc52
implement navigation back/forward buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
11
diff
changeset
|
66 | |
18
af411868ab9b
implement dnd upload (without progressbar)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
16
diff
changeset
|
67 | 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
|
68 | |
29
3fc287f06305
add minimal working download
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
28
diff
changeset
|
69 | 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
|
70 | |
26
40d6af793c1a
implement resource deletion
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
18
diff
changeset
|
71 | void davbrowser_delete(UiObject *ui, DavBrowser *browser, UiListSelection selection); |
8
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | |
46
31bc86844659
implement action_newfile
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
29
diff
changeset
|
73 | 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
|
74 | |
28
1ecc1183f046
implement new-collection toolbar button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
26
diff
changeset
|
75 | 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
|
76 | 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
|
77 | |
51
e324291ca9f8
add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
46
diff
changeset
|
78 | |
e324291ca9f8
add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
46
diff
changeset
|
79 | 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
|
80 | |
e324291ca9f8
add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
46
diff
changeset
|
81 | void dav_resourceviewer_load(UiObject *ui, DavResourceViewer *res); |
e324291ca9f8
add resource preview window
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
46
diff
changeset
|
82 | |
54
3ca3acefc66a
add resourceviewer cleanup
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
53
diff
changeset
|
83 | void dav_resourceviewer_destroy(DavResourceViewer *res); |
3ca3acefc66a
add resourceviewer cleanup
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
53
diff
changeset
|
84 | |
8
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | #ifdef __cplusplus |
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | } |
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | #endif |
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | |
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89 | #endif /* IDAV_DAV_CONTROLLER_H */ |
726b24766437
implement connecting to repositories
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 |