ximpfw/core/srcdatamodel/ximpcontextstateeventimp.h
changeset 51 61fad867f68e
equal deleted inserted replaced
-1:000000000000 51:61fad867f68e
       
     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:  MXIMPContextStateEventImp API object implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 #ifndef CXIMPPRESENCECONTEXTSTATEEVENTIMP_H
       
    19 #define CXIMPPRESENCECONTEXTSTATEEVENTIMP_H
       
    20 
       
    21 #include "ximpapieventbase.h"
       
    22 #include <ximpcontextstate.h>
       
    23 #include <ximpcontextstateevent.h>
       
    24 
       
    25 
       
    26 class RWriteStream;
       
    27 class RReadStream;
       
    28 class MXIMPStatus;
       
    29 class CXIMPStatusImp;
       
    30 class CXIMPContextStateImp;
       
    31 
       
    32 
       
    33 /**
       
    34  * MXIMPContextStateEventImp API object implementation.
       
    35  *
       
    36  * @lib ximpdatamodel.dll
       
    37  * @since S60 v3.2
       
    38  */
       
    39 NONSHARABLE_CLASS( CXIMPContextStateEventImp ): public CXIMPApiEventBase,
       
    40     public MXIMPContextStateEvent
       
    41     {
       
    42     public:
       
    43         /** The class ID. */
       
    44         enum { KClassId = XIMPIMP_CLSID_CXIMPCONTEXTSTATEEVENTIMP };
       
    45 
       
    46     public:
       
    47 
       
    48         /**
       
    49          * Exported instantiation method for initializing
       
    50          * new event object.
       
    51          */
       
    52         IMPORT_C static CXIMPContextStateEventImp* NewLC();
       
    53         IMPORT_C static CXIMPContextStateEventImp* NewL();
       
    54 
       
    55 
       
    56         /**
       
    57          * Instantiation method for event automation.
       
    58          * Method signature must be exactly this to work
       
    59          * with event delivery automation system.
       
    60          *
       
    61          * Event implementation must be registered to
       
    62          * XIMPEventCodec KXIMPEventConstructorTable.
       
    63          */
       
    64         static CXIMPApiEventBase* NewFromStreamLC( RReadStream& aStream );
       
    65 
       
    66         virtual ~CXIMPContextStateEventImp();
       
    67 
       
    68         
       
    69     private:
       
    70         CXIMPContextStateEventImp();
       
    71         void ConstructL();
       
    72         void ConstructL( RReadStream& aStream );
       
    73 
       
    74 
       
    75     public: // From API base interfaces
       
    76 
       
    77         /**
       
    78          * Implementation of MXIMPBase interface methods
       
    79          * @see MXIMPBase
       
    80          */
       
    81         XIMPIMP_DECLARE_IF_BASE_METHODS
       
    82 
       
    83 
       
    84         /**
       
    85          * Implementation of MXIMPEventBase interface and
       
    86          * CXIMPApiEventBase methods
       
    87          *
       
    88          * @see MXIMPEventBase
       
    89          * @see CXIMPApiEventBase
       
    90          */
       
    91         XIMPIMP_DECLARE_EVENT_BASE_METHODS
       
    92 
       
    93 
       
    94     public: // From MXIMPContextStateEvent
       
    95 
       
    96         /**
       
    97          * Implementation of MXIMPContextStateEvent interface methods
       
    98          * @see MXIMPContextStateEventImp
       
    99          */
       
   100         const MXIMPStatus* StateChangeReason() const;
       
   101         const MXIMPContextState& ContextState() const;
       
   102         
       
   103         IMPORT_C CXIMPContextStateImp& ContextStateImp();
       
   104         IMPORT_C void SetStateChangeReasonImp( CXIMPStatusImp* aStateChangeReason );
       
   105         IMPORT_C CXIMPStatusImp* StateChangeReasonImp();
       
   106         
       
   107         
       
   108 
       
   109     private: // data
       
   110 
       
   111         /**
       
   112          *
       
   113          * Own.
       
   114          */
       
   115         CXIMPContextStateImp* iState;
       
   116 
       
   117 
       
   118         /**
       
   119          * State change reason.
       
   120          * Own.
       
   121          */
       
   122         CXIMPStatusImp* iStateChangeReason;
       
   123     };
       
   124 
       
   125 
       
   126 #endif // CXIMPPRESENCECONTEXTSTATEEVENTIMP_H