OpenCPN Partial API docs
Loading...
Searching...
No Matches
download_mgr.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2019 Alec Leamas *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef DOWNLOAD_MGR_H__
25#define DOWNLOAD_MGR_H__
26
27#include <wx/dialog.h>
28#include <wx/progdlg.h>
29#include <wx/window.h>
30
31#include "model/downloader.h"
33
34// Accepted by PluginDownloadDialog, reloads plugin list.
35wxDECLARE_EVENT(EVT_PLUGINS_RELOAD, wxCommandEvent);
36
40class PluginDownloadDialog : public wxDialog {
41public:
42 PluginDownloadDialog(wxWindow* parent);
43
44 wxWindow* GetRealParent() { return m_parent; }
45};
46
50class GuiDownloader : public Downloader {
51private:
52 long m_downloaded;
53 wxProgressDialog* m_dialog;
54 PluginMetadata m_plugin;
55 wxWindow* m_parent;
56
57public:
58 GuiDownloader(wxWindow* parent, PluginMetadata plugin);
59 std::string run(wxWindow* parent, bool remove_current);
60 void on_chunk(const char* buff, unsigned bytes) override;
61 void showErrorDialog(const char* msg);
62};
63
64#endif // DOWNLOAD_MGR_H__
Datatypes and methods to parse ocpn-plugins.xml XML data, either complete catalog or a single plugin.
Default downloader, usable in a CLI context.
Definition downloader.h:35
Downloader with progress and final message dialogs.
void on_chunk(const char *buff, unsigned bytes) override
Called when given bytes has been transferred from remote.
Dialog for downloading plugins.
Handle downloading of files from remote urls.
Plugin metadata, reflects the xml format directly.