Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / libkopete / ui / kopetewidgets.cpp
blob191d8e589aee154be11c4ed47bc697854d9cca89
1 /**
2 * This file was autogenerated by makekdewidgets. Any changes will be lost!
3 * The generated code in this file is licensed under the same license that the
4 * input file.
5 */
6 #include <qwidgetplugin.h>
7 //Added by qt3to4:
8 #include <QPixmap>
10 #include <kcomponentdata.h>
11 #include <addressbooklinkwidget.h>
12 #include <kopetelistview.h>
13 #include <kopetelistviewsearchline.h>
14 #ifndef EMBED_IMAGES
15 #include <kstandarddirs.h>
16 #endif
18 class KopeteWidgets : public QWidgetPlugin
20 public:
21 KopeteWidgets();
23 virtual ~KopeteWidgets();
25 virtual QStringList keys() const
27 QStringList result;
28 for (WidgetInfos::ConstIterator it = m_widgets.begin(); it != m_widgets.end(); ++it)
29 result << it.key();
30 return result;
33 virtual QWidget *create(const QString &key, QWidget *parent = 0, const char *name = 0);
35 virtual QIcon iconSet(const QString &key) const
37 #ifdef EMBED_IMAGES
38 QPixmap pix(m_widgets[key].iconSet);
39 #else
40 QPixmap pix(KStandardDirs::locate( "data",
41 QLatin1String("kopetewidgets/pics/") + m_widgets[key].iconSet));
42 #endif
43 return QIcon(pix);
46 virtual bool isContainer(const QString &key) const { return m_widgets[key].isContainer; }
48 virtual QString group(const QString &key) const { return m_widgets[key].group; }
50 virtual QString includeFile(const QString &key) const { return m_widgets[key].includeFile; }
52 virtual QString toolTip(const QString &key) const { return m_widgets[key].toolTip; }
54 virtual QString whatsThis(const QString &key) const { return m_widgets[key].whatsThis; }
55 private:
56 struct WidgetInfo
58 QString group;
59 #ifdef EMBED_IMAGES
60 QPixmap iconSet;
61 #else
62 QString iconSet;
63 #endif
64 QString includeFile;
65 QString toolTip;
66 QString whatsThis;
67 bool isContainer;
69 typedef QMap<QString, WidgetInfo> WidgetInfos;
70 WidgetInfos m_widgets;
72 KopeteWidgets::KopeteWidgets()
74 WidgetInfo widget;
76 widget.group = QLatin1String("Input (Kopete)");
77 #ifdef EMBED_IMAGES
78 widget.iconSet = QPixmap(kopete__ui__addressbooklinkwidget_xpm);
79 #else
80 widget.iconSet = QLatin1String("kopete__ui__addressbooklinkwidget.png");
81 #endif
82 widget.includeFile = QLatin1String("addressbooklinkwidget.h");
83 widget.toolTip = QLatin1String("Address Book Link Widget (Kopete)");
84 widget.whatsThis = QLatin1String("KABC::Addressee display/selector");
85 widget.isContainer = false;
86 m_widgets.insert(QLatin1String("Kopete::UI::AddressBookLinkWidget"), widget);
88 widget.group = QLatin1String("Views (Kopete)");
89 #ifdef EMBED_IMAGES
90 widget.iconSet = QPixmap(kopete__ui__listview__listview_xpm);
91 #else
92 widget.iconSet = QLatin1String("kopete__ui__listview__listview.png");
93 #endif
94 widget.includeFile = QLatin1String("kopetelistview.h");
95 widget.toolTip = QLatin1String("List View (Kopete)");
96 widget.whatsThis = QLatin1String("A component capable list view widget.");
97 widget.isContainer = false;
98 m_widgets.insert(QLatin1String("Kopete::UI::ListView::ListView"), widget);
100 widget.group = QLatin1String("Input (Kopete)");
101 #ifdef EMBED_IMAGES
102 widget.iconSet = QPixmap(kopete__ui__listview__searchline_xpm);
103 #else
104 widget.iconSet = QLatin1String("kopete__ui__listview__searchline.png");
105 #endif
106 widget.includeFile = QLatin1String("kopetelistviewsearchline.h");
107 widget.toolTip = QLatin1String("List View Search Line (Kopete)");
108 widget.whatsThis = QLatin1String("Search line able to use Kopete custom list View.");
109 widget.isContainer = false;
110 m_widgets.insert(QLatin1String("Kopete::UI::ListView::SearchLine"), widget);
112 KComponentData("kopetewidgets"); // if it's the only KComponentData object then it stays as
113 // KGlobal::mainComponent()
115 KopeteWidgets::~KopeteWidgets()
119 QWidget *KopeteWidgets::create(const QString &key, QWidget *parent, const char *name)
122 if (key == QLatin1String("Kopete::UI::AddressBookLinkWidget"))
123 return new Kopete::UI::AddressBookLinkWidget(parent, name);
125 if (key == QLatin1String("Kopete::UI::ListView::ListView"))
126 return new Kopete::UI::ListView::ListView(parent, name);
128 if (key == QLatin1String("Kopete::UI::ListView::SearchLine"))
129 return new Kopete::UI::ListView::SearchLine(parent, 0, name);
131 return 0;
133 KDE_Q_EXPORT_PLUGIN(KopeteWidgets)