instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximprequestcompleteevent.h
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: s_ximprequestcompleteevent.h
       
    15 *
       
    16 */
       
    17 #ifndef MXIMPFWREQUESTCOMPLETEEVENTSTUB_H
       
    18 #define MXIMPFWREQUESTCOMPLETEEVENTSTUB_H
       
    19 
       
    20 #include <ximprequestcompleteevent.h>
       
    21 #include <ximpstatus.h>
       
    22 
       
    23 class MXIMPStatus;
       
    24 
       
    25 class MXIMPRequestCompleteEventStub : public MXIMPRequestCompleteEvent
       
    26     {
       
    27     const TXIMPRequestId& RequestId() const;
       
    28     const MXIMPStatus& CompletionResult() const;
       
    29     const MXIMPBase* LookupCompletionDataByType( TInt32 aInterfaceId ) const;
       
    30         
       
    31     const TAny* GetInterface(
       
    32                         TInt32 aInterfaceId,
       
    33                         TIfGetOps aOps ) const;
       
    34 
       
    35     TAny* GetInterface(
       
    36                         TInt32 aInterfaceId,
       
    37                         TIfGetOps aOps );
       
    38 
       
    39     TInt32 GetInterfaceId() const;
       
    40 
       
    41     };
       
    42 
       
    43 
       
    44 /**
       
    45  * Interface for status object.
       
    46  *
       
    47  * Status object is used in XIMP Framework API
       
    48  * to present result code and additional textual
       
    49  * details from request completions, context
       
    50  * state changes and similar events.
       
    51  *
       
    52  * @ingroup ximpdatamodelapi
       
    53  * @since S60 v3.2
       
    54  */
       
    55 class MyXIMPStatusStub : public MXIMPStatus
       
    56     {
       
    57 
       
    58 public:
       
    59 
       
    60     /**
       
    61      * Gets request completion code.
       
    62      *
       
    63      * Result code can be:
       
    64      *  - one of the system wide errors
       
    65      *  - one of the ximp core specific errors defined in in ximperrors.hrh
       
    66      *  - one of the presence specific errors defined in in presenceerrors.hrh
       
    67      *  - error specific to the underlying communication channel
       
    68      *
       
    69      * @return The result code.
       
    70      */
       
    71     TInt ResultCode() const { return iCode; };
       
    72 
       
    73 
       
    74     /**
       
    75      * Gets the protocol level response code.
       
    76      *
       
    77      *
       
    78      * @return Protocol level response code.
       
    79      *         KErrNone if no protocol level response code available.
       
    80      */
       
    81     TInt ProtocolResultCode() const { return KErrNone; }
       
    82 
       
    83 
       
    84 
       
    85     /**
       
    86      * Get the textual result description.
       
    87      * Textual descriptions are protocol specific.
       
    88      *
       
    89      * @return The textual result description.
       
    90      *         Empty descriptor if no description available.
       
    91      */
       
    92     const TDesC16& ProtocolResultDescription() const { return KNullDesC; }
       
    93 
       
    94 
       
    95 
       
    96     /**
       
    97      * Sets request completion code.
       
    98      *
       
    99      * @param [in] aCode
       
   100      *        The result code.
       
   101      */
       
   102     void SetResultCode(
       
   103                 TInt aCode ) { iCode = aCode; };
       
   104 
       
   105 
       
   106 
       
   107     /**
       
   108      * Sets textual result description.
       
   109      *
       
   110      * @param [in] aCode
       
   111      */
       
   112     void SetProtocolResultCode(
       
   113                 TInt /*aCode*/ ) {};
       
   114 
       
   115 
       
   116 
       
   117     /**
       
   118      * Sets textual result description.
       
   119      *
       
   120      * @param [in] aDescription
       
   121      *        The textual result description.
       
   122      */
       
   123     void SetProtocolResultDescriptionL(
       
   124                 const TDesC16& /*aDescription*/ ) {};
       
   125                 
       
   126 	const TAny* GetInterface(
       
   127                         TInt32 /*aInterfaceId*/,
       
   128                         TIfGetOps /*aOps*/ ) const { return NULL; }
       
   129 
       
   130     TAny* GetInterface(
       
   131                         TInt32 /*aInterfaceId*/,
       
   132                         TIfGetOps /*aOps*/ ) { return NULL; }
       
   133 
       
   134     TInt32 GetInterfaceId() const { return KErrNone; }   
       
   135     
       
   136     private:
       
   137      TInt iCode;   
       
   138 
       
   139     };
       
   140     
       
   141 #endif // MXIMPFWREQUESTCOMPLETEEVENT_H
       
   142 
       
   143 
       
   144