tufao  1.3.0
An asynchronous web framework for C++ built on top of Qt
classhandler.h
1 /*
2  Copyright (c) 2013 Timothy Reaves treaves@silverfieldstech.com
3 
4  Permission is hereby granted, free of charge, to any person obtaining a copy
5  of this software and associated documentation files (the "Software"), to deal
6  in the Software without restriction, including without limitation the rights
7  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  copies of the Software, and to permit persons to whom the Software is
9  furnished to do so, subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in all
12  copies or substantial portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20  SOFTWARE.
21  */
22 
23 #ifndef TUFAO_CLASSHANDLER_H
24 #define TUFAO_CLASSHANDLER_H
25 
26 #include <QtCore/QtPlugin>
27 
28 #define TUFAO_CLASSHANDLER_IID "Tufao::ClassHandler/1.0"
29 
30 namespace Tufao {
31 
35 {
37  QString id;
39  QString displayedName;
41  QString authors;
43  QString contact;
45  QString description;
46 };
47 
48 
168 class ClassHandler : public QObject
169 {
170  Q_OBJECT
171 public:
172  virtual ~ClassHandler(){}
173 
175  virtual void deinit() = 0;
177  virtual void init() = 0;
178 
180  virtual ClassHandlerPluginInfo getPluginInfo() const = 0;
181 
182  static const QString HttpResponseStatusKey;
183  static const QString JsonResponseKey;
184 };
185 
186 } // namespace Tufao
187 
188 Q_DECLARE_INTERFACE(Tufao::ClassHandler, TUFAO_CLASSHANDLER_IID)
189 
190 #endif // TUFAO_CLASSHANDLER_H
Definition: classhandler.h:34
QString description
The HTML description of the plugin.
Definition: classhandler.h:45
QString displayedName
The displayed name, e.g. "ServerSettings".
Definition: classhandler.h:39
The ClassHandler class Define the interface to implement when creating a plugin.
Definition: classhandler.h:168
virtual void deinit()=0
Clean up resource; called automatically before plugin is unloaded.
This is the namespace where all Tufão facilities are grouped.
Definition: abstracthttpserverrequesthandler.h:30
QString id
The plugin ID. It MUST match the lib file name (case sensitive).
Definition: classhandler.h:37
virtual void init()=0
Initialize an instance for use; alled automatically when plugin is registered.
virtual ClassHandlerPluginInfo getPluginInfo() const =0
Get information about the plugin.
QString contact
The contact email or URL.
Definition: classhandler.h:43
QString authors
The comma separated list of authors, e.g. "Timothy Reaves".
Definition: classhandler.h:41