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

kopete/libkopete

kopeteaccount.h

Go to the documentation of this file.
00001 /*
00002     kopeteaccount.h - Kopete Account
00003 
00004     Copyright (c) 2007      by Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
00005     Copyright (c) 2003-2005 by Olivier Goffart       <ogoffart@kde.org>
00006     Copyright (c) 2003-2004 by Martijn Klingens      <klingens@kde.org>
00007     Copyright (c) 2004      by Richard Smith         <kde@metafoo.co.uk>
00008 
00009     Kopete    (c) 2002-2007 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 KOPETEACCOUNT_H
00022 #define KOPETEACCOUNT_H
00023 
00024 #include "kopeteonlinestatus.h"
00025 #include "kopetestatusmessage.h"
00026 #include "kopete_export.h"
00027 
00028 #include <QtCore/QObject>
00029 #include <QtGui/QPixmap>
00030 #include <QtCore/QHash>
00031 
00032 #include <kconfiggroup.h>
00033 
00034 class KActionMenu;
00035 class KConfigGroup;
00036 
00037 namespace Kopete
00038 {
00039 class Contact;
00040 class Protocol;
00041 class MetaContact;
00042 class Group;
00043 class OnlineStatus;
00044 class BlackLister;
00045 class StatusMessage;
00046 class Identity;
00047 class PropertyContainer;
00048 
00072 class KOPETE_EXPORT Account : public QObject
00073 {
00074     Q_OBJECT
00075 
00076     Q_ENUMS( AddMode )
00077     Q_PROPERTY( QString accountId READ accountId )
00078     Q_PROPERTY( bool excludeConnect READ excludeConnect WRITE setExcludeConnect )
00079     Q_PROPERTY( QColor color READ color WRITE setColor )
00080     Q_PROPERTY( QPixmap accountIcon READ accountIcon )
00081     Q_PROPERTY( bool isConnected READ isConnected )
00082     Q_PROPERTY( bool isAway READ isAway )
00083     Q_PROPERTY( bool suppressStatusNotification READ suppressStatusNotification )
00084     Q_PROPERTY( uint priority READ priority WRITE setPriority )
00085 
00086 public:
00095     enum DisconnectReason {
00096         OtherClient = -4,    
00097         BadPassword = -3,    
00098         BadUserName = -2,    
00099         InvalidHost = -1,    
00100         Manual = 0,          
00101         ConnectionReset = 1, 
00102         Unknown = 99         
00103     };
00104 
00109     enum AddMode {
00110         ChangeKABC = 0,     
00111         DontChangeKABC = 1, 
00112         Temporary = 2       
00113     };
00114 
00121     Account(Protocol *parent, const QString &accountID);
00122     ~Account();
00123 
00127     Protocol *protocol() const ;
00128 
00132     QString accountId() const;
00133 
00137     QString accountLabel() const;
00138 
00144     uint priority() const;
00145 
00151     void setPriority( uint priority );
00152 
00159     void setExcludeConnect(bool);
00160 
00166     bool excludeConnect() const;
00167 
00176     const QColor color() const;
00177 
00185     void setColor( const QColor &color);
00186 
00195     QPixmap accountIcon( const int size = 0 ) const;
00196     
00204     void setCustomIcon( const QString& );
00205     
00211     QString customIcon() const;
00212     
00220     Identity * identity() const;
00221 
00233     virtual bool setIdentity( Kopete::Identity *ident );
00234 
00242     Contact * myself() const;
00243 
00258     virtual void fillActionMenu( KActionMenu *actionMenu );
00259 
00268     virtual bool hasCustomStatusMenu() const;
00269 
00277     const QHash<QString,Contact*>& contacts();
00278 
00288     bool suppressStatusNotification() const;
00289 
00308     MetaContact* addContact( const QString &contactId, const QString &displayName = QString(), Group *group = 0, AddMode mode = DontChangeKABC );
00309 
00323     bool addContact( const QString &contactId, MetaContact *parent, AddMode mode = DontChangeKABC );
00324 
00333     bool isConnected() const;
00334 
00341     bool isAway() const;
00342 
00351     KConfigGroup *configGroup() const;
00352 
00366     virtual bool removeAccount();
00367 
00372     BlackLister* blackLister();
00373 
00378     virtual bool isBlocked( const QString &contactId );
00379 
00380 protected:
00395     void setMyself( Contact *myself );
00396 
00412     virtual bool createContact( const QString &contactId, MetaContact *parentContact ) =0;
00413 
00414 
00420     void setAccountLabel( const QString &label );
00421 
00422 protected slots:
00434     virtual void disconnected( Kopete::Account::DisconnectReason reason );
00435 
00448     void setAllContactsStatus( const Kopete::OnlineStatus &status );
00449 
00450 signals:
00457     void colorChanged( const QColor & );
00458 
00463     void accountDestroyed( const Kopete::Account *account );
00464 
00468     void isConnectedChanged();
00469 
00470 private:
00475     void readConfig();
00476 
00477 public:
00483     void registerContact( Contact *c );
00484 
00485 public slots:
00493     virtual void connect( const Kopete::OnlineStatus& initialStatus = OnlineStatus() ) = 0;
00494 
00503     virtual void disconnect( ) = 0 ;
00504 
00505 public slots:
00512     virtual void setOnlineStatus( const Kopete::OnlineStatus& status , const Kopete::StatusMessage &reason = Kopete::StatusMessage() ) = 0;
00518     virtual void setStatusMessage( const Kopete::StatusMessage &statusMessage ) = 0;
00519 
00523     void editAccount( QWidget* parent = 0L );
00524 
00532     virtual void block( const QString &contactId );
00533 
00541     virtual void unblock( const QString &contactId );
00542 
00543 private slots:
00547     virtual void reconnect(); 
00548 
00552     void contactDestroyed( Kopete::Contact * );
00553 
00557     void slotOnlineStatusChanged( Kopete::Contact *contact, const Kopete::OnlineStatus &newStatus, const Kopete::OnlineStatus &oldStatus );
00558 
00562     void slotContactPropertyChanged( Kopete::PropertyContainer *, const QString &, const QVariant &, const QVariant & );
00563 
00567     void slotStopSuppression();
00568 
00569 private:
00570     class Private;
00571     Private *d;
00572 };
00573 
00574 } //END namespace Kopete
00575 
00576 #endif
00577 

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