kopete/libkopete
kopeteprotocol.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KOPETEPROTOCOL_H
00022 #define KOPETEPROTOCOL_H
00023
00024 #include <QtCore/QFlags>
00025
00026 #include "kopeteplugin.h"
00027 #include "kopeteonlinestatus.h"
00028
00029 class KopeteEditAccountWidget;
00030 class AddContactPage;
00031 class KJob;
00032
00033 #include "kopete_export.h"
00034
00035 namespace Kopete
00036 {
00037
00038 class Contact;
00039 class MetaContact;
00040 class Account;
00041
00042
00043
00044
00045
00046
00047
00048
00062 class KOPETE_EXPORT Protocol : public Plugin
00063 {
00064 Q_OBJECT
00065
00066 public:
00067
00071 virtual ~Protocol();
00072
00085 virtual Account *createNewAccount( const QString &accountId ) = 0;
00086
00092 virtual AddContactPage *createAddContactWidget( QWidget *parent, Account *account ) = 0;
00093
00102 virtual KopeteEditAccountWidget * createEditAccountWidget( Account *account, QWidget *parent ) = 0;
00103
00110 enum Capability
00111 {
00112 BaseFgColor = 0x1,
00113 BaseBgColor = 0x2,
00114 RichFgColor = 0x4,
00115 RichBgColor = 0x8,
00116
00117 BaseFont = 0x10,
00118 RichFont = 0x20,
00119
00121 BaseUFormatting = 0x40,
00122 BaseIFormatting = 0x80,
00123 BaseBFormatting = 0x100,
00124
00126 RichUFormatting = 0x200,
00127 RichIFormatting = 0x400,
00128 RichBFormatting = 0x800,
00129
00130 Alignment = 0x1000,
00131
00133 BaseFormatting = BaseIFormatting | BaseUFormatting | BaseBFormatting,
00134
00136 RichFormatting = RichIFormatting | RichUFormatting | RichBFormatting,
00137
00138 RichColor = RichBgColor | RichFgColor,
00139 BaseColor = BaseBgColor | BaseFgColor,
00140
00141
00142 FullRTF = RichFormatting | Alignment | RichFont | RichFgColor | RichBgColor ,
00143
00144
00145 CanSendOffline = 0x10000
00146 };
00147 Q_DECLARE_FLAGS(Capabilities, Capability)
00148
00149
00153 Capabilities capabilities() const;
00154
00158 Kopete::OnlineStatus accountOfflineStatus() const;
00159
00160
00161 protected:
00169 Protocol( const KComponentData &instance, QObject *parent );
00170
00177 void setCapabilities( Capabilities );
00178
00179 public:
00180
00199 virtual void aboutToUnload();
00200
00201 private slots:
00206 void slotAccountOnlineStatusChanged( Kopete::Contact *self );
00207
00213 void slotAccountDestroyed( );
00214
00215
00216 public:
00217
00230 virtual void deserialize( MetaContact *metaContact, const QMap<QString, QString> &serializedData );
00231
00247 virtual Contact *deserializeContact( MetaContact *metaContact,
00248 const QMap<QString, QString> &serializedData,
00249 const QMap<QString, QString> &addressBookData );
00250
00280 virtual KJob *createProtocolTask(const QString &taskType);
00281
00287 virtual bool validatePassword( const QString & password ) const;
00288
00289 public slots:
00297 void slotMetaContactAboutToSave( Kopete::MetaContact *metaContact );
00298
00299
00300 private:
00301 class Private;
00302 Private *d;
00303 };
00304
00305 Q_DECLARE_OPERATORS_FOR_FLAGS(Protocol::Capabilities)
00306
00307 }
00308
00309 #endif
00310