stif/stif_plat/inc/StifTestEventInterface.h
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     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: This file contains the header file of the event 
       
    15 * interface.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef TESTEVENTINTERFACE_H
       
    20 #define TESTEVENTINTERFACE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 
       
    25 // CONSTANTS
       
    26 // None
       
    27 
       
    28 // MACROS
       
    29 // None
       
    30 
       
    31 // DATA TYPES
       
    32 // None
       
    33 
       
    34 // FUNCTION PROTOTYPES
       
    35 // None
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 // None
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 // DESCRIPTION
       
    43 // Interface class for the event system.
       
    44 class TEventIf
       
    45     {
       
    46     public: // Enumerations
       
    47         /**
       
    48         * Event request types.
       
    49         */
       
    50         enum TReqType
       
    51             {
       
    52             // The following can be used by the test module
       
    53             EReqEvent = 1,
       
    54             EWaitEvent,
       
    55             ERelEvent,
       
    56             ESetEvent,
       
    57             EUnsetEvent,
       
    58             
       
    59             // The rest are special
       
    60             // Not used by the test module
       
    61             EEnable,
       
    62             ESetWaitPending,
       
    63             ECmdError,
       
    64             ECancelWait,
       
    65             };
       
    66         
       
    67         /**
       
    68         * Event types.
       
    69         */
       
    70         enum TEventType
       
    71             {
       
    72             EIndication,
       
    73             EState,
       
    74             };
       
    75             
       
    76     private: // Enumerations
       
    77         
       
    78     public:  // Constructors and destructor
       
    79 
       
    80         /**
       
    81         * C++ constructor with params.
       
    82         */
       
    83         TEventIf( TReqType aType = EEnable, 
       
    84                   const TName& aName = KNullDesC(), 
       
    85                   TEventType aEventType = EIndication ) 
       
    86             { iType = aType; iName = aName; iEventType = aEventType; }
       
    87 
       
    88     public: // New functions
       
    89         
       
    90         /**
       
    91         * Get request type.
       
    92         */        
       
    93         inline TReqType Type() const { return iType; }
       
    94          
       
    95         /**
       
    96         * Get event name.
       
    97         */        
       
    98         inline const TName& Name() const { return iName; } 
       
    99         
       
   100         /**
       
   101         * Get event type.
       
   102         */        
       
   103         inline TEventType EventType() const { return iEventType; } 
       
   104         
       
   105         /**
       
   106         * Set request type.
       
   107         */        
       
   108         inline void SetType( TReqType aType ){ iType = aType; } 
       
   109         
       
   110         /**
       
   111         * Set event name.
       
   112         */        
       
   113         inline void SetName( const TName& aName ){ iName = aName; }
       
   114         
       
   115         /**
       
   116         * Set event to state event.
       
   117         */        
       
   118         inline void SetEventType( TEventType aEventType )
       
   119             { iEventType = aEventType; }
       
   120         
       
   121         /**
       
   122         * Set request type and event name.
       
   123         */        
       
   124         inline void Set( TReqType aType, const TName& aName )
       
   125             { iType = aType; iName = aName; } 
       
   126         
       
   127         /**
       
   128         * Set request type, event name and event type.
       
   129         */        
       
   130         inline void Set( TReqType aType, 
       
   131                          const TName& aName, 
       
   132                          TEventType aEventType )
       
   133             { iType = aType; iName = aName; iEventType = aEventType; } 
       
   134         
       
   135         /**
       
   136         * Copy data from existing TEventIf (or derived class).
       
   137         */
       
   138         inline void Copy( const TEventIf& aEvent) 
       
   139             { iType = aEvent.iType; 
       
   140             iName = aEvent.iName; 
       
   141             iEventType = aEvent.iEventType; } 
       
   142           
       
   143     public: // Functions from base classes
       
   144         
       
   145     protected:  // New functions
       
   146         
       
   147     protected:  // Functions from base classes
       
   148         
       
   149     private:
       
   150         
       
   151     public:   //Data
       
   152         
       
   153     protected:  // Data
       
   154         /**
       
   155         * Request type.
       
   156         */
       
   157         TReqType iType; 
       
   158         
       
   159         /**
       
   160         * Event name (must be unique).
       
   161         */
       
   162         TName iName;     
       
   163         
       
   164         /**
       
   165         * Event type.
       
   166         */
       
   167         TEventType iEventType;
       
   168         
       
   169     private:    // Data
       
   170         
       
   171     public:     // Friend classes
       
   172         
       
   173     protected:  // Friend classes
       
   174         
       
   175     private:    // Friend classes
       
   176         
       
   177     };
       
   178     
       
   179 // Packaged TEventIf
       
   180 typedef TPckg<TEventIf> TEventIfPckg;
       
   181  
       
   182 #endif      // TESTEVENTINTERFACE_H
       
   183 
       
   184 // End of File