2 kopeteplugin.cpp - Kopete Plugin API
4 Copyright (c) 2001-2002 by Duncan Mac-Vicar P. <duncan@kde.org>
5 Copyright (c) 2002-2004 by Olivier Goffart <ogoffart @tiscalinet.be>
7 Copyright (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of the GNU Lesser General Public *
13 * License as published by the Free Software Foundation; either *
14 * version 2 of the License, or (at your option) any later version. *
16 *************************************************************************
19 #include "kopeteplugin.h"
20 #include "kopetepluginmanager.h"
22 #include <kplugininfo.h>
23 #include <ksettings/dispatcher.h>
30 QStringList addressBookFields
;
34 Plugin::Plugin( const KComponentData
&instance
, QObject
*parent
)
35 : QObject( parent
), KXMLGUIClient(), d(new Private
)
37 setComponentData( instance
);
38 KSettings::Dispatcher::registerComponent( instance
, this, "settingsChanged" );
46 QString
Plugin::pluginId() const
48 return QString::fromLatin1( metaObject()->className() );
52 QString
Plugin::displayName() const
54 return pluginInfo().isValid() ? pluginInfo().name() : QString();
57 QString
Plugin::pluginIcon() const
59 return pluginInfo().isValid() ? pluginInfo().icon() : QString();
63 KPluginInfo
Plugin::pluginInfo() const
65 return PluginManager::self()->pluginInfo( this );
68 void Plugin::aboutToUnload()
70 // Just make the unload synchronous by default
71 emit
readyForUnload();
75 void Plugin::deserialize( MetaContact
* /* metaContact */,
76 const QMap
<QString
, QString
> & /* stream */ )
78 // Do nothing in default implementation
83 void Kopete::Plugin::addAddressBookField( const QString
&field
, AddressBookFieldAddMode mode
)
85 d
->addressBookFields
.append( field
);
86 if( mode
== MakeIndexField
)
87 d
->indexField
= field
;
90 QStringList
Kopete::Plugin::addressBookFields() const
92 return d
->addressBookFields
;
95 QString
Kopete::Plugin::addressBookIndexField() const
100 } //END namespace Kopete
102 #include "kopeteplugin.moc"