Yay! After months, distributed client/core operation is working again!
[quassel.git] / src / plugins / plugin.h
1 /***************************************************************************
2  *   Copyright (C) 2005/06 by The Quassel Team                             *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #ifndef _PLUGIN_H_
22 #define _PLUGIN_H_
23
24 // TODO disable GUI-related stuff for core-only compile
25
26 #include <QtCore>
27 #include <QtGui>
28
29 /** \file plugin.h
30  * Header that needs to be included by all plugins and defines the interfaces a plugin
31  * can implement.
32  */
33
34 /// The base class for the generic plugin interfaces.
35 class PluginInterface {
36
37
38 };
39
40
41 /// All GUI plugins need to implement this interface.
42 class GuiPluginInterface : public PluginInterface {
43
44
45 };
46
47 Q_DECLARE_INTERFACE(GuiPluginInterface,
48                     "eu.quassel.plugins.GuiPluginInterface/1.0");
49
50 /// All core plugins need to implement this interface.
51 class CorePluginInterface: public PluginInterface {
52
53
54
55 };
56
57 Q_DECLARE_INTERFACE(CorePluginInterface,
58                     "eu.quassel.plugins.CorePluginInterface/1.0");
59
60 /** Plugins implementing this interface can provide a settings widget that will be shown in
61  * the application's settings dialog.
62  * This is also used by built-in settings dialogs.
63  */
64 class SettingsInterface {
65   public:
66     virtual ~SettingsInterface() {};
67     virtual QString category() = 0;
68     virtual QString title() = 0; 
69     virtual QWidget *settingsWidget() = 0;
70     virtual void applyChanges() = 0;
71
72 };
73
74 Q_DECLARE_INTERFACE(SettingsInterface,
75                     "eu.quassel.plugins.SettingsInterface/1.0");
76
77 /** Plugins implementing this interface will be provided with the raw text the users enters.
78  * The output they generate is in turn treated like generic user input. Note that the order in
79  * which plugins are called is not defined.
80  */
81 class UserInputFilterInterface {
82
83
84
85 };
86
87 Q_DECLARE_INTERFACE(UserInputFilterInterface,
88                     "eu.quassel.plugins.UserInputFilterInterface/1.0");
89
90 /** Plugins implementing this interface receive and can process all messages coming from the core.
91  */
92 class CoreMessageFilterInterface {
93
94
95
96 };
97
98 Q_DECLARE_INTERFACE(CoreMessageFilterInterface,
99                     "eu.quassel.plugins.CoreMessageFilterInterface/1.0");
100
101 /** Plugins implementing this interface receive core messages for a single buffer only.
102  * Any ChatWidgetPlugin has to provide a widget it outputs these messages to, to be used
103  * in a ChannelWidget.
104  */
105 class ChatWidgetInterface {
106
107
108
109 };
110
111 Q_DECLARE_INTERFACE(ChatWidgetInterface,
112                     "eu.quassel.plugins.ChatWidgetInterface/1.0");
113
114 #endif