NDEVR
API Documentation
OWLFileManager.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2020, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVRServerInterface
28File: OWLFileManager
29Included in API: True
30Author(s): tyler.parke
31 *-----------------------------------------------------------------------------------------**/
32
33#pragma once
34#include <NDEVR/ServerPermission.h>
35#include <NDEVR/DesignObjectLookup.h>
36#include <QWidget>
37namespace Ui
38{
39 class OWLFileManagerUI;
40}
41namespace NDEVR
42{
44 class UUID;
46 class OWLLinkDisplay;
47 struct PopupInfo;
53 class OWLFileManager : public QWidget
54 {
55 Q_OBJECT
56 public:
62 OWLFileManager(DesignObjectLookup* lookup, OWLClientInterface* server, QWidget* parent = nullptr);
70 void downloadURL(const StringView& url);
72 void refresh();
76 std::pair<ServerPermission, ServerResourceInfo> getSelectedResourceInfo() const;
77 signals:
88 protected slots:
93 private:
95 void init();
99 void openSelectedContent(bool import_content);
101 void deleteSelection();
103 void openLinks();
107 void saveAsFile(PopupInfo info);
109 void openVersions();
111 void finishOpen();
115 void onResourceDataReceived(const Buffer<ServerResourceInfo>& data);
119 void onVersionDataReceived(const Buffer<ServerResourceInfo>& data);
123 void onPermissionDataReceived(const Buffer<ServerPermission>& data);
124 private:
125 DesignObjectLookup* m_lookup = nullptr;
126 OWLClientInterface* m_server_actions = nullptr;
127 Ui::OWLFileManagerUI* ui = nullptr;
128 Buffer<ServerResourceInfo> m_owl_files;
129 Buffer<ServerResourceInfo> m_resource_versions;
130 Buffer<ServerPermission> m_permissions;
131 ServerResourceInfo m_activated_resource;
132 OWLLinkDisplay* m_link_display = nullptr;
133 FileChooserDialog* m_file_chooser_dialog = nullptr;
134 bool m_requested_file = false;
135 };
136}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A core class where all Design Objects including models, materials, and geometries are stored.
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
High-level OWL server client that combines WebSocket communication with file transfer,...
void finishedOpenSignal()
Emitted when a file has been opened successfully.
std::pair< ServerPermission, ServerResourceInfo > getSelectedResourceInfo() const
Returns the permission and resource info for the currently selected item.
void setConnectionID(UUID id)
Sets the connection ID to browse files on.
void onOWLSelectionChanged()
Handles selection changes in the OWL file list.
void refresh()
Refreshes the file list from the server.
void finishedSignal()
Emitted when the file manager workflow has completed.
void requestManageServers()
Emitted when the user requests to manage server connections.
void onContentSelectionChanged()
Handles selection changes in the content/version list.
OWLFileManager(DesignObjectLookup *lookup, OWLClientInterface *server, QWidget *parent=nullptr)
Constructs the file manager.
void requestManageOWLLink(sint04 link_id)
Emitted when the user requests to manage a share link.
void downloadURL(const StringView &url)
Downloads a file from the specified OWL URL.
Widget that displays an OWL share link and allows saving the linked file.
The core String View class for the NDEVR API.
Definition StringView.h:58
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
int32_t sint04
-Defines an alias representing a 4 byte, signed integer.
Class which is used to pass arguments and requests for creating a popup dialog or widget.
Definition PopupInfo.h:16
Metadata for a server-hosted resource including type, timestamps, size, and cached data.