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