• 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
kopetemetacontact.h
Go to the documentation of this file.
1 /*
2  kopetemetacontact.h - Kopete Meta Contact
3 
4  Copyright (c) 2002-2003 by Martijn Klingens <klingens@kde.org>
5  Copyright (c) 2002-2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
6  Copyright (c) 2002-2005 by Olivier Goffart <ogoffart@kde.org>
7  Copyright (c) 2003 by Will Stephenson <will@stevello.free-online.co.uk>
8 
9  Kopete (c) 2002-2005 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 kopetemetacontact_h__
22 #define kopetemetacontact_h__
23 
24 #include "kopetecontactlistelement.h"
25 
26 #include <QtCore/QList>
27 #include <QtCore/QUuid>
28 
29 #include <kdemacros.h>
30 #include <kurl.h>
31 #include "kopete_export.h"
32 
33 #include "kopeteonlinestatus.h"
34 #include "kopetestatusmessage.h"
35 
36 namespace Kopete {
37 
38 
39 class Plugin;
40 class Group;
41 class Picture;
42 
54 class KOPETE_EXPORT MetaContact : public ContactListElement
55 {
56  Q_OBJECT
57 
58  Q_PROPERTY( QString displayName READ displayName WRITE setDisplayName )
59  Q_PROPERTY( QString statusString READ statusString )
60  Q_PROPERTY( QString statusIcon READ statusIcon )
61  Q_PROPERTY( bool isOnline READ isOnline )
62  Q_PROPERTY( bool isReachable READ isReachable )
63  Q_PROPERTY( bool isTemporary READ isTemporary )
64  Q_PROPERTY( bool canAcceptFiles READ canAcceptFiles )
65  //Q_PROPERTY( ulong idleTime READ idleTime )
66  Q_PROPERTY( QUuid metaContactId READ metaContactId WRITE setMetaContactId )
67  Q_PROPERTY( bool photoSyncedWithKABC READ isPhotoSyncedWithKABC WRITE setPhotoSyncedWithKABC )
68 
69 public:
70  typedef QList<MetaContact *> List;
75  enum PropertySource {
76  SourceContact ,
77  SourceKABC ,
78  SourceCustom
79  };
80 
84  MetaContact();
88  ~MetaContact();
89 
96  QUuid metaContactId() const;
97 
103  void setMetaContactId( const QUuid& newMetaContactId );
104 
108  QString kabcId() const;
109 
114  void setKabcId( const QString& newKabcId );
115 
119  QList<Contact *> contacts() const;
120 
124  QList<Group *> groups() const;
125 
131  Contact *findContact( const QString &protocolId, const QString &accountId, const QString &contactId );
132 
141  void setDisplayNameSource(PropertySource source);
142 
143  void setDisplayNameSource( const QString &nameSourcePID, const QString &nameSourceAID, const QString &nameSourceCID );
144 
153  PropertySource displayNameSource() const;
154 
163  void setPhotoSource(PropertySource source);
164 
165  void setPhotoSource( const QString &photoSourcePID, const QString &photoSourceAID, const QString &photoSourceCID );
166 
175  PropertySource photoSource() const;
176 
191  QString displayName() const;
192 
203  KDE_DEPRECATED QImage photo() const;
204 
212  Picture &picture() const;
213 
224  void setDisplayName( const QString &name );
225 
232  QString customDisplayName() const;
233 
240  KUrl customPhoto() const;
241 
242 
252  void setPhoto( const KUrl &url );
253 
260  Contact *displayNameSourceContact() const;
261 
266  void setDisplayNameSourceContact( Contact* contact );
267 
271  Contact *photoSourceContact() const;
272 
276  void setPhotoSourceContact( Contact* contact );
277 
281  bool isPhotoSyncedWithKABC() const;
282 
288  void setPhotoSyncedWithKABC(bool b);
289 
290 
296  bool isTemporary() const;
297 
302  void addContact( Contact *c );
303 
312  void removeContact( Contact *c , bool deleted = false );
313 
317  Contact *preferredContact();
318 
323  QString statusIcon() const;
324 
331  QString statusString() const;
332 
338  bool isOnline() const;
339 
343  bool isAlwaysVisible() const;
344 
349  bool canAcceptFiles() const;
350 
356  OnlineStatus::StatusType status() const;
357 
365  bool isReachable() const;
366 
370  quint32 idleTime() const;
371 
391  QString addressBookField( Plugin *p, const QString &app, const QString &key ) const;
392 
402  void setAddressBookField( Plugin *p, const QString &app, const QString &key, const QString &value );
403 
407  StatusMessage statusMessage() const;
408 
409 public slots:
410 
425  void sendFile( const KUrl &sourceURL, const QString &altFileName = QString(),
426  unsigned long fileSize = 0L );
427 
432  void serialize();
433 
434 signals:
439  void contactIdleStateChanged( Kopete::Contact *contact );
440 
444  void statusMessageChanged( Kopete::MetaContact *metaContact );
445 
446 public slots:
447 
451  void moveToGroup( Kopete::Group *from, Kopete::Group *to );
452 
456  void removeFromGroup( Kopete::Group *from );
457 
461  void addToGroup( Kopete::Group *to );
462 
470  void setTemporary( bool b = true, Kopete::Group *group = 0L );
471 
480  Contact *execute();
481 
491  Contact *sendMessage();
492 
503  Contact *startChat();
504 
508  void slotAllPluginsLoaded();
509 
513  void slotPluginLoaded( Kopete::Plugin *plugin );
514 
518  void slotProtocolLoaded( Kopete::Protocol *p );
519 
520 signals:
524  void onlineStatusChanged( Kopete::MetaContact *contact, Kopete::OnlineStatus::StatusType status );
525 
533  void contactStatusChanged( Kopete::Contact *contact, const Kopete::OnlineStatus &status );
534 
538  void displayNameChanged( const QString &oldName, const QString &newName );
539 
543  void photoChanged();
544 
548  void movedToGroup( Kopete::MetaContact *contact, Kopete::Group *from, Kopete::Group *to );
549 
553  void removedFromGroup( Kopete::MetaContact *contact, Kopete::Group *group );
554 
558  void addedToGroup( Kopete::MetaContact *contact, Kopete::Group *to );
559 
565  void contactAdded( Kopete::Contact *c );
566 
572  void contactRemoved( Kopete::Contact *c );
573 
577  void persistentDataChanged( );
578 
579 private slots:
584  void updateOnlineStatus();
585 
589  void slotContactStatusChanged( Kopete::Contact *c, const Kopete::OnlineStatus &status, const Kopete::OnlineStatus &oldStatus );
590 
594  void slotPropertyChanged( Kopete::PropertyContainer *contact, const QString &key, const QVariant &oldValue, const QVariant &newValue );
595 
596  void slotContactDisplayNameChanged( const QString &oldName, const QString &newName );
597 
602  void slotContactDestroyed( Kopete::Contact* );
603 
607  void slotUpdateAddressBookPicture();
608 
609 protected:
610  //QImage photoFromContact( Kopete::Contact *c) const;
611  //QImage photoFromKABC( const QString &id ) const;
612  QImage photoFromCustom() const;
613  //QString nameFromContact( Kopete::Contact *c) const;
614  //QString nameFromKABC( const QString &id ) const;
615 
616  void onlineStatusNotification( Kopete::Contact * c );
617 
618 private:
619  class Private;
620  Private * const d;
621 };
622 
623 // util functions shared with metacontact property dialog
624 KOPETE_EXPORT QImage photoFromContact( Kopete::Contact *c) /*const*/;
625 KOPETE_EXPORT QImage photoFromKABC( const QString &id ) /*const*/;
626 KOPETE_EXPORT QString nameFromContact( Kopete::Contact *c) /*const*/;
627 KOPETE_EXPORT QString nameFromKABC( const QString &id ) /*const*/;
628 
629 } //END namespace Kopete
630 
631 
632 #endif
633 
634 // vim: set noet ts=4 sts=4 sw=4:
635 
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::Picture
Represent a picture in Kopete context.
Definition: kopetepicture.h:61
Kopete::nameFromContact
QString nameFromContact(Kopete::Contact *c)
Definition: kopetemetacontact.cpp:719
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
QUuid
kopeteonlinestatus.h
Kopete::MetaContact::PropertySource
PropertySource
Enumeration of possible sources for a property (which may be photos, see setPhotoSource() for instanc...
Definition: kopetemetacontact.h:75
Kopete::photoFromKABC
QImage photoFromKABC(const QString &id)
Definition: kopetemetacontact.cpp:790
Kopete::ContactListElement
Definition: kopetecontactlistelement.h:46
kopetestatusmessage.h
Kopete::photoFromContact
QImage photoFromContact(Kopete::Contact *contact)
Definition: kopetemetacontact.cpp:769
kopete_export.h
QString
QList
Kopete::Contact
Definition: kopetecontact.h:58
Kopete::Plugin
Base class for all plugins or protocols.
Definition: kopeteplugin.h:84
QImage
Kopete::Group
Class which represents the Group.
Definition: kopetegroup.h:44
Kopete::PropertyContainer
Definition: kopetepropertycontainer.h:39
Kopete::nameFromKABC
QString nameFromKABC(const QString &id)
Definition: kopetemetacontact.cpp:700
Kopete::MetaContact
Definition: kopetemetacontact.h:54
Kopete::OnlineStatus::StatusType
StatusType
The available global states.
Definition: kopeteonlinestatus.h:78
name
const char * name
Definition: kopeteonlinestatus.cpp:104
QVariant
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