imservices/searchfeatureplugin/srcsearchoperations/ximprequestcompleteeventimp.h
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2006 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:  MXIMPRequestCompleteEvent API object implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CXIMPREQUESTCOMPLETEEVENTIMP_H
       
    19 #define CXIMPREQUESTCOMPLETEEVENTIMP_H
       
    20 
       
    21 #include "ximpapieventbase.h"
       
    22 #include "ximptypehelpers.h"
       
    23 #include <ximprequestcompleteevent.h>
       
    24 
       
    25 class RWriteStream;
       
    26 class RReadStream;
       
    27 class CXIMPStatusImp;
       
    28 class MXIMPStatus;
       
    29 class CXIMPApiDataObjBase;
       
    30 
       
    31 
       
    32 /**
       
    33  * MXIMPRequestCompleteEvent API object implementation.
       
    34  *
       
    35  * @lib ximpdatamodel.dll
       
    36  * @since S60 v3.2
       
    37  */
       
    38 NONSHARABLE_CLASS( CXIMPRequestCompleteEventImp ): 
       
    39     public CXIMPApiEventBase,
       
    40     public MXIMPRequestCompleteEvent
       
    41     {
       
    42     public:
       
    43         /** The class ID. */
       
    44         enum { KClassId = XIMPIMP_CLSID_CXIMPREQUESTCOMPLETEEVENTIMP };
       
    45 
       
    46 public:
       
    47 
       
    48     /**
       
    49      * Exported instantiation method for initializing
       
    50      * new event object.
       
    51      */
       
    52     IMPORT_C static CXIMPRequestCompleteEventImp* NewL();
       
    53     IMPORT_C static CXIMPRequestCompleteEventImp* NewLC(
       
    54             TXIMPRequestId& aRequestId, TInt aDefaultErrorValue = KErrNone );
       
    55 
       
    56 
       
    57     /**
       
    58      * Instantiation method for event automation.
       
    59      * Method signature must be exactly this to work
       
    60      * with event delivery automation system.
       
    61      *
       
    62      * Event implementation must be registered to
       
    63      * XIMPEventCodec KXIMPEventConstructorTable.
       
    64      */
       
    65     static CXIMPApiEventBase* NewFromStreamLC( RReadStream& aStream );
       
    66 
       
    67 
       
    68     virtual ~CXIMPRequestCompleteEventImp();
       
    69 
       
    70 private:
       
    71     CXIMPRequestCompleteEventImp( TXIMPRequestId& aRequestId );
       
    72     CXIMPRequestCompleteEventImp();
       
    73     void ConstructL( TInt aDefaultErrorValue );
       
    74     void ConstructL( RReadStream& aStream );
       
    75     
       
    76 public: // From MXIMPRequestCompleteEvent
       
    77 
       
    78     /**
       
    79      * Implementation of MXIMPRequestCompleteEvent interface methods
       
    80      * @see MXIMPRequestCompleteEvent
       
    81      */
       
    82     const TXIMPRequestId& RequestId() const;
       
    83     const MXIMPStatus& CompletionResult() const;    
       
    84     const MXIMPBase* LookupCompletionDataByType( TInt32 aInterfaceId ) const;
       
    85 
       
    86 
       
    87 public:
       
    88 
       
    89     /** 
       
    90      * Set request id
       
    91      * @param aRequestId New requestId.
       
    92      */
       
    93     IMPORT_C void SetRequestId( const TXIMPRequestId& aRequestId );
       
    94 
       
    95     /**
       
    96      * Add data object as a parameter to this event. Ownership
       
    97      * transferred.
       
    98      * @param aObj The fully constructed data object to add
       
    99      */ 
       
   100     IMPORT_C void AppendParamL( CXIMPApiDataObjBase* aObj );
       
   101     
       
   102     
       
   103     IMPORT_C CXIMPStatusImp& CompletionResultImp();    
       
   104 
       
   105 public: // From API base interfaces
       
   106 
       
   107     /**
       
   108      * Implementation of MXIMPBase interface methods
       
   109      * @see MXIMPBase
       
   110      */
       
   111     XIMPIMP_DECLARE_IF_BASE_METHODS
       
   112 
       
   113 
       
   114     /**
       
   115      * Implementation of MXIMPEventBase interface and
       
   116      * CXIMPApiEventBase methods
       
   117      *
       
   118      * @see MXIMPEventBase
       
   119      * @see CXIMPApiEventBase
       
   120      */
       
   121     XIMPIMP_DECLARE_EVENT_BASE_METHODS
       
   122 
       
   123 private: // data
       
   124 
       
   125     /**
       
   126      * Completed request.
       
   127      * Own.
       
   128      */
       
   129     TXIMPRequestId iReqId;
       
   130 
       
   131 
       
   132     /**
       
   133      * Request result.
       
   134      * This is set to KErrNoMemory for default value.
       
   135      * Reason for that is error handling in low memory situation
       
   136      * CXIMPEventCapsule will send KErrNoMemory version of event if
       
   137      * event cannot be updated because of low memory.
       
   138      * Own.
       
   139      */
       
   140     CXIMPStatusImp* iResult;
       
   141     
       
   142     /**
       
   143      * Array of params
       
   144      */
       
   145     RPrReqParamArray iParamArray;
       
   146     };
       
   147 
       
   148 
       
   149 #endif // CXIMPREQUESTCOMPLETEEVENTIMP_H