eventsui/eventsengine/inc/evtaction.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2008 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:  Class for the Location Events Action.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_EVTACTION_H
       
    20 #define C_EVTACTION_H
       
    21 
       
    22 // System Includes
       
    23 
       
    24 // User Includes
       
    25 #include "evtdefs.h"
       
    26 
       
    27 // Forward Declarations
       
    28 
       
    29 // extern data types
       
    30 
       
    31 // global Functions
       
    32 /**
       
    33  * @enum TEvtActionType
       
    34  * Action Type for an Event.
       
    35  *
       
    36  */
       
    37 enum TEvtActionType
       
    38     {
       
    39     /**
       
    40      * The Action for the Event is to play Alarm Tone.
       
    41      */
       
    42     EAlarm                               = 0
       
    43     };
       
    44         
       
    45 /**
       
    46  *  @class CEvtAction
       
    47  *  Class that represents the action for an Event
       
    48  *
       
    49  *  This class encapsultes the Action information like action type
       
    50  *  and generic string for action. This class allows for Internalizing
       
    51  *	Externalizing the action.
       
    52  *
       
    53  *  @lib evtstorage.lib
       
    54  *  @since S60 v9.1
       
    55  */
       
    56 class CEvtAction : public CBase
       
    57     {
       
    58 public:  
       
    59     /**
       
    60      * Constructs a new instance of Event Action.
       
    61      *
       
    62      * @return The new instance of Event Action object.
       
    63      * @leave System wide error code if the object creation fails.         
       
    64      */
       
    65     IMPORT_C static CEvtAction* NewL();
       
    66     
       
    67     /**
       
    68      * Constructs a new instance of Event Action.
       
    69      * Leaves the created instance on the cleanup stack.
       
    70      *
       
    71      * @return The new instance of Event object.
       
    72      * @leave System wide error code if the object creation fails.
       
    73      */
       
    74     IMPORT_C static CEvtAction* NewLC();  
       
    75 
       
    76     /**
       
    77     * Destructor.
       
    78     */
       
    79     virtual ~CEvtAction();
       
    80 
       
    81 public: // Get and Set methods
       
    82     
       
    83     /**
       
    84      * Gets the Action id, identifying the Location Event's Action.
       
    85      * This identifier is definded by Storage Db on creation.   
       
    86      *
       
    87      * @since S60 v9.1     
       
    88      * @return Identifier identifying the Location Event's Action.
       
    89      */
       
    90     TInt64 Id() const;
       
    91  
       
    92     /**
       
    93      * Set the Action id, identifying the Location Event's Action. 
       
    94      * This identifier is definded by Storage Db on creation.
       
    95      *
       
    96      * @since S60 v9.1   
       
    97      * @param[in] aId Action identifier identifying the Location 
       
    98      * 					Event's Action.
       
    99      */
       
   100     void SetId( const TInt64 aId );
       
   101     
       
   102     /**
       
   103      * Gets the Trigger id, identifying the Location Event to which
       
   104      * Action is associated with.
       
   105      * This identifier is definded by Storage Db on creation.   
       
   106      *
       
   107      * @since S60 v9.1     
       
   108      * @return Event identifier identifying the Location Event.
       
   109      */
       
   110     TEvtEventId EvtId() const;
       
   111  
       
   112     /**
       
   113      * Set the Trigger id, identifying the Location Event to which
       
   114      * Action is associated with.
       
   115      * This identifer is definded by Storage Db on creation.
       
   116      *
       
   117      * @since S60 v9.1   
       
   118      * @param[in] aId Action identifier identifying the Location 
       
   119      * 					Event's Action.
       
   120      */
       
   121     void SetEvtId( const TEvtEventId aId );
       
   122     
       
   123     /**
       
   124      * Gets the Action type for the Location Event.
       
   125      * The Type is defined when an event is created.
       
   126      *
       
   127      * @since S60 v9.1    
       
   128      * @return TEvtActionType Type of Location Event.
       
   129      */
       
   130     IMPORT_C TEvtActionType Type() const;
       
   131 
       
   132     /** 
       
   133      * Set the Action type for the Location Event.
       
   134      *
       
   135      * @since S60 v9.1  
       
   136      * @param[in] TEvtActionType Type for Location Event. 
       
   137      */
       
   138     void SetType( const TEvtActionType aType );
       
   139     
       
   140     /**
       
   141      * Gets the Action for the Location Events.
       
   142      * The Action is defined by the Location EventsUi on Creation.
       
   143      * A reference to the object's internal string is returned.
       
   144      *
       
   145      * @since S60 v9.1    
       
   146      * @return Action String for the Location Event.
       
   147      */
       
   148     TPtrC Action() const;
       
   149 
       
   150     /** 
       
   151      * Set the Action String for the Location Event. The Action is 
       
   152      * copied.
       
   153      *
       
   154      * @since S60 v9.1  
       
   155      * @param[in] aAction Action String for the Location Event. 
       
   156      *                  The Action string is copied.
       
   157      * @leave KErrNoMemory If there is not enough memory to copy the string.
       
   158      */
       
   159     void SetActionL( const TDesC& aAction );
       
   160 
       
   161 private: // methods
       
   162     /**
       
   163      * Default C++ Constructor.
       
   164      */
       
   165     CEvtAction();
       
   166 
       
   167     /**
       
   168      * Second phase of the two phase constructor.
       
   169      */
       
   170     void ConstructL();
       
   171 
       
   172 private: // data
       
   173 	
       
   174 	/**
       
   175 	 * Action Id for an Event.
       
   176 	 */
       
   177 	TInt64					iId;
       
   178 	
       
   179 	/**
       
   180 	 * Event Id to which the Action is associated with.
       
   181 	 */
       
   182 	TEvtEventId				iEvtId;
       
   183 	
       
   184 	/**
       
   185 	 * Action Type for an Event.
       
   186 	 */
       
   187 	TEvtActionType				    iType;
       
   188 	
       
   189 	/**
       
   190 	 * Action String for an Event.
       
   191 	 */
       
   192 	HBufC*				            iActionString;
       
   193     };
       
   194 
       
   195 #endif // C_EVTACTION_H