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

kopete/libkopete

kopetecontact.h

Go to the documentation of this file.
00001 /*
00002     kopetecontact.h - Kopete Contact
00003 
00004     Copyright (c) 2002-2004 by Duncan Mac-Vicar Prett <duncan@kde.org>
00005     Copyright (c) 2002-2003 by Martijn Klingens       <klingens@kde.org>
00006     Copyright (c) 2002-2004 by Olivier Goffart        <ogoffart@kde.org>
00007 
00008     Kopete    (c) 2002-2004 by the Kopete developers  <kopete-devel@kde.org>
00009 
00010     *************************************************************************
00011     *                                                                       *
00012     * This library is free software; you can redistribute it and/or         *
00013     * modify it under the terms of the GNU Lesser General Public            *
00014     * License as published by the Free Software Foundation; either          *
00015     * version 2 of the License, or (at your option) any later version.      *
00016     *                                                                       *
00017     *************************************************************************
00018 */
00019 
00020 #ifndef KOPETECONTACT_H
00021 #define KOPETECONTACT_H
00022 
00023 #include "kopetecontactlistelement.h"
00024 #include "kopetepropertycontainer.h"
00025 
00026 #include <kurl.h>
00027 #include <kdemacros.h>
00028 #include "kopeteglobal.h"
00029 
00030 #include "kopete_export.h"
00031 
00032 class KMenu;
00033 class KAction;
00034 
00035 namespace Kopete
00036 {
00037 
00038 class Group;
00039 class MetaContact;
00040 class ChatSession;
00041 class OnlineStatus;
00042 class Plugin;
00043 class Protocol;
00044 class Account;
00045 class StatusMessage;
00046 
00047 typedef QList<Group *> GroupList;
00048 
00057 class KOPETE_EXPORT Contact
00058     : public ContactListElement
00059 {
00060     Q_OBJECT
00061 
00062     Q_ENUMS( CanCreateFlags )
00063     Q_PROPERTY( QString formattedName READ formattedName )
00064     Q_PROPERTY( QString formattedIdleTime READ formattedIdleTime )
00065     Q_PROPERTY( bool isOnline READ isOnline )
00066     Q_PROPERTY( bool fileCapable READ isFileCapable WRITE setFileCapable )
00067     Q_PROPERTY( bool canAcceptFiles READ canAcceptFiles )
00068     //Q_PROPERTY( bool isReachable READ isReachable )
00069     Q_PROPERTY( QString contactId READ contactId )
00070     Q_PROPERTY( QString icon READ icon WRITE setIcon )
00071     Q_PROPERTY( QString toolTip READ toolTip )
00072     Q_PROPERTY( QString nickName READ nickName WRITE setNickName )
00073     //Q_PROPERTY( unsigned long idleTime READ idleTime WRITE setIdleTime )
00074 
00075 public: 
00079     enum Changed{ MovedBetweenGroup = 0x01, 
00080               DisplayNameChanged = 0x02 
00081     };
00082 
00100     Contact( Account *account, const QString &id, MetaContact *parent,
00101         const QString &icon = QString() );
00102 
00103     ~Contact();
00104 
00109     MetaContact *metaContact() const;
00110 
00111 
00124     QString contactId() const;
00125 
00133     Protocol* protocol() const;
00134 
00140     Account* account() const;
00141 
00150     void setMetaContact(MetaContact *m);
00151 
00156     bool isOnline() const;
00157 
00167     // FIXME: After KDE 3.2 we should split this into a public, NON-virtual
00168     //        isReachable() accessor that checks for account->isConnected()
00169     //        and then calls a new virtual method that does the
00170     //        protocol-specific work, like 'doIsUnreachable' or so - Martijn
00171     //
00172     //FIXME: Can this be made const please? - JK
00173     virtual bool isReachable();
00174 
00195     virtual void serialize( QMap<QString, QString> &serializedData, QMap<QString, QString> &addressBookData );
00196 
00201     OnlineStatus onlineStatus() const;
00202 
00206     void setOnlineStatus(const OnlineStatus &status);
00207 
00212     Kopete::StatusMessage statusMessage() const;
00217     void setStatusMessage(const Kopete::StatusMessage &statusMessage);
00218      
00231     virtual QList<KAction *> *customContextMenuActions();
00232 
00236     virtual QList<KAction *> *customContextMenuActions( ChatSession *manager );
00237 
00244     KMenu *popupMenu( ChatSession *manager = 0L );
00245 
00256     bool isFileCapable() const;
00257 
00264     void setFileCapable( bool filecap );
00265 
00275     bool canAcceptFiles() const;
00276 
00277     enum CanCreateFlags {  CannotCreate=false , CanCreate=true  };
00278 
00290     virtual ChatSession * manager( CanCreateFlags canCreate = CannotCreate ) =0;
00291 
00297     QString& icon() const;
00298 
00307     void setIcon( const QString& icon );
00308 
00318     virtual unsigned long int idleTime() const;
00319 
00328     void setIdleTime(unsigned long int);
00329 
00334     void setNickName( const QString &name );
00335 
00341     QString nickName() const;
00342 
00348     QString toolTip() const;
00349 
00355     QString formattedName() const;
00356 
00361     QString formattedIdleTime() const;
00362 
00367     void setPhoto(const QString &photoPath);
00368 
00369 public slots:
00373     void startChat();
00374 
00378     void sendMessage();
00379 
00383     void execute();
00384 
00390     void changeMetaContact();
00398     virtual void slotUserInfo() {}
00399 
00411     virtual void sync(unsigned int changed = 0xFF);
00412 
00421     virtual KDE_DEPRECATED void deleteContact();
00422 
00436     virtual void sendFile( const KUrl &sourceURL = KUrl(),
00437                    const QString &fileName = QString(), uint fileSize = 0L );
00438 private slots:
00442     void slotAddContact();
00443 
00447     void slotDelete();
00448 
00452     void slotBlock();
00453 
00457     void slotUnblock();
00458 
00462     void slotAccountIsConnectedChanged();
00463 signals:
00467     void onlineStatusChanged( Kopete::Contact *contact,
00468         const Kopete::OnlineStatus &status, const Kopete::OnlineStatus &oldStatus );
00469 
00478     void contactDestroyed( Kopete::Contact *contact );
00479 
00485     void idleStateChanged( Kopete::Contact *contact );
00486 private:
00487     class Private;
00488     Private *d;
00489 
00490 
00491 };
00492 
00493 
00494 } //END namespace Kopete
00495 
00496 #endif
00497 

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