imconnection.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : imconnection.h
00004 *  Part of     : IM SDK API
00005 *  Description : IM Connection interface
00006 *  Version     : 1.0
00007 *
00008 *  Copyright (c) 2004, 2005 Nokia Corporation.
00009 *  This material, including documentation and any related 
00010 *  computer programs, is protected by copyright controlled by 
00011 *  Nokia Corporation. All rights are reserved. Copying, 
00012 *  including reproducing, storing, adapting or translating, any 
00013 *  or all of this material requires the prior written consent of 
00014 *  Nokia Corporation. This material also contains confidential 
00015 *  information which may not be disclosed to others without the 
00016 *  prior written consent of Nokia Corporation.
00017 * ==============================================================================
00018 */
00019 
00020 #ifndef IMCONNECTION_H
00021 #define IMCONNECTION_H
00022 
00023 // INCLUDES
00024 #include <e32base.h>
00025 #include <ecom\ecom.h>
00026 
00027 // DATA TYPES
00028 enum TImConnectionStatus
00029     {
00030     ELoggedIn = 0,
00031     ENotLoggedIn
00032     };
00033 
00034 // FORWARD DECLARATIONS
00035 class MImClient;
00036 class MImConnectionObserver;
00037 
00038 // CLASS DECLARATION
00039 
00056 class CImConnection : public CBase
00057     {
00058     public:
00059 
00066         static CImConnection* NewL( 
00067             const TDesC& aApplicationId );
00068         
00069         // Destructor
00070             virtual ~CImConnection( );
00071 
00072 
00073     public: // New functions
00074         
00080         virtual MImClient* CreateImClientL( ) = 0;
00081 
00089         virtual void RegisterObserverL(
00090             MImConnectionObserver* aObserver ) = 0;
00091 
00097         virtual void UnregisterObserver( ) = 0;
00098 
00105         virtual TImConnectionStatus ImConnectionStatus( ) = 0;
00106 
00119         virtual void LoginL( 
00120             const TDesC&  aServer,
00121             const TDesC&  aUserID,
00122             const TDesC&  aPassword,
00123             const TUint32 aAP ) = 0;
00124 
00135         virtual void CancelLoginL( ) = 0;
00136 
00147         virtual void LogoutL( ) = 0;
00148 
00149     protected:
00150         // C++ constructor
00151         inline CImConnection( );
00152 
00153     private:
00154         // Unique instance identifier key (needed for ECom)
00155         TUid iDtor_ID_Key;
00156         
00157     };
00158 
00165 class MImConnectionObserver
00166     {
00167     public:
00168 
00174         virtual void HandleLoginL( 
00175             const TInt aErrorCode ) = 0;
00176 
00182         virtual void HandleCancelLoginL( 
00183             const TInt aErrorCode ) = 0;
00184 
00192         virtual void HandleLogoutL(
00193             const TInt aErrorCode ) = 0;
00194 
00195     };
00196 
00197 #include "imconnection.inl"
00198 
00199 #endif

Copyright © Nokia Corporation 2001-2008
Back to top