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

kopete/libkopete

kopetemetacontact.h

Go to the documentation of this file.
00001 /*
00002     kopetemetacontact.h - Kopete Meta Contact
00003 
00004     Copyright (c) 2002-2003 by Martijn Klingens       <klingens@kde.org>
00005     Copyright (c) 2002-2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
00006     Copyright (c) 2002-2005 by Olivier Goffart        <ogoffart@kde.org>
00007     Copyright (c) 2003      by Will Stephenson        <will@stevello.free-online.co.uk>
00008 
00009     Kopete    (c) 2002-2005 by the Kopete developers  <kopete-devel@kde.org>
00010 
00011     *************************************************************************
00012     *                                                                       *
00013     * This library is free software; you can redistribute it and/or         *
00014     * modify it under the terms of the GNU Lesser General Public            *
00015     * License as published by the Free Software Foundation; either          *
00016     * version 2 of the License, or (at your option) any later version.      *
00017     *                                                                       *
00018     *************************************************************************
00019 */
00020 
00021 #ifndef kopetemetacontact_h__
00022 #define kopetemetacontact_h__
00023 
00024 #include "kopetecontactlistelement.h"
00025 
00026 #include <QtCore/QList>
00027 
00028 #include <kdemacros.h>
00029 #include <kurl.h>
00030 #include "kopete_export.h"
00031 
00032 #include "kopeteonlinestatus.h"
00033 
00034 namespace Kopete {
00035 
00036 
00037 class Plugin;
00038 class Group;
00039 class Picture;
00040 
00052 class KOPETE_EXPORT MetaContact : public ContactListElement
00053 {
00054     Q_OBJECT
00055 
00056     Q_PROPERTY( QString displayName READ displayName WRITE setDisplayName )
00057     Q_PROPERTY( QString statusString READ statusString )
00058     Q_PROPERTY( QString statusIcon READ statusIcon )
00059     Q_PROPERTY( bool isOnline READ isOnline )
00060     Q_PROPERTY( bool isReachable READ isReachable )
00061     Q_PROPERTY( bool isTemporary READ isTemporary )
00062     Q_PROPERTY( bool canAcceptFiles READ canAcceptFiles )
00063     //Q_PROPERTY( ulong idleTime READ idleTime )
00064     Q_PROPERTY( QString metaContactId READ metaContactId WRITE setMetaContactId )
00065     Q_PROPERTY( bool photoSyncedWithKABC READ isPhotoSyncedWithKABC WRITE setPhotoSyncedWithKABC )
00066 
00067 public:
00068     typedef QList<MetaContact *> List;
00073     enum PropertySource { 
00074         SourceContact , 
00075         SourceKABC , 
00076         SourceCustom 
00077     };
00078 
00082     MetaContact();
00086     ~MetaContact();
00087 
00094     QString metaContactId() const;
00095 
00100     void setMetaContactId( const QString& newMetaContactId );
00101 
00105     QList<Contact *> contacts() const;
00106 
00110     QList<Group *> groups() const;
00111 
00117     Contact *findContact( const QString &protocolId, const QString &accountId, const QString &contactId );
00118 
00127     void setDisplayNameSource(PropertySource source);
00128 
00129     void setDisplayNameSource( const QString &nameSourcePID, const QString &nameSourceAID, const QString &nameSourceCID );
00130 
00139     PropertySource displayNameSource() const;
00140 
00149     void setPhotoSource(PropertySource source);
00150 
00151     void setPhotoSource( const QString &photoSourcePID, const QString &photoSourceAID, const QString &photoSourceCID );
00152 
00161     PropertySource photoSource() const;
00162 
00177     QString displayName() const;
00178 
00189     KDE_DEPRECATED QImage photo() const;
00190 
00198     Picture &picture() const;
00199 
00210     void setDisplayName( const QString &name );
00211 
00218     QString customDisplayName() const;
00219 
00226     KUrl customPhoto() const;
00227 
00228 
00238     void setPhoto( const KUrl &url );
00239 
00246     Contact *displayNameSourceContact() const;
00247 
00252     void setDisplayNameSourceContact( Contact* contact );
00253 
00257     Contact *photoSourceContact() const;
00258 
00262     void setPhotoSourceContact( Contact* contact );
00263 
00267     bool isPhotoSyncedWithKABC() const;
00268 
00274     void setPhotoSyncedWithKABC(bool b);
00275 
00276 
00282     bool isTemporary() const;
00283 
00288     void addContact( Contact *c );
00289 
00298     void removeContact( Contact *c , bool deleted = false );
00299 
00303     Contact *preferredContact();
00304 
00309     QString statusIcon() const;
00310 
00317     QString statusString() const;
00318 
00324     bool isOnline() const;
00325 
00330     bool canAcceptFiles() const;
00331 
00337     OnlineStatus::StatusType status() const;
00338 
00346     bool isReachable() const;
00347 
00351     unsigned long int idleTime() const;
00352 
00372     QString addressBookField( Plugin *p, const QString &app, const QString &key ) const;
00373 
00383     void setAddressBookField( Plugin *p, const QString &app, const QString &key, const QString &value );
00384 
00385 public slots:
00386 
00401     void sendFile( const KUrl &sourceURL, const QString &altFileName = QString(),
00402         unsigned long fileSize = 0L );
00403 
00407     void emitAboutToSave();
00408 
00409 signals:
00414     void aboutToSave( Kopete::MetaContact *metaContact );
00415 
00420     void contactIdleStateChanged( Kopete::Contact *contact );
00421 
00422 
00423 public slots:
00424 
00428     void moveToGroup( Kopete::Group *from, Kopete::Group *to );
00429 
00433     void removeFromGroup( Kopete::Group *from );
00434 
00438     void addToGroup( Kopete::Group *to );
00439 
00447     void setTemporary( bool b = true, Kopete::Group *group = 0L );
00448 
00457     Contact *execute();
00458 
00468     Contact *sendMessage();
00469 
00480     Contact *startChat();
00481 
00485     void slotAllPluginsLoaded();
00486 
00490     void slotPluginLoaded( Kopete::Plugin *plugin );
00491 
00492 signals:
00496     void onlineStatusChanged( Kopete::MetaContact *contact, Kopete::OnlineStatus::StatusType status );
00497 
00505     void contactStatusChanged( Kopete::Contact *contact, const Kopete::OnlineStatus &status );
00506 
00510     void displayNameChanged( const QString &oldName, const QString &newName );
00511 
00515     void photoChanged();
00516 
00520     void movedToGroup( Kopete::MetaContact *contact, Kopete::Group *from, Kopete::Group *to );
00521 
00525     void removedFromGroup( Kopete::MetaContact *contact, Kopete::Group *group );
00526 
00530     void addedToGroup( Kopete::MetaContact *contact, Kopete::Group *to );
00531 
00537     void contactAdded( Kopete::Contact *c );
00538 
00544     void contactRemoved( Kopete::Contact *c );
00545 
00549     void persistentDataChanged(  );
00550 
00551 private slots:
00556     void updateOnlineStatus();
00557 
00561     void slotContactStatusChanged( Kopete::Contact *c, const Kopete::OnlineStatus &status, const Kopete::OnlineStatus &oldStatus );
00562 
00566     void slotPropertyChanged( Kopete::PropertyContainer *contact, const QString &key, const QVariant &oldValue, const QVariant &newValue  );
00567 
00572     void slotContactDestroyed( Kopete::Contact* );
00573 
00577     void slotUpdateAddressBookPicture();
00578 
00579 protected:
00580     //QImage photoFromContact( Kopete::Contact *c) const;
00581     //QImage photoFromKABC( const QString &id ) const;
00582     QImage photoFromCustom() const;
00583     //QString nameFromContact( Kopete::Contact *c) const;
00584     //QString nameFromKABC( const QString &id ) const;
00585 
00586 private:
00587     class Private;
00588     Private *d;
00589 };
00590 
00591 // util functions shared with metacontact property dialog
00592 KOPETE_EXPORT QImage photoFromContact( Kopete::Contact *c) /*const*/;
00593 KOPETE_EXPORT QImage photoFromKABC( const QString &id ) /*const*/;
00594 KOPETE_EXPORT QString nameFromContact( Kopete::Contact *c) /*const*/;
00595 KOPETE_EXPORT QString nameFromKABC( const QString &id ) /*const*/;
00596 
00597 } //END namespace Kopete
00598 
00599 
00600 #endif
00601 
00602 // vim: set noet ts=4 sts=4 sw=4:
00603 

kopete/libkopete

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

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal