OpenCPN Partial API docs
Loading...
Searching...
No Matches
chartdldr_pi Class Reference

The PlugIn Class Definition. More...

#include <chartdldr_pi.h>

Inheritance diagram for chartdldr_pi:
opencpn_plugin_113 opencpn_plugin_112 opencpn_plugin_111 opencpn_plugin_110 opencpn_plugin_19 opencpn_plugin_18 opencpn_plugin

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
 
ChartSourcem_chart_source
 
bool m_reselect_new
 
bool m_reselect_updated
 
bool m_allow_bulk_update
 

Detailed Description

The PlugIn Class Definition.

Definition at line 57 of file chartdldr_pi.h.

Constructor & Destructor Documentation

◆ chartdldr_pi()

chartdldr_pi::chartdldr_pi ( void *  ppimgr)
explicit

Definition at line 249 of file chartdldr_pi.cpp.

Member Function Documentation

◆ DeInit()

bool chartdldr_pi::DeInit ( void  )
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.

Returns
True if cleanup successful, False if error

Reimplemented from opencpn_plugin.

Definition at line 300 of file chartdldr_pi.cpp.

◆ ExtractUnarrFiles()

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.

◆ ExtractZipFiles()

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.

◆ GetAPIVersionMajor()

int chartdldr_pi::GetAPIVersionMajor ( )
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.

Returns
Integer value representing the major API version (e.g., 1)
Note
Major version changes indicate incompatible API changes
Current API major version is defined by API_VERSION_MAJOR

Reimplemented from opencpn_plugin.

Definition at line 318 of file chartdldr_pi.cpp.

◆ GetAPIVersionMinor()

int chartdldr_pi::GetAPIVersionMinor ( )
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.

Returns
Integer value representing the minor API version (e.g., 19)
Note
Minor version changes indicate backward-compatible API additions
Current API minor version is defined by API_VERSION_MINOR

Reimplemented from opencpn_plugin.

Definition at line 320 of file chartdldr_pi.cpp.

◆ GetBaseChartDir()

wxString chartdldr_pi::GetBaseChartDir ( )
inline

Definition at line 112 of file chartdldr_pi.h.

◆ GetCommonName()

wxString chartdldr_pi::GetCommonName ( )
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.

Returns
wxString containing plugin name (e.g., "Dashboard")
Note
Should be valid and meaningful even before Init() is called
Used by the plugin manager GUI

Reimplemented from opencpn_plugin.

Definition at line 328 of file chartdldr_pi.cpp.

◆ GetLongDescription()

wxString chartdldr_pi::GetLongDescription ( )
overridevirtual

Get detailed plugin information.

This required method should return a longer description including:

  • Detailed feature list
  • Version information
  • Author/copyright details
Returns
wxString containing detailed plugin information
Note
Should be valid before Init() is called
Used in plugin manager details view

Reimplemented from opencpn_plugin.

Definition at line 334 of file chartdldr_pi.cpp.

◆ GetPlugInBitmap()

wxBitmap * chartdldr_pi::GetPlugInBitmap ( )
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.

Returns
Pointer to wxBitmap containing icon, NULL for default icon
Note
The bitmap should be square, typically 32x32 pixels
Ownership of the bitmap remains with the plugin
Icon should be visible on both light and dark backgrounds

#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.

◆ GetPlugInVersionMajor()

int chartdldr_pi::GetPlugInVersionMajor ( )
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.

Returns
Integer value representing the plugin's major version
Note
Part of semantic version (major.minor.patch)
Major version changes indicate incompatible API changes

Reimplemented from opencpn_plugin.

Definition at line 322 of file chartdldr_pi.cpp.

◆ GetPlugInVersionMinor()

int chartdldr_pi::GetPlugInVersionMinor ( )
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.

Returns
Integer value representing the plugin's minor version
Note
Part of semantic version (major.minor.patch)
Minor version changes indicate backward-compatible feature additions

Reimplemented from opencpn_plugin.

