~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/plugins/scriptedwizard/resources/plugins/templates/tool_template.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************
 
2
 * Name:      [PROJECT_NAME]
 
3
 * Purpose:   Code::Blocks plugin
 
4
 * Author:    [AUTHOR_NAME] ([AUTHOR_EMAIL])
 
5
 * Created:   [NOW]
 
6
 * Copyright: [AUTHOR_NAME]
 
7
 * License:   GPL
 
8
 **************************************************************/
 
9
 
 
10
#ifndef [GUARD_WORD]
 
11
#define [GUARD_WORD]
 
12
 
 
13
// For compilers that support precompilation, includes <wx/wx.h>
 
14
#include <wx/wxprec.h>
 
15
 
 
16
#ifndef WX_PRECOMP
 
17
    #include <wx/wx.h>
 
18
#endif
 
19
 
 
20
#include <cbplugin.h> // for "class cbToolPlugin"
 
21
 
 
22
class [PLUGIN_NAME] : public cbToolPlugin
 
23
{
 
24
    public:
 
25
        /** Constructor. */
 
26
        [PLUGIN_NAME]();
 
27
        /** Destructor. */
 
28
        virtual ~[PLUGIN_NAME]();
 
29
[IF HAS_CONFIGURE]
 
30
        /** Invoke configuration dialog. */
 
31
        virtual int Configure();
 
32
 
 
33
        /** Return the plugin's configuration priority.
 
34
          * This is a number (default is 50) that is used to sort plugins
 
35
          * in configuration dialogs. Lower numbers mean the plugin's
 
36
          * configuration is put higher in the list.
 
37
          */
 
38
        virtual int GetConfigurationPriority() const { return 50; }
 
39
 
 
40
        /** Return the configuration group for this plugin. Default is cgUnknown.
 
41
          * Notice that you can logically OR more than one configuration groups,
 
42
          * so you could set it, for example, as "cgCompiler | cgContribPlugin".
 
43
          */
 
44
        virtual int GetConfigurationGroup() const { return cgUnknown; }
 
45
 
 
46
        /** Return plugin's configuration panel.
 
47
          * @param parent The parent window.
 
48
          * @return A pointer to the plugin's cbConfigurationPanel. It is deleted by the caller.
 
49
          */
 
50
        virtual cbConfigurationPanel* GetConfigurationPanel(wxWindow* parent){ return 0; }
 
51
        
 
52
        /** Return plugin's configuration panel for projects.
 
53
          * The panel returned from this function will be added in the project's
 
54
          * configuration dialog.
 
55
          * @param parent The parent window.
 
56
          * @param project The project that is being edited.
 
57
          * @return A pointer to the plugin's cbConfigurationPanel. It is deleted by the caller.
 
58
          */
 
59
        virtual cbConfigurationPanel* GetProjectConfigurationPanel(wxWindow* parent, cbProject* project){ return 0; }
 
60
[ENDIF HAS_CONFIGURE]
 
61
        /** @brief Execute the plugin.
 
62
          *
 
63
          * This is the only function needed by a cbToolPlugin.
 
64
          * This will be called when the user selects the plugin from the "Plugins"
 
65
          * menu.
 
66
          */
 
67
        virtual int Execute();
 
68
    protected:
 
69
        /** Any descendent plugin should override this virtual method and
 
70
          * perform any necessary initialization. This method is called by
 
71
          * Code::Blocks (PluginManager actually) when the plugin has been
 
72
          * loaded and should attach in Code::Blocks. When Code::Blocks
 
73
          * starts up, it finds and <em>loads</em> all plugins but <em>does
 
74
          * not</em> activate (attaches) them. It then activates all plugins
 
75
          * that the user has selected to be activated on start-up.\n
 
76
          * This means that a plugin might be loaded but <b>not</b> activated...\n
 
77
          * Think of this method as the actual constructor...
 
78
          */
 
79
        virtual void OnAttach();
 
80
 
 
81
        /** Any descendent plugin should override this virtual method and
 
82
          * perform any necessary de-initialization. This method is called by
 
83
          * Code::Blocks (PluginManager actually) when the plugin has been
 
84
          * loaded, attached and should de-attach from Code::Blocks.\n
 
85
          * Think of this method as the actual destructor...
 
86
          * @param appShutDown If true, the application is shutting down. In this
 
87
          *         case *don't* use Manager::Get()->Get...() functions or the
 
88
          *         behaviour is undefined...
 
89
          */
 
90
        virtual void OnRelease(bool appShutDown);
 
91
};
 
92
 
 
93
#endif // [GUARD_WORD]
 
94