]> icculus.org git repositories - duncan/yast2-web-wt.git/blob - src/Y2CCWeb.h
bf086638d3ce019e1f4e35813d97ae340832841c
[duncan/yast2-web-wt.git] / src / Y2CCWeb.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       Y2CCWeb.h
14
15   Author:     Mathias Kettner <kettner@suse.de>
16   Maintainer: Stefan Hundhammer <sh@suse.de>
17
18 /-*/
19
20
21
22 #ifndef _Y2CCWeb_h
23 #define _Y2CCWeb_h
24
25 #include "YWebUIComponent.h"
26
27 /**
28  * @short Y2ComponentCreator that can create Wt user interfaces
29  * A Y2ComponentCreator is an object, that can create components.
30  * It is given a component name and - if it knows how to create
31  * such a component - returns a newly created component of this
32  * type. The Y2CCWeb can create components with the name "web".
33  */
34 class Y2CCWeb : public Y2ComponentCreator
35 {
36 public:
37     /**
38      * Creates a Web component creator
39      */
40     Y2CCWeb() : Y2ComponentCreator(Y2ComponentBroker::BUILTIN) { };
41
42     /**
43      * Returns true, since the qt component is a
44      * YaST2 server.
45      */
46     bool isServerCreator() const { return true; };
47
48     /**
49      * Creates a new Qt UI component.
50      */
51     Y2Component *create(const char * name) const
52     {
53         if (!strcmp(name, "web") )
54             return new YWebUIComponent();
55         else
56             return 0;
57     }
58 };
59
60 #endif  // ifndef _Y2CCWeb_h
61
62
63 // EOF