• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/libkopete

  • sources
  • kde-4.14
  • kdenetwork
  • kopete
  • libkopete
kopeteprotocol.h
Go to the documentation of this file.
1 /*
2  kopeteprotocol.h - Kopete Protocol
3 
4  Copyright (c) 2002 by Duncan Mac-Vicar Prett <duncan@kde.org>
5  Copyright (c) 2002-2003 by Martijn Klingens <klingens@kde.org>
6  Copyright (c) 2002-2005 by Olivier Goffart <ogoffart@kde.org>
7  Copyright (c) 2007 by MichaĆ«l Larouche <larouche@kde.org>
8 
9  Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
10 
11  *************************************************************************
12  * *
13  * This library is free software; you can redistribute it and/or *
14  * modify it under the terms of the GNU Lesser General Public *
15  * License as published by the Free Software Foundation; either *
16  * version 2 of the License, or (at your option) any later version. *
17  * *
18  *************************************************************************
19 */
20 
21 #ifndef KOPETEPROTOCOL_H
22 #define KOPETEPROTOCOL_H
23 
24 #include <QtCore/QFlags>
25 
26 #include "kopeteplugin.h"
27 #include "kopeteonlinestatus.h"
28 
29 class KopeteEditAccountWidget;
30 class AddContactPage;
31 class KJob;
32 
33 #include "kopete_export.h"
34 
35 namespace Kopete
36 {
37 
38 class Contact;
39 class MetaContact;
40 class Account;
41 
42 /*namespace UI
43 {
44  class EditAccountWidget;
45  class AddContactPage;
46 }*/
47 
48 
62 class KOPETE_EXPORT Protocol : public Plugin
63 {
64  Q_OBJECT
65 
66 public:
67 
71  virtual ~Protocol();
72 
85  virtual Account *createNewAccount( const QString &accountId ) = 0;
86 
92  virtual AddContactPage *createAddContactWidget( QWidget *parent, Account *account ) = 0;
93 
102  virtual KopeteEditAccountWidget * createEditAccountWidget( Account *account, QWidget *parent ) = 0;
103 
110  enum Capability
111  {
112  BaseFgColor = 0x1,
113  BaseBgColor = 0x2,
114  RichFgColor = 0x4,
115  RichBgColor = 0x8,
116 
117  BaseFont = 0x10,
118  RichFont = 0x20,
119 
121  BaseUFormatting = 0x40,
122  BaseIFormatting = 0x80,
123  BaseBFormatting = 0x100,
124 
126  RichUFormatting = 0x200,
127  RichIFormatting = 0x400,
128  RichBFormatting = 0x800,
129 
130  Alignment = 0x1000,
131 
133  BaseFormatting = BaseIFormatting | BaseUFormatting | BaseBFormatting,
134 
136  RichFormatting = RichIFormatting | RichUFormatting | RichBFormatting,
137 
138  RichColor = RichBgColor | RichFgColor,
139  BaseColor = BaseBgColor | BaseFgColor,
140 
141  //Shortcut for All of the above - full HTML
142  FullRTF = RichFormatting | Alignment | RichFont | RichFgColor | RichBgColor ,
143 
144 
145  CanSendOffline = 0x10000
146  };
147  Q_DECLARE_FLAGS(Capabilities, Capability)
148 
149 
153  Capabilities capabilities() const;
154 
158  bool canAddMyself() const;
159 
163  Kopete::OnlineStatus accountOfflineStatus() const;
164 
165 
166 protected:
174  Protocol( const KComponentData &instance, QObject *parent, bool canAddMyself = false );
175 
182  void setCapabilities( Capabilities );
183 
184 public:
185 
204  virtual void aboutToUnload();
205 
206 private slots:
211  void slotAccountOnlineStatusChanged( Kopete::Contact *self );
212 
218  void slotAccountDestroyed( );
219 
220 
221 public:
222 
235  virtual void deserialize( MetaContact *metaContact, const QMap<QString, QString> &serializedData );
236 
240  virtual void deserializeContactList( MetaContact *metaContact, const QList< QMap<QString, QString> > &dataList );
241 
257  virtual Contact *deserializeContact( MetaContact *metaContact,
258  const QMap<QString, QString> &serializedData,
259  const QMap<QString, QString> &addressBookData );
260 
290  virtual KJob *createProtocolTask(const QString &taskType);
291 
297  virtual bool validatePassword( const QString & password ) const;
298 
299 public:
307  void serialize( Kopete::MetaContact *metaContact );
308 
309 
310 private:
311  class Private;
312  Private * const d;
313 };
314 
315 Q_DECLARE_OPERATORS_FOR_FLAGS(Protocol::Capabilities)
316 
317 } //END namespace kopete
318 
319 #endif
320 
KOPETE_EXPORT
#define KOPETE_EXPORT
Definition: kopete_export.h:27
Kopete::OnlineStatus
Definition: kopeteonlinestatus.h:68
QWidget
Kopete::Protocol
base class of every protocol.
Definition: kopeteprotocol.h:62
QMap
Kopete::Protocol::Capability
Capability
Available capabilities.
Definition: kopeteprotocol.h:110
kopeteonlinestatus.h
AddContactPage
Definition: addcontactpage.h:33
QObject
kopete_export.h
QString
QList
Kopete::Contact
Definition: kopetecontact.h:58
Kopete::Plugin
Base class for all plugins or protocols.
Definition: kopeteplugin.h:84
KopeteEditAccountWidget
Definition: editaccountwidget.h:55
kopeteplugin.h
Kopete::MetaContact
Definition: kopetemetacontact.h:54
Kopete::Account
The Kopete::Account class handles one account.
Definition: kopeteaccount.h:72
KJob
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal