00001 /* 00002 * ============================================================================ 00003 * Name : MImClient from ImClient.h 00004 * Part of : IM SDK API 00005 * 00006 * Description : Interface for Instant Messaging services 00007 * Version : 00008 * 00009 * Copyright (C) 2004, 2005 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * 00019 * ============================================================================ 00020 */ 00021 00022 #ifndef OPENAPI_IM_CLIENT_H 00023 #define OPENAPI_IM_CLIENT_H 00024 00025 // INCLUDES 00026 #include <e32base.h> 00027 #include <bamdesca.h> 00028 #include <cntdef.h> 00029 00030 // CONSTANTS 00031 00032 // FORWARD DECLARATIONS 00033 class MImObserver; 00034 class MImClientDetailedError; 00035 00036 // CLASS DECLARATION 00048 class MImClient 00049 { 00050 00051 public: 00052 00053 virtual ~MImClient() {} 00054 00063 virtual void RegisterObserverL( 00064 MImObserver* aObserver ) = 0; 00065 00071 virtual void UnregisterObserver( ) = 0; 00072 00086 virtual TInt SendPToPMessageL( 00087 const TContactItemId& aContactItem, 00088 const TDesC16& aContent ) = 0; 00089 00105 virtual TInt SendPToPMessageL( 00106 const CContactIdArray& aContactIds, 00107 const TDesC16& aContent ) = 0; 00108 00125 virtual TInt SendPToPMessageL( 00126 const CContactIdArray& aContactIds, 00127 const TDesC& aContentType, 00128 const TDesC8& aContent ) = 0; 00129 00144 virtual TInt SendPToPMessageL( 00145 const TDesC& aUserId, 00146 const TDesC16& aContent ) = 0; 00147 00162 virtual TInt SendPToPMessageL( 00163 const MDesCArray& aUserIds, 00164 const TDesC16& aContent ) = 0; 00165 00181 virtual TInt SendPToPMessageL( 00182 const MDesCArray& aUserIds, 00183 const TDesC& aContentType, 00184 const TDesC8& aContent ) = 0; 00185 00186 }; 00187 00188 00189 // CLASS DECLARATION 00198 class MImObserver 00199 { 00200 00201 public: 00202 00209 virtual void HandleMessageSentL( 00210 const TInt aOpCode, 00211 const TInt aErrorCode ) = 0; 00212 00224 virtual void HandleSendErrorL( 00225 const TInt aOpCode, 00226 const TInt aErrorCode, 00227 MImClientDetailedError* aDetailedError) = 0; 00228 00239 virtual void HandleNewPToPMessageL( 00240 const TInt aErrorCode, 00241 const TContactItemId aContactId, 00242 const TDesC& aUserId, 00243 const TDesC& aMessageType, 00244 const TDesC16& aContent ) = 0; 00245 00258 virtual void HandleNewPToPMessageL( 00259 const TInt aErrorCode, 00260 const TContactItemId aContactId, 00261 const TDesC& aUserId, 00262 const TDesC& aMessageType, 00263 const TDesC8& aContent ) = 0; 00264 00265 }; 00266 00267 // CLASS DECLARATION 00273 class MImClientDetailedError 00274 { 00275 00276 public: 00282 virtual TInt Count() = 0; 00283 00290 virtual const TDesC& UserId( TInt aIndex ) = 0; 00291 00299 virtual TInt ErrorCode( TInt aIndex ) = 0; 00300 00301 }; 00302 00303 #endif 00304 // End of File