Code::Blocks  SVN r11506
Public Member Functions | Private Member Functions | List of all members
cbMimePlugin Class Referenceabstract

Base class for mime plugins. More...

#include <cbplugin.h>

Inheritance diagram for cbMimePlugin:
Collaboration diagram for cbMimePlugin:

Public Member Functions

 cbMimePlugin ()
 
virtual bool CanHandleFile (const wxString &filename) const =0
 Can a file be handled by this plugin? More...
 
virtual int OpenFile (const wxString &filename)=0
 Open the file. More...
 
virtual bool HandlesEverything () const =0
 Is this a default handler? More...
 
- Public Member Functions inherited from cbPlugin
 cbPlugin ()
 In default cbPlugin's constructor the associated PluginInfo structure is filled with default values. More...
 
 ~cbPlugin () override
 cbPlugin destructor. More...
 
virtual PluginType GetType () const
 The plugin must return its type on request. More...
 
virtual int GetConfigurationPriority () const
 Return the plugin's configuration priority. More...
 
virtual int GetConfigurationGroup () const
 Return the configuration group for this plugin. More...
 
virtual cbConfigurationPanelGetConfigurationPanel (cb_optional wxWindow *parent)
 Return plugin's configuration panel. More...
 
virtual cbConfigurationPanelGetProjectConfigurationPanel (cb_optional wxWindow *parent, cb_optional cbProject *project)
 Return plugin's configuration panel for projects. More...
 
virtual void BuildMenu (cb_optional wxMenuBar *menuBar)
 This method is called by Code::Blocks and is used by the plugin to add any menu items it needs on Code::Blocks's menu bar. More...
 
virtual void BuildModuleMenu (cb_optional const ModuleType type, cb_optional wxMenu *menu, cb_optional const FileTreeData *data=nullptr)
 This method is called by Code::Blocks core modules (EditorManager, ProjectManager etc) and is used by the plugin to add any menu items it needs in the module's popup menu. More...
 
virtual bool BuildToolBar (cb_optional wxToolBar *toolBar)
 This method is called by Code::Blocks and is used by the plugin to add any toolbar items it needs on Code::Blocks's toolbar. More...
 
virtual int GetToolBarPriority ()
 This method return the priority of the plugin's toolbar, the less value indicates a more preceding position when C::B starts with no configuration file. More...
 
virtual void CreateStatusField (cbStatusBar *statusBar)
 This method is called by Code::Blocks and is used by the plugin to add a field on Code::Blocks's statusbar. More...
 
bool IsAttached () const
 See whether this plugin is attached or not. More...
 
virtual bool CanDetach () const
 See whether this plugin can be detached (unloaded) or not. More...
 

Private Member Functions

void BuildMenu (cb_unused wxMenuBar *menuBar) override
 
void RemoveMenu (cb_unused wxMenuBar *menuBar)
 
void BuildModuleMenu (cb_unused const ModuleType type, cb_unused wxMenu *menu, cb_unused const FileTreeData *data=nullptr) override
 
bool BuildToolBar (cb_unused wxToolBar *toolBar) override
 
void RemoveToolBar (cb_unused wxToolBar *toolBar)
 

Additional Inherited Members

- Protected Member Functions inherited from cbPlugin
virtual void OnAttach ()
 Any descendent plugin should override this virtual method and perform any necessary initialization. More...
 
virtual void OnRelease (cb_optional bool appShutDown)
 Any descendent plugin should override this virtual method and perform any necessary de-initialization. More...
 
virtual void NotImplemented (const wxString &log) const
 This method logs a "Not implemented" message and is provided for convenience only. More...
 
- Protected Attributes inherited from cbPlugin
PluginType m_Type
 Holds the plugin's type. More...
 
bool m_IsAttached
 Holds the "attached" state. More...
 

Detailed Description

Base class for mime plugins.

Mime plugins are called by Code::Blocks to operate on files that Code::Blocks wouldn't know how to handle on itself.

Definition at line 684 of file cbplugin.h.

Constructor & Destructor Documentation

◆ cbMimePlugin()

cbMimePlugin::cbMimePlugin ( )

Definition at line 995 of file cbplugin.cpp.

References cbPlugin::m_Type, and ptMime.

Member Function Documentation

◆ BuildMenu()

void cbMimePlugin::BuildMenu ( cb_unused wxMenuBar menuBar)
inlineoverrideprivate

Definition at line 717 of file cbplugin.h.

◆ BuildModuleMenu()

void cbMimePlugin::BuildModuleMenu ( cb_unused const ModuleType  type,
cb_unused wxMenu menu,
cb_unused const FileTreeData data = nullptr 
)
inlineoverrideprivate

Definition at line 719 of file cbplugin.h.

◆ BuildToolBar()

bool cbMimePlugin::BuildToolBar ( cb_unused wxToolBar toolBar)
inlineoverrideprivate

Definition at line 720 of file cbplugin.h.

◆ CanHandleFile()

virtual bool cbMimePlugin::CanHandleFile ( const wxString filename) const
pure virtual

Can a file be handled by this plugin?

Parameters
filenameThe file in question.
Returns
The plugin should return true if it can handle this file, false if not.

Referenced by PluginManager::GetMIMEHandlerForFile(), and ProjectManagerUI::ShowMenu().

◆ HandlesEverything()

virtual bool cbMimePlugin::HandlesEverything ( ) const
pure virtual

Is this a default handler?

This is a flag notifying the main app that this plugin can handle every file passed to it. Usually you 'll want to return false in this function, because you usually create specialized handler plugins (for specific MIME types)...

Returns
True if this plugin can handle every possible MIME type, false if not.

◆ OpenFile()

virtual int cbMimePlugin::OpenFile ( const wxString filename)
pure virtual

Open the file.

Parameters
filenameThe file to open.
Returns
The plugin should return zero on success, other value on error.

Referenced by ProjectManagerUI::DoOpenFile(), ProjectManager::LoadProject(), ProjectManagerUI::OnOpenWith(), MainFrame::OpenGeneric(), and BuildLogger::OpenLink().

◆ RemoveMenu()

void cbMimePlugin::RemoveMenu ( cb_unused wxMenuBar menuBar)
inlineprivate

Definition at line 718 of file cbplugin.h.

◆ RemoveToolBar()

void cbMimePlugin::RemoveToolBar ( cb_unused wxToolBar toolBar)
inlineprivate

Definition at line 721 of file cbplugin.h.


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