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
bool Plugin::showCloseWindowMessage()
73
bool Plugin::shouldExitOnclose()
78
void Plugin::aboutToUnload()
80
// Just make the unload synchronous by default
81
emit readyForUnload();
85
void Plugin::deserialize( MetaContact * /* metaContact */,
86
const QMap<QString, QString> & /* stream */ )
88
// Do nothing in default implementation
93
void Kopete::Plugin::addAddressBookField( const QString &field, AddressBookFieldAddMode mode )
95
d->addressBookFields.append( field );
96
if( mode == MakeIndexField )
97
d->indexField = field;
100
QStringList Kopete::Plugin::addressBookFields() const
102
return d->addressBookFields;
105
QString Kopete::Plugin::addressBookIndexField() const
107
return d->indexField;
110
} //END namespace Kopete
112
#include "kopeteplugin.moc"