Definition at line 324 of file chartdldr_pi.cpp.

◆ GetShortDescription()

wxString chartdldr_pi::GetShortDescription ( )
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.

Returns
wxString containing brief description
Note
Should be valid before Init() is called
Used in plugin manager list view

Reimplemented from opencpn_plugin.

Definition at line 330 of file chartdldr_pi.cpp.

◆ GetSourceId()

int chartdldr_pi::GetSourceId ( ) const
inline

Definition at line 111 of file chartdldr_pi.h.

◆ Init()

int chartdldr_pi::Init ( void  )
overridevirtual

Initialize the plugin and declare its capabilities.

This required method is called by OpenCPN during plugin loading. It should:

  • Set up any required plugin resources
  • Register capabilities by returning a bitwise OR of WANTS_ and INSTALLS_ flags
Returns
Integer capability flags indicating plugin features:
  • WANTS_OVERLAY_CALLBACK
  • WANTS_CURSOR_LATLON
  • WANTS_TOOLBAR_CALLBACK
  • etc. (see enum definitions)

Reimplemented from opencpn_plugin.

Definition at line 267 of file chartdldr_pi.cpp.

◆ OnCloseToolboxPanel()

void chartdldr_pi::OnCloseToolboxPanel ( int  page_sel,
int  ok_apply_cancel 
)
overridevirtual

Handles preference page closure.

This method is called when plugin preference pages are closed. Use it to save settings changes or cleanup resources.

Parameters
page_selIndex of page being closed
ok_apply_cancelResult:
  • 0 = OK (apply changes)
  • 1 = APPLY (apply but don't close)
  • 2 = CANCEL (discard changes) @Deprecated Does not invoke any action, will be removed.
Note
Only called if plugin implements SetupToolboxPanel()
Good place to save settings to config

Reimplemented from opencpn_plugin.

Definition at line 361 of file chartdldr_pi.cpp.

◆ OnSetupOptions()

void chartdldr_pi::OnSetupOptions ( void  )
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.

◆ ProcessFile()

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.

◆ SaveConfig()

bool chartdldr_pi::SaveConfig ( )

Definition at line 404 of file chartdldr_pi.cpp.

◆ SetSourceId()

void chartdldr_pi::SetSourceId ( int  id)
inline

Definition at line 110 of file chartdldr_pi.h.

◆ ShowPreferencesDialog()

void chartdldr_pi::ShowPreferencesDialog ( wxWindow *  parent)
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.

Parameters
parentParent window to use for dialog
Note
Different from toolbox panel preferences
Use for simple plugin-specific settings
Modal dialog recommended

Reimplemented from opencpn_plugin.

Definition at line 429 of file chartdldr_pi.cpp.

◆ UpdatePrefs()

void chartdldr_pi::UpdatePrefs ( ChartDldrPrefsDlgImpl dialog)

Definition at line 459 of file chartdldr_pi.cpp.

Member Data Documentation

◆ m_allow_bulk_update

bool chartdldr_pi::m_allow_bulk_update

Definition at line 115 of file chartdldr_pi.h.

◆ m_chart_catalog

ChartCatalog chartdldr_pi::m_chart_catalog

Definition at line 108 of file chartdldr_pi.h.

◆ m_chart_source

ChartSource* chartdldr_pi::m_chart_source

Definition at line 109 of file chartdldr_pi.h.

◆ m_ChartSources

std::vector<std::unique_ptr<ChartSource> > chartdldr_pi::m_ChartSources

Definition at line 106 of file chartdldr_pi.h.

◆ m_parent_window

wxWindow* chartdldr_pi::m_parent_window

Definition at line 107 of file chartdldr_pi.h.

◆ m_reselect_new

bool chartdldr_pi::m_reselect_new

Definition at line 113 of file chartdldr_pi.h.

◆ m_reselect_updated

bool chartdldr_pi::m_reselect_updated

Definition at line 114 of file chartdldr_pi.h.


The documentation for this class was generated from the following files: