1
/***************************************************************
2
* Name: PreservePermissions
3
* Purpose: Code::Blocks plugin
4
* Author: Damien Moore (damienlmoore@gmail.com)
6
* Copyright: Damien Moore
8
**************************************************************/
10
#ifndef PERMISSIONS_PRESERVER_H_INCLUDED
11
#define PERMISSIONS_PRESERVER_H_INCLUDED
13
// For compilers that support precompilation, includes <wx/wx.h>
14
#include <wx/wxprec.h>
20
#include <cbplugin.h> // for "class cbPlugin"
25
class PermissionsPreserver : public cbPlugin
29
PermissionsPreserver();
31
virtual ~PermissionsPreserver();
34
/** This method is called by Code::Blocks and is used by the plugin
35
* to add any menu items it needs on Code::Blocks's menu bar.\n
36
* It is a pure virtual method that needs to be implemented by all
37
* plugins. If the plugin does not need to add items on the menu,
39
* @param menuBar the wxMenuBar to create items in
41
virtual void BuildMenu(wxMenuBar* menuBar){}
43
/** This method is called by Code::Blocks core modules (EditorManager,
44
* ProjectManager etc) and is used by the plugin to add any menu
45
* items it needs in the module's popup menu. For example, when
46
* the user right-clicks on a project file in the project tree,
47
* ProjectManager prepares a popup menu to display with context
48
* sensitive options for that file. Before it displays this popup
49
* menu, it asks all attached plugins (by asking PluginManager to call
50
* this method), if they need to add any entries
51
* in that menu. This method is called.\n
52
* If the plugin does not need to add items in the menu,
54
* @param type the module that's preparing a popup menu
55
* @param menu pointer to the popup menu
56
* @param data pointer to FileTreeData object (to access/modify the file tree)
58
virtual void BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data = 0){}
60
/** This method is called by Code::Blocks and is used by the plugin
61
* to add any toolbar items it needs on Code::Blocks's toolbar.\n
62
* It is a pure virtual method that needs to be implemented by all
63
* plugins. If the plugin does not need to add items on the toolbar,
65
* @param toolBar the wxToolBar to create items on
66
* @return The plugin should return true if it needed the toolbar, false if not
68
virtual bool BuildToolBar(wxToolBar* toolBar){ return false; }
70
/** Any descendent plugin should override this virtual method and
71
* perform any necessary initialization. This method is called by
72
* Code::Blocks (PluginManager actually) when the plugin has been
73
* loaded and should attach in Code::Blocks. When Code::Blocks
74
* starts up, it finds and <em>loads</em> all plugins but <em>does
75
* not</em> activate (attaches) them. It then activates all plugins
76
* that the user has selected to be activated on start-up.\n
77
* This means that a plugin might be loaded but <b>not</b> activated...\n
78
* Think of this method as the actual constructor...
80
virtual void OnAttach();
82
/** Any descendent plugin should override this virtual method and
83
* perform any necessary de-initialization. This method is called by
84
* Code::Blocks (PluginManager actually) when the plugin has been
85
* loaded, attached and should de-attach from Code::Blocks.\n
86
* Think of this method as the actual destructor...
87
* @param appShutDown If true, the application is shutting down. In this
88
* case *don't* use Manager::Get()->Get...() functions or the
89
* behaviour is undefined...
91
virtual void OnRelease(bool appShutDown);
93
void OnEditorBeforeSave(CodeBlocksEvent& event);
94
void OnEditorSave(CodeBlocksEvent& event);
100
#endif // PERMISSIONS_PRESERVER_H_INCLUDED