|
OpenCPN Partial API docs
|
The PlugIn Class Definition. More...
#include <chartdldr_pi.h>
Public Member Functions | |
| chartdldr_pi (void *ppimgr) | |
| int | Init () override |
| Initialize the plugin and declare its capabilities. | |
| bool | DeInit () override |
| Clean up plugin resources. | |
| int | GetAPIVersionMajor () override |
| Returns the major version number of the plugin API that this plugin supports. | |
| int | GetAPIVersionMinor () override |
| Returns the minor version number of the plugin API that this plugin supports. | |
| int | GetPlugInVersionMajor () override |
| Returns the major version number of the plugin itself. | |
| int | GetPlugInVersionMinor () override |
| Returns the minor version number of the plugin itself. | |
| wxBitmap * | GetPlugInBitmap () override |
| Get the plugin's icon bitmap. | |
| wxString | GetCommonName () override |
| Get the plugin's common (short) name. | |
| wxString | GetShortDescription () override |
| Get a brief description of the plugin. | |
| wxString | GetLongDescription () override |
| Get detailed plugin information. | |
| void | OnSetupOptions () override |
| Allows plugin to add pages to global Options dialog. | |
| void | OnCloseToolboxPanel (int page_sel, int ok_apply_cancel) override |
| Handles preference page closure. | |
| void | ShowPreferencesDialog (wxWindow *parent) override |
| Shows the plugin preferences dialog. | |
| bool | SaveConfig () |
| bool | ProcessFile (const wxString &aFile, const wxString &aTargetDir, bool aStripPath=true, wxDateTime aMTime=wxDateTime::Now()) |
| bool | ExtractZipFiles (const wxString &aZipFile, const wxString &aTargetDir, bool aStripPath=true, wxDateTime aMTime=wxDateTime::Now(), bool aRemoveZip=false) |
| bool | ExtractUnarrFiles (const wxString &aRarFile, const wxString &aTargetDir, bool aStripPath=true, wxDateTime aMTime=wxDateTime::Now(), bool aRemoveRar=false) |
| void | UpdatePrefs (ChartDldrPrefsDlgImpl *dialog) |
| void | SetSourceId (int id) |
| int | GetSourceId () const |
| wxString | GetBaseChartDir () |
Public Member Functions inherited from opencpn_plugin_113 | |
| opencpn_plugin_113 (void *pmgr) | |
| virtual bool | KeyboardEventHook (wxKeyEvent &event) |
| Handles keyboard events from main window. | |
| virtual void | OnToolbarToolDownCallback (int id) |
| Handles toolbar button press. | |
| virtual void | OnToolbarToolUpCallback (int id) |
| Handles toolbar button release. | |
Public Member Functions inherited from opencpn_plugin_112 | |
| opencpn_plugin_112 (void *pmgr) | |
| virtual bool | MouseEventHook (wxMouseEvent &event) |
| Handles mouse events from chart window. | |
| virtual void | SendVectorChartObjectInfo (wxString &chart, wxString &feature, wxString &objname, double lat, double lon, double scale, int nativescale) |
| Receives vector chart object information. | |
Public Member Functions inherited from opencpn_plugin_111 | |
| opencpn_plugin_111 (void *pmgr) | |
Public Member Functions inherited from opencpn_plugin_110 | |
| opencpn_plugin_110 (void *pmgr) | |
| virtual void | LateInit (void) |
Public Member Functions inherited from opencpn_plugin_19 | |
| opencpn_plugin_19 (void *pmgr) | |
Public Member Functions inherited from opencpn_plugin_18 | |
| opencpn_plugin_18 (void *pmgr) | |
| virtual bool | RenderOverlay (wxDC &dc, PlugIn_ViewPort *vp) |
| virtual bool | RenderGLOverlay (wxGLContext *pcontext, PlugIn_ViewPort *vp) |
| Renders plugin overlay graphics in OpenGL mode for single canvas. | |
| virtual void | SetPluginMessage (wxString &message_id, wxString &message_body) |
| virtual void | SetPositionFixEx (PlugIn_Position_Fix_Ex &pfix) |
| Updates plugin with extended position fix data at regular intervals. | |
| virtual bool | RenderOverlay (wxMemoryDC *pmdc, PlugIn_ViewPort *vp) |
| Render plugin overlay graphics using standard device context. | |
Public Member Functions inherited from opencpn_plugin | |
| opencpn_plugin (void *pmgr) | |
| virtual void | SetDefaults (void) |
| Sets plugin default options. | |
| virtual int | GetToolbarToolCount (void) |
| Returns the number of toolbar tools this plugin provides. | |
| virtual int | GetToolboxPanelCount (void) |
| Returns the number of preference pages this plugin provides. | |
| virtual void | SetupToolboxPanel (int page_sel, wxNotebook *pnotebook) |
| Creates a plugin preferences page. | |
| virtual void | SetCursorLatLon (double lat, double lon) |
| Receives cursor lat/lon position updates. | |
| virtual void | SetCurrentViewPort (PlugIn_ViewPort &vp) |
| Notifies plugin of viewport changes. | |
| virtual void | SetPositionFix (PlugIn_Position_Fix &pfix) |
| Updates plugin with current position fix data at regular intervals. | |
| virtual void | SetNMEASentence (wxString &sentence) |
| Receive all NMEA 0183 sentences from OpenCPN. | |
| virtual void | SetAISSentence (wxString &sentence) |
| Receive all AIS sentences from OpenCPN. | |
| virtual void | ProcessParentResize (int x, int y) |
| Handles parent window resize events. | |
| virtual void | SetColorScheme (PI_ColorScheme cs) |
| Updates plugin color scheme. | |
| virtual void | OnToolbarToolCallback (int id) |
| Handles toolbar tool clicks. | |
| virtual void | OnContextMenuItemCallback (int id) |
| Handles context menu item selection. | |
| virtual void | UpdateAuiStatus (void) |
| Updates AUI manager status. | |
| virtual wxArrayString | GetDynamicChartClassNameArray (void) |
| Returns array of dynamically loaded chart class names. | |
Public Attributes | |
| std::vector< std::unique_ptr< ChartSource > > | m_ChartSources |
| wxWindow * | m_parent_window |
| ChartCatalog | m_chart_catalog |
| ChartSource * | m_chart_source |
| bool | m_reselect_new |
| bool | m_reselect_updated |
| bool | m_allow_bulk_update |
The PlugIn Class Definition.
Definition at line 57 of file chartdldr_pi.h.
|
explicit |
Definition at line 249 of file chartdldr_pi.cpp.
|
overridevirtual |
Clean up plugin resources.
Called by OpenCPN when plugin is disabled. Shall release any resources allocated by the plugin. Good place to persist plugin configuration.
Reimplemented from opencpn_plugin.
Definition at line 300 of file chartdldr_pi.cpp.
| bool chartdldr_pi::ExtractUnarrFiles | ( | const wxString & | aRarFile, |
| const wxString & | aTargetDir, | ||
| bool | aStripPath = true, |
||
| wxDateTime | aMTime = wxDateTime::Now(), |
||
| bool | aRemoveRar = false |
||
| ) |
Definition at line 2043 of file chartdldr_pi.cpp.
| bool chartdldr_pi::ExtractZipFiles | ( | const wxString & | aZipFile, |
| const wxString & | aTargetDir, | ||
| bool | aStripPath = true, |
||
| wxDateTime | aMTime = wxDateTime::Now(), |
||
| bool | aRemoveZip = false |
||
| ) |
Definition at line 2141 of file chartdldr_pi.cpp.
|
overridevirtual |
Returns the major version number of the plugin API that this plugin supports.
This method must be implemented by all plugins to declare compatibility with a specific major version of the OpenCPN plugin API.
Reimplemented from opencpn_plugin.
Definition at line 318 of file chartdldr_pi.cpp.
|
overridevirtual |
Returns the minor version number of the plugin API that this plugin supports.
This method must be implemented by all plugins to declare compatibility with a specific minor version of the OpenCPN plugin API.
Reimplemented from opencpn_plugin.
Definition at line 320 of file chartdldr_pi.cpp.
|
inline |
Definition at line 112 of file chartdldr_pi.h.
|
overridevirtual |
Get the plugin's common (short) name.
This required method should return a short name used to identify the plugin in lists and menus.
Reimplemented from opencpn_plugin.
Definition at line 328 of file chartdldr_pi.cpp.
|
overridevirtual |
Get detailed plugin information.
This required method should return a longer description including:
Reimplemented from opencpn_plugin.
Definition at line 334 of file chartdldr_pi.cpp.
|
overridevirtual |
Get the plugin's icon bitmap.
FIXME static wxBitmap* LoadSVG(const wxString filename, unsigned int width, unsigned int height) { if (!gFrame) return new wxBitmap(width, height); // We are headless.
This method should return a wxBitmap containing the plugin's icon for display in the plugin manager and other UI elements.
#ifdef ANDROID return loadAndroidSVG(filename, width, height); #elif defined(ocpnUSE_SVG) wxSVGDocument svgDoc; if (svgDoc.Load(filename)) return new wxBitmap(svgDoc.Render(width, height, NULL, true, true)); else return new wxBitmap(width, height); #else return new wxBitmap(width, height); #endif }
wxBitmap* opencpn_plugin::GetPlugInBitmap() { auto bitmap = PluginLoader::GetInstance()->GetPluginDefaultIcon(); return const_cast<wxBitmap*>(bitmap); }
Reimplemented from opencpn_plugin.
Definition at line 326 of file chartdldr_pi.cpp.
|
overridevirtual |
Returns the major version number of the plugin itself.
This method should return the plugin's own major version number, which is used by OpenCPN for plugin version management and display.
Reimplemented from opencpn_plugin.
Definition at line 322 of file chartdldr_pi.cpp.
|
overridevirtual |
Returns the minor version number of the plugin itself.
This method should return the plugin's own minor version number, which is used by OpenCPN for plugin version management and display.
Reimplemented from opencpn_plugin.
Definition at line 324 of file chartdldr_pi.cpp.
|
overridevirtual |
Get a brief description of the plugin.
This required method should return a short description (1-2 sentences) explaining the plugin's basic functionality.
Reimplemented from opencpn_plugin.
Definition at line 330 of file chartdldr_pi.cpp.
|
inline |
Definition at line 111 of file chartdldr_pi.h.
|
overridevirtual |
Initialize the plugin and declare its capabilities.
This required method is called by OpenCPN during plugin loading. It should:
Reimplemented from opencpn_plugin.
Definition at line 267 of file chartdldr_pi.cpp.
|
overridevirtual |
Handles preference page closure.
This method is called when plugin preference pages are closed. Use it to save settings changes or cleanup resources.
| page_sel | Index of page being closed |
| ok_apply_cancel | Result:
|
Reimplemented from opencpn_plugin.
Definition at line 361 of file chartdldr_pi.cpp.
|
overridevirtual |
Allows plugin to add pages to global Options dialog.
Called during plugin loading step, after Init(). Plugin can add its own pages to the Options dialog.
Reimplemented from opencpn_plugin_19.
Definition at line 341 of file chartdldr_pi.cpp.
| bool chartdldr_pi::ProcessFile | ( | const wxString & | aFile, |
| const wxString & | aTargetDir, | ||
| bool | aStripPath = true, |
||
| wxDateTime | aMTime = wxDateTime::Now() |
||
| ) |
Definition at line 1736 of file chartdldr_pi.cpp.
| bool chartdldr_pi::SaveConfig | ( | ) |
Definition at line 404 of file chartdldr_pi.cpp.
|
inline |
Definition at line 110 of file chartdldr_pi.h.
|
overridevirtual |
Shows the plugin preferences dialog.
This method is called when the user requests the plugin preferences through the OpenCPN options dialog. Must be implemented if plugin sets WANTS_PREFERENCES flag.
| parent | Parent window to use for dialog |
Reimplemented from opencpn_plugin.
Definition at line 429 of file chartdldr_pi.cpp.
| void chartdldr_pi::UpdatePrefs | ( | ChartDldrPrefsDlgImpl * | dialog | ) |
Definition at line 459 of file chartdldr_pi.cpp.
| bool chartdldr_pi::m_allow_bulk_update |
Definition at line 115 of file chartdldr_pi.h.
| ChartCatalog chartdldr_pi::m_chart_catalog |
Definition at line 108 of file chartdldr_pi.h.
| ChartSource* chartdldr_pi::m_chart_source |
Definition at line 109 of file chartdldr_pi.h.
| std::vector<std::unique_ptr<ChartSource> > chartdldr_pi::m_ChartSources |
Definition at line 106 of file chartdldr_pi.h.
| wxWindow* chartdldr_pi::m_parent_window |
Definition at line 107 of file chartdldr_pi.h.
| bool chartdldr_pi::m_reselect_new |
Definition at line 113 of file chartdldr_pi.h.
| bool chartdldr_pi::m_reselect_updated |
Definition at line 114 of file chartdldr_pi.h.