~ubuntu-branches/ubuntu/utopic/psi/utopic

« back to all changes in this revision

Viewing changes to src/plugins/include/psiplugin.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * psiplugin.h - Psi plugin interface
 
3
 * Copyright (C) 2006-2008  Kevin Smith, Maciej Niedzielski
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * You can also redistribute and/or modify this program under the
 
11
 * terms of the Psi License, specified in the accompanied COPYING
 
12
 * file, as published by the Psi Project; either dated January 1st,
 
13
 * 2005, or (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU General Public License
 
21
 * along with this library; if not, write to the Free Software
 
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
23
 *
 
24
 */
 
25
 
 
26
#ifndef PSIPLUGIN_H
 
27
#define PSIPLUGIN_H
 
28
 
 
29
class QWidget;
 
30
 
 
31
#include <QtCore>
 
32
 
 
33
 
 
34
/**
 
35
 * \brief An abstract class for implementing a plugin
 
36
 */
 
37
class PsiPlugin
 
38
{
 
39
public:
 
40
        virtual ~PsiPlugin() {}
 
41
 
 
42
        /**
 
43
         * \brief Plugin Name
 
44
         * The full name of the plugin.
 
45
         * \return Plugin name
 
46
         */
 
47
        virtual QString name() const = 0;
 
48
 
 
49
        /**
 
50
         * \brief Short name for the plugin
 
51
         * This is the short name of the plugin, used for options structures. 
 
52
         * It must consist of only alphanumerics (no spaces or punctuation).
 
53
         * \return Short plugin name
 
54
        */
 
55
        virtual QString shortName() const = 0;
 
56
        
 
57
        /**
 
58
         * \brief Plugin version
 
59
         * Free-form string of the plugin version. Human readable
 
60
         * \return Plugin version string
 
61
         */
 
62
        virtual QString version() const = 0;
 
63
 
 
64
        /**
 
65
         * \brief Plugin options widget
 
66
         * This method is called by the Psi options system to retrieve
 
67
         * a widget containing the options for this plugin.
 
68
         * This will then be embedded in the options dialog, so this
 
69
         * should be considered when designing the widget. Should return
 
70
         * NULL when there are no user-configurable options. The calling method
 
71
         * is responsible for deleting the options.
 
72
         *
 
73
         * TODO: make sure this is really deleted, etc
 
74
         */
 
75
        virtual QWidget* options() const = 0;
 
76
 
 
77
        /**
 
78
         * \brief Enable plugin
 
79
         * \return true if plugin was successfully enabled
 
80
         */
 
81
 
 
82
        virtual bool enable() = 0;
 
83
 
 
84
        /**
 
85
         * \brief Disable plugin
 
86
         * \return true if plugin was successfully disabled
 
87
         */
 
88
        virtual bool disable() = 0;
 
89
 
 
90
};
 
91
 
 
92
Q_DECLARE_INTERFACE(PsiPlugin, "org.psi-im.PsiPlugin/0.3");
 
93
 
 
94
#endif