• 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.12
  • kdenetwork
  • kopete
  • libkopete
kopetecontact.h
Go to the documentation of this file.
1 /*
2  kopetecontact.h - Kopete Contact
3 
4  Copyright (c) 2002-2004 by Duncan Mac-Vicar Prett <duncan@kde.org>
5  Copyright (c) 2002-2003 by Martijn Klingens <klingens@kde.org>
6  Copyright (c) 2002-2004 by Olivier Goffart <ogoffart@kde.org>
7 
8  Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
9 
10  *************************************************************************
11  * *
12  * This library is free software; you can redistribute it and/or *
13  * modify it under the terms of the GNU Lesser General Public *
14  * License as published by the Free Software Foundation; either *
15  * version 2 of the License, or (at your option) any later version. *
16  * *
17  *************************************************************************
18 */
19 
20 #ifndef KOPETECONTACT_H
21 #define KOPETECONTACT_H
22 
23 #include "kopetecontactlistelement.h"
24 #include "kopetepropertycontainer.h"
25 
26 #include <kurl.h>
27 #include <kdemacros.h>
28 #include <ktoggleaction.h>
29 #include "kopeteglobal.h"
30 
31 #include "kopete_export.h"
32 
33 class KMenu;
34 class KAction;
35 
36 namespace Kopete
37 {
38 
39 class Group;
40 class MetaContact;
41 class ChatSession;
42 class OnlineStatus;
43 class Plugin;
44 class Protocol;
45 class Account;
46 class StatusMessage;
47 
48 typedef QList<Group *> GroupList;
49 
58 class KOPETE_EXPORT Contact
59  : public ContactListElement
60 {
61  Q_OBJECT
62 
63  Q_ENUMS( CanCreateFlags )
64  Q_PROPERTY( QString formattedName READ formattedName )
65  Q_PROPERTY( QString formattedIdleTime READ formattedIdleTime )
66  Q_PROPERTY( bool isOnline READ isOnline )
67  Q_PROPERTY( bool fileCapable READ isFileCapable WRITE setFileCapable )
68  Q_PROPERTY( bool canAcceptFiles READ canAcceptFiles )
69  //Q_PROPERTY( bool isReachable READ isReachable )
70  Q_PROPERTY( QString contactId READ contactId )
71  Q_PROPERTY( QString icon READ icon WRITE setIcon )
72  Q_PROPERTY( QString toolTip READ toolTip )
73  Q_PROPERTY( QString nickName READ nickName WRITE setNickName )
74  //Q_PROPERTY( unsigned long idleTime READ idleTime WRITE setIdleTime )
75 
76 public:
80  enum Changed{ MovedBetweenGroup = 0x01,
81  DisplayNameChanged = 0x02
82  };
83 
101  Contact( Account *account, const QString &id, MetaContact *parent,
102  const QString &icon = QString() );
103 
104  ~Contact();
105 
110  MetaContact *metaContact() const;
111 
112 
125  QString contactId() const;
126 
134  Protocol* protocol() const;
135 
141  Account* account() const;
142 
151  void setMetaContact(MetaContact *m);
152 
157  bool isOnline() const;
158 
168  // FIXME: After KDE 3.2 we should split this into a public, NON-virtual
169  // isReachable() accessor that checks for account->isConnected()
170  // and then calls a new virtual method that does the
171  // protocol-specific work, like 'doIsUnreachable' or so - Martijn
172  //
173  //FIXME: Can this be made const please? - JK
174  virtual bool isReachable();
175 
196  virtual void serialize( QMap<QString, QString> &serializedData, QMap<QString, QString> &addressBookData );
197 
202  OnlineStatus onlineStatus() const;
203 
207  void setOnlineStatus(const OnlineStatus &status);
208 
213  Kopete::StatusMessage statusMessage() const;
218  void setStatusMessage(const Kopete::StatusMessage &statusMessage);
219 
232  virtual QList<KAction *> *customContextMenuActions();
233 
237  virtual KDE_DEPRECATED QList<KAction *> *customContextMenuActions( ChatSession *manager );
238 
245  KMenu *popupMenu();
246 
250  KDE_DEPRECATED KMenu *popupMenu( ChatSession *manager );
251 
262  bool isFileCapable() const;
263 
270  void setFileCapable( bool filecap );
271 
281  bool canAcceptFiles() const;
282 
283  enum CanCreateFlags { CannotCreate=false , CanCreate=true };
284 
296  virtual ChatSession * manager( CanCreateFlags canCreate = CannotCreate ) =0;
297 
303  QString& icon() const;
304 
313  void setIcon( const QString& icon );
314 
324  virtual unsigned long int idleTime() const;
325 
334  void setIdleTime(unsigned long int);
335 
340  void setNickName( const QString &name );
341 
347  QString nickName() const;
348 
354  QString toolTip() const;
355 
361  QString formattedName() const;
362 
367  QString formattedIdleTime() const;
368 
373  void setPhoto(const QString &photoPath);
374 
375 public slots:
379  void startChat();
380 
384  void sendMessage();
385 
389  void execute();
390 
396  void toggleAlwaysVisible();
397 
403  void changeMetaContact();
411  virtual void slotUserInfo() {}
412 
424  virtual void sync(unsigned int changed = 0xFF);
425 
434  virtual KDE_DEPRECATED void deleteContact();
435 
449  virtual void sendFile( const KUrl &sourceURL = KUrl(),
450  const QString &fileName = QString(), uint fileSize = 0L );
451 private slots:
455  void slotAddContact();
456 
460  void slotDelete();
461 
465  void slotBlock();
466 
470  void slotUnblock();
471 
475  void slotAccountIsConnectedChanged();
476 
480  void slotMetaContactDestroyed( QObject* mc );
481 signals:
485  void onlineStatusChanged( Kopete::Contact *contact,
486  const Kopete::OnlineStatus &status, const Kopete::OnlineStatus &oldStatus );
487 
491  void statusMessageChanged( Kopete::Contact *contact );
492 
501  void contactDestroyed( Kopete::Contact *contact );
502 
508  void idleStateChanged( Kopete::Contact *contact );
509 
513  void canAcceptFilesChanged();
514 
515 private:
516  class Private;
517  Private * const d;
518 
519 
520 };
521 
522 
523 } //END namespace Kopete
524 
525 #endif
526 
KOPETE_EXPORT
#define KOPETE_EXPORT
Definition: kopete_export.h:27
Kopete::OnlineStatus
Definition: kopeteonlinestatus.h:68
status
OnlineStatus::StatusType status
Definition: kopeteonlinestatus.cpp:103
Kopete::StatusMessage
This class encapsulate a status message.
Definition: kopetestatusmessage.h:48
kopetecontactlistelement.h
Kopete::Protocol
base class of every protocol.
Definition: kopeteprotocol.h:62
Kopete::Contact::Changed
Changed
used in sync()
Definition: kopetecontact.h:80
QObject
Kopete::ChatSession
Definition: kopetechatsession.h:74
kopetepropertycontainer.h
Kopete::Contact::slotUserInfo
virtual void slotUserInfo()
Method to retrieve user information.
Definition: kopetecontact.h:411
Kopete::ContactListElement
Definition: kopetecontactlistelement.h:46
kopete_export.h
Kopete::Contact
Definition: kopetecontact.h:58
Kopete::Contact::CanCreateFlags
CanCreateFlags
Definition: kopetecontact.h:283
KAction
Kopete::MetaContact
Definition: kopetemetacontact.h:54
Kopete::Account
The Kopete::Account class handles one account.
Definition: kopeteaccount.h:72
kopeteglobal.h
name
const char * name
Definition: kopeteonlinestatus.cpp:104
Kopete::GroupList
QList< Group * > GroupList
Definition: kopetecontact.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:51 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