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

« back to all changes in this revision

Viewing changes to src/plugins/scriptedwizard/resources/plugins/templates/mime_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 cbMimePlugin"
 
21
 
 
22
class [PLUGIN_NAME] : public cbMimePlugin
 
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; }[ENDIF HAS_CONFIGURE]
 
60
        /** @brief Can a file be handled by this plugin?
 
61
          *
 
62
          * @param filename The file in question.
 
63
          * @return The plugin should return true if it can handle this file,
 
64
          * false if not.
 
65
          */
 
66
        virtual bool CanHandleFile(const wxString& filename) const;
 
67
        
 
68
        /** @brief Open the file.
 
69
          *
 
70
          * @param filename The file to open.
 
71
          * @return The plugin should return zero on success, other value on error.
 
72
          */
 
73
        virtual int OpenFile(const wxString& filename);
 
74
        
 
75
        /** @brief Is this a default handler?
 
76
          *
 
77
          * This is a flag notifying the main app that this plugin can handle
 
78
          * every file passed to it. Usually you 'll want to return false in
 
79
          * this function, because you usually create specialized handler
 
80
          * plugins (for specific MIME types)...
 
81
          *
 
82
          * @return True if this plugin can handle every possible MIME type,
 
83
          * false if not.
 
84
          */
 
85
        virtual bool HandlesEverything() const;
 
86
    protected:
 
87
        /** Any descendent plugin should override this virtual method and
 
88
          * perform any necessary initialization. This method is called by
 
89
          * Code::Blocks (PluginManager actually) when the plugin has been
 
90
          * loaded and should attach in Code::Blocks. When Code::Blocks
 
91
          * starts up, it finds and <em>loads</em> all plugins but <em>does
 
92
          * not</em> activate (attaches) them. It then activates all plugins
 
93
          * that the user has selected to be activated on start-up.\n
 
94
          * This means that a plugin might be loaded but <b>not</b> activated...\n
 
95
          * Think of this method as the actual constructor...
 
96
          */
 
97
        virtual void OnAttach();
 
98
 
 
99
        /** Any descendent plugin should override this virtual method and
 
100
          * perform any necessary de-initialization. This method is called by
 
101
          * Code::Blocks (PluginManager actually) when the plugin has been
 
102
          * loaded, attached and should de-attach from Code::Blocks.\n
 
103
          * Think of this method as the actual destructor...
 
104
          * @param appShutDown If true, the application is shutting down. In this
 
105
          *         case *don't* use Manager::Get()->Get...() functions or the
 
106
          *         behaviour is undefined...
 
107
          */
 
108
        virtual void OnRelease(bool appShutDown);
 
109
};
 
110
 
 
111
 
 
112
#endif // [GUARD_WORD]
 
113