ximpfw/core/srcutils/ximpsrvmessageimp.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:  Concrete server message wrapper implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 #ifndef CXIMPSRVMESSAGEIMP_H
       
    19 #define CXIMPSRVMESSAGEIMP_H
       
    20 
       
    21 #include "ximpsrvmessage.h"
       
    22 #include "ximppanics.h"
       
    23 #include <e32base.h>
       
    24 
       
    25 /**
       
    26  * Server message wrapper implementation.
       
    27  *
       
    28  * @lib ximputils.dll
       
    29  * @since S60 v3.2
       
    30  */
       
    31 NONSHARABLE_CLASS( CXIMPSrvMessageImp ) : public CBase,
       
    32                                           public MXIMPSrvMessage
       
    33     {
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Special instantiation method..
       
    38      *
       
    39      * Verifies that given self pointer ins't yet in use
       
    40      * and allocates new instance. Returns NULL pointer if in OOM.
       
    41      */
       
    42     static CXIMPSrvMessageImp* NewOrNull( const RMessage2& aMessage,
       
    43                                           MXIMPSrvMessage*& aSelfPtr,
       
    44                                           CXIMPSrvMessageImp*& aSourcePtr );
       
    45     ~CXIMPSrvMessageImp();
       
    46 
       
    47 
       
    48 private:
       
    49     CXIMPSrvMessageImp( const RMessage2& aMessage,
       
    50                         MXIMPSrvMessage*& aSelfPtr );
       
    51                         
       
    52     void Init( const RMessage2& aMessage,
       
    53                         MXIMPSrvMessage*& aSelfPtr );
       
    54 
       
    55 
       
    56 
       
    57 public: // Methods from MXIMPSrvMessage
       
    58 
       
    59     void Complete(TInt aReason);
       
    60     TBool IsCompleted() const;
       
    61     TInt Function() const;
       
    62     TInt Int( TParamIndex aIndex ) const;
       
    63     TInt GetDesLengthL( TParamIndex aIndex ) const;
       
    64     void ReadL( TParamIndex aIndex, TDes8& aDes ) const;
       
    65     void WriteL( TParamIndex aIndex, const TDesC8& aDes ) const;
       
    66     void PanicClientAndLeaveL( NXIMPPanic::TReason aReason ) const;
       
    67     void PlaceOwnershipHere( MXIMPSrvMessage*& aNewSelfPtr );
       
    68 
       
    69 private: // Data
       
    70 
       
    71 
       
    72     /**
       
    73      * The message.
       
    74      */
       
    75     RMessage2 iMessage;
       
    76 
       
    77     /**
       
    78      * Pointer to self pointer.
       
    79      */
       
    80     MXIMPSrvMessage** iSelfPtr;
       
    81 
       
    82     };
       
    83 
       
    84 
       
    85 
       
    86 #endif      //  CXIMPSRVMESSAGEIMP_H
       
    87 
       
    88