6 #include <qwidgetplugin.h>
9 #include <kcomponentdata.h>
14 #include <kstandarddirs.h>
17 class KopeteWidgets :
public QWidgetPlugin
22 virtual ~KopeteWidgets();
24 virtual QStringList keys()
const
27 for (WidgetInfos::ConstIterator it = m_widgets.begin(); it != m_widgets.end(); ++it)
32 virtual QWidget *create(
const QString &key,
QWidget *parent = 0,
const char *
name = 0);
34 virtual QIcon iconSet(
const QString &key)
const
37 QPixmap pix(m_widgets[key].iconSet);
39 QPixmap pix(KStandardDirs::locate(
"data",
40 QLatin1String(
"kopetewidgets/pics/") + m_widgets[key].iconSet));
45 virtual bool isContainer(
const QString &key)
const {
return m_widgets[key].isContainer; }
47 virtual QString group(
const QString &key)
const {
return m_widgets[key].group; }
49 virtual QString includeFile(
const QString &key)
const {
return m_widgets[key].includeFile; }
51 virtual QString toolTip(
const QString &key)
const {
return m_widgets[key].toolTip; }
53 virtual QString whatsThis(
const QString &key)
const {
return m_widgets[key].whatsThis; }
68 typedef QMap<QString, WidgetInfo> WidgetInfos;
69 WidgetInfos m_widgets;
71 KopeteWidgets::KopeteWidgets()
75 widget.group = QLatin1String(
"Input (Kopete)");
77 widget.iconSet = QPixmap(kopete__ui__addressbooklinkwidget_xpm);
79 widget.iconSet = QLatin1String(
"kopete__ui__addressbooklinkwidget.png");
81 widget.includeFile = QLatin1String(
"addressbooklinkwidget.h");
82 widget.toolTip = QLatin1String(
"Address Book Link Widget (Kopete)");
83 widget.whatsThis = QLatin1String(
"KABC::Addressee display/selector");
84 widget.isContainer =
false;
85 m_widgets.insert(QLatin1String(
"Kopete::UI::AddressBookLinkWidget"), widget);
87 widget.group = QLatin1String(
"Views (Kopete)");
89 widget.iconSet = QPixmap(kopete__ui__listview__listview_xpm);
91 widget.iconSet = QLatin1String(
"kopete__ui__listview__listview.png");
93 widget.includeFile = QLatin1String(
"kopetelistview.h");
94 widget.toolTip = QLatin1String(
"List View (Kopete)");
95 widget.whatsThis = QLatin1String(
"A component capable list view widget.");
96 widget.isContainer =
false;
97 m_widgets.insert(QLatin1String(
"Kopete::UI::ListView::ListView"), widget);
99 widget.group = QLatin1String(
"Input (Kopete)");
101 widget.iconSet = QPixmap(kopete__ui__listview__searchline_xpm);
103 widget.iconSet = QLatin1String(
"kopete__ui__listview__searchline.png");
105 widget.includeFile = QLatin1String(
"kopetelistviewsearchline.h");
106 widget.toolTip = QLatin1String(
"List View Search Line (Kopete)");
107 widget.whatsThis = QLatin1String(
"Search line able to use Kopete custom list View.");
108 widget.isContainer =
false;
109 m_widgets.insert(QLatin1String(
"Kopete::UI::ListView::SearchLine"), widget);
111 KComponentData(
"kopetewidgets");
114 KopeteWidgets::~KopeteWidgets()
121 if (key == QLatin1String(
"Kopete::UI::AddressBookLinkWidget"))
124 if (key == QLatin1String(
"Kopete::UI::ListView::ListView"))
127 if (key == QLatin1String(
"Kopete::UI::ListView::SearchLine"))
132 KDE_Q_EXPORT_PLUGIN(KopeteWidgets)