epoc32/include/app/imclient.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/app/imclient.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,301 +0,0 @@
     1.4 -/*
     1.5 -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 -* All rights reserved.
     1.7 -* This component and the accompanying materials are made available
     1.8 -* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 -* which accompanies this distribution, and is available
    1.10 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 -*
    1.12 -* Initial Contributors:
    1.13 -* Nokia Corporation - initial contribution.
    1.14 -*
    1.15 -* Contributors:
    1.16 -*
    1.17 -* Description:  Interface for Instant Messaging services
    1.18 -*
    1.19 -*/
    1.20 -
    1.21 -
    1.22 -#ifndef OPENAPI_IM_CLIENT_H
    1.23 -#define OPENAPI_IM_CLIENT_H
    1.24 -
    1.25 -// INCLUDES
    1.26 -#include <e32base.h>
    1.27 -#include <bamdesca.h>
    1.28 -#include <cntdef.h>
    1.29 -
    1.30 -// CONSTANTS
    1.31 -
    1.32 -// FORWARD DECLARATIONS
    1.33 -class MImObserver;
    1.34 -class MImClientDetailedError;
    1.35 -
    1.36 -// CLASS DECLARATION
    1.37 -/**
    1.38 -*  Instant Messaging interface class
    1.39 -*  This interface class provides methods to send and receive instant messages.
    1.40 -*  Application to be able to receive IMs it must register its own observer
    1.41 -*  using this interface class.
    1.42 -*  This interface can be obtained using a factory method from the CImConnection
    1.43 -*  class.
    1.44 -*
    1.45 -*  @lib imclient.lib
    1.46 -*  @since S60 3.0
    1.47 -*/
    1.48 -class MImClient
    1.49 -    {
    1.50 -
    1.51 -    public:
    1.52 -
    1.53 -        virtual ~MImClient() {}
    1.54 -
    1.55 -        /**
    1.56 -        * Method for registering the IM client to the WV Engine.
    1.57 -        * This method is synchronous.
    1.58 -        * @since S60 3.0
    1.59 -        * @param aObserver observer object used for notifying the user
    1.60 -        *        software
    1.61 -        * @leave KImApiErrAlreadyRegistered if it was registered already or other system wide error code
    1.62 -        */
    1.63 -        virtual void RegisterObserverL(
    1.64 -            MImObserver* aObserver ) = 0;
    1.65 -
    1.66 -        /**
    1.67 -        * Method for unregistering the IM Sender from the WV Engine.
    1.68 -        * This method is synchronous method.
    1.69 -        * @since S60 3.0
    1.70 -        */
    1.71 -        virtual void UnregisterObserver( ) = 0;
    1.72 -
    1.73 -        /**
    1.74 -        * Method for sending person-to-person text message (UNICODE) using
    1.75 -        * Contact Model IDs. This method is asynchronous and it’s completion
    1.76 -        * is signaled in HandleMessageSentL() method.
    1.77 -        * The method will leave on error. The API specific error codes are
    1.78 -        * in imerrors.h file
    1.79 -        * @since S60 3.0
    1.80 -        * @param aContactItem Contact Model ID of the recipient
    1.81 -        * @param aContent The content of the message in UNICODE
    1.82 -        * @return operation code
    1.83 -        * @leave KImApiErrNotRegistered observer was not registered
    1.84 -        * @leave KImApiErrInvalidContactId the contact ID does not have a corresponding User ID
    1.85 -        */
    1.86 -        virtual TInt SendPToPMessageL(
    1.87 -            const TContactItemId& aContactItem,
    1.88 -            const TDesC16& aContent ) = 0;
    1.89 -
    1.90 -        /**
    1.91 -        * Method for sending person-to-person text message (UNICODE) using
    1.92 -        * Contact Model IDs. This method is asynchronous and its completion
    1.93 -        * is signaled in HandleMessageSentL() method.
    1.94 -        * The method will leave on error. The API specific error codes are
    1.95 -        * in imerrors.h file
    1.96 -        * Please note that one contact can have more than one assigned IM user
    1.97 -        * ID. Sending IM to those contacts will result in partial success.
    1.98 -        * @since S60 3.0
    1.99 -        * @param aContactIds Contact Model Ids of the recipient(s)
   1.100 -        * @param aContent The content of the message in UNICODE
   1.101 -        * @return operation code
   1.102 -        * @leave KImApiErrNotRegistered observer was not registered
   1.103 -        * @leave KImApiErrInvalidContactId the contact ID does not have a corresponding User ID
   1.104 -        */
   1.105 -        virtual TInt SendPToPMessageL(
   1.106 -            const CContactIdArray& aContactIds,
   1.107 -            const TDesC16& aContent ) = 0;
   1.108 -
   1.109 -        /**
   1.110 -        * Method for sending person-to-person binary (or 8bit text) message
   1.111 -        * using Contact Model IDs. This method is asynchronous and its
   1.112 -        * completion is signaled in HandleMessageSentL() method.
   1.113 -        * The method will leave on error. The API specific error codes are
   1.114 -        * in imerrors.h file
   1.115 -        * Please note that one contact can have more than one assigned IM user
   1.116 -        * ID. Sending IM to those contacts will result in partial success.
   1.117 -        * @since S60 3.0
   1.118 -        * @param aContactIds Contact Model Ids of the recipient(s)
   1.119 -        * @param aContentType MIME type of the content
   1.120 -        * @param aContent The content of the message
   1.121 -        * @return operation code
   1.122 -        *
   1.123 -        * NOTE: Not yet supported!
   1.124 -        */
   1.125 -        virtual TInt SendPToPMessageL(
   1.126 -            const CContactIdArray& aContactIds,
   1.127 -            const TDesC& aContentType,
   1.128 -            const TDesC8& aContent ) = 0;
   1.129 -
   1.130 -        /**
   1.131 -        * Method for sending person-to-person text message using
   1.132 -        * directly the User IDs.
   1.133 -        * This method is asynchronous and its completion is signaled
   1.134 -        * in HandleMessageSentL() method.
   1.135 -        * The method will leave on error. The API specific error codes are
   1.136 -        * in imerrors.h file
   1.137 -        * @since S60 3.0
   1.138 -        * @param aUserId the recipient of the message
   1.139 -        * @param aContent the message in UNICODE
   1.140 -        * @return operation code.
   1.141 -        * @leave KImApiErrNotRegistered observer was not registered
   1.142 -        * @leave KImApiErrInvalidUserId wrong User ID
   1.143 -        */
   1.144 -        virtual TInt SendPToPMessageL(
   1.145 -            const TDesC& aUserId,
   1.146 -            const TDesC16& aContent ) = 0;
   1.147 -
   1.148 -        /**
   1.149 -        * Method for sending person-to-person text message using
   1.150 -        * directly the User IDs.
   1.151 -        * This method is asynchronous and its completion is signaled
   1.152 -        * in HandleMessageSentL() method.
   1.153 -        * The method will leave on error. The API specific error codes are
   1.154 -        * in imerrors.h file
   1.155 -        * @since S60 3.0
   1.156 -        * @param aUserIds recipient(s) of the message
   1.157 -        * @param aContent the message in UNICODE
   1.158 -        * @return operation code.
   1.159 -        * @leave KImApiErrNotRegistered observer was not registered
   1.160 -        * @leave KImApiErrInvalidUserId wrong User ID
   1.161 -        */
   1.162 -        virtual TInt SendPToPMessageL(
   1.163 -            const MDesCArray& aUserIds,
   1.164 -            const TDesC16& aContent ) = 0;
   1.165 -
   1.166 -        /**
   1.167 -        * Method for sending person-to-person binary (or 8 bit text) message
   1.168 -        * using directly the User IDs.
   1.169 -        * This method is asynchronous and its completion is signaled
   1.170 -        * in HandleMessageSentL() method.
   1.171 -        * The method will leave on error. The API specific error codes are
   1.172 -        * in imerrors.h file
   1.173 -        * @since S60 3.0
   1.174 -        * @param aUserIds recipient(s) of the message
   1.175 -        * @param aContentType MIME type of the message
   1.176 -        * @param aContent the message
   1.177 -        * @return operation code.
   1.178 -        *
   1.179 -        * NOTE: Not yet supported!
   1.180 -        */
   1.181 -        virtual TInt SendPToPMessageL(
   1.182 -            const MDesCArray& aUserIds,
   1.183 -            const TDesC& aContentType,
   1.184 -            const TDesC8& aContent ) = 0;
   1.185 -
   1.186 -    };
   1.187 -
   1.188 -
   1.189 -// CLASS DECLARATION
   1.190 -/**
   1.191 -*  Observer interface for Instant Messaging
   1.192 -*  The user shall implement this interface and register it through the MImClient
   1.193 -*  interface to the API to be able to receive IMs
   1.194 -*
   1.195 -*  @lib imclient.lib
   1.196 -*  @since S60 3.0
   1.197 -*/
   1.198 -class MImObserver
   1.199 -    {
   1.200 -
   1.201 -    public:
   1.202 -
   1.203 -        /**
   1.204 -        * This method is called when the SendPToPMessageL succeeded
   1.205 -        * @since S60 3.0
   1.206 -        * @param aOpCode operation code matching the called functions.
   1.207 -        * @param aErrorCode error codes.
   1.208 -        */
   1.209 -        virtual void HandleMessageSentL(
   1.210 -            const TInt aOpCode,
   1.211 -            const TInt aErrorCode ) = 0;
   1.212 -
   1.213 -        /**
   1.214 -        * This method is called when the SendPToPMessageL failed for some reason.
   1.215 -        * If the IM was sent to more recipients the error can be a partial
   1.216 -        * success. In that case the detailed error codes for each user can
   1.217 -        * fetched separately. Please note that the aDetailedError is valid
   1.218 -        * during the function call. After that it gets destroyed in the API.
   1.219 -        * @since S60 3.0
   1.220 -        * @param aOpCode operation code matching the called functions.
   1.221 -        * @param aErrorCode error codes.
   1.222 -        * @param aDetailedError list of errors for each failed user ID.
   1.223 -        */
   1.224 -        virtual void HandleSendErrorL(
   1.225 -            const TInt aOpCode,
   1.226 -            const TInt aErrorCode,
   1.227 -            MImClientDetailedError* aDetailedError ) = 0;
   1.228 -
   1.229 -        /**
   1.230 -        * This method is called when a new point-to-point text message
   1.231 -        * has arrived.
   1.232 -        * @since S60 3.0
   1.233 -        * @param aErrorCode error codes (to be defined)
   1.234 -        * @param aContactId Contact model ID of the sender
   1.235 -        * @param aUserId UserID of the message sender
   1.236 -        * @param aMessageType MIME type of the received message
   1.237 -        * @param aContent the message in UNICODE
   1.238 -        */
   1.239 -        virtual void HandleNewPToPMessageL(
   1.240 -            const TInt aErrorCode,
   1.241 -            const TContactItemId  aContactId,
   1.242 -            const TDesC& aUserId,
   1.243 -            const TDesC& aMessageType,
   1.244 -            const TDesC16& aContent ) = 0;
   1.245 -
   1.246 -        /**
   1.247 -        * This method is called when a new point-to-point message (8bit)
   1.248 -        * has arrived. The message can be text or binary data.
   1.249 -        * @since S60 3.0
   1.250 -        * @param aErrorCode error codes (to be defined)
   1.251 -        * @param aContactId Contact model ID of the sender
   1.252 -        * @param aUserId UserID of the message sender
   1.253 -        * @param aMessageType MIME type of the received message
   1.254 -        * @param aContent the message
   1.255 -        *
   1.256 -        * NOTE: Not yet supported!
   1.257 -        */
   1.258 -        virtual void HandleNewPToPMessageL(
   1.259 -            const TInt aErrorCode,
   1.260 -            const TContactItemId  aContactId,
   1.261 -            const TDesC& aUserId,
   1.262 -            const TDesC& aMessageType,
   1.263 -            const TDesC8& aContent ) = 0;
   1.264 -
   1.265 -    };
   1.266 -
   1.267 -// CLASS DECLARATION
   1.268 -/**
   1.269 -*  Detailed errors accessor class
   1.270 -*  @lib imclient.lib
   1.271 -*  @since S60 3.0
   1.272 -*/
   1.273 -class MImClientDetailedError
   1.274 -    {
   1.275 -
   1.276 -    public:
   1.277 -        /**
   1.278 -        * Gets the number of failed User IDs
   1.279 -        * @since S60 3.0
   1.280 -        * @return number of failed user IDs
   1.281 -        */
   1.282 -        virtual TInt Count() = 0;
   1.283 -
   1.284 -        /**
   1.285 -        * Gets the failed User ID
   1.286 -        * @since S60 3.0
   1.287 -        * @param aIndex index of the user in the list
   1.288 -        * @return failed user ID
   1.289 -        */
   1.290 -        virtual const TDesC& UserId( TInt aIndex ) = 0;
   1.291 -
   1.292 -        /**
   1.293 -        * Gets the reason of the failure. The API specific error codes are
   1.294 -        * defined in imerrors.h file.
   1.295 -        * @since S60 3.0
   1.296 -        * @param aIndex index of the user in the list
   1.297 -        * @return the fail reason
   1.298 -        */
   1.299 -        virtual TInt ErrorCode( TInt aIndex ) = 0;
   1.300 -
   1.301 -    };
   1.302 -
   1.303 -#endif
   1.304 -// End of File