eventsui/eventsengine/inc/evtevent.h
branchRCL_3
changeset 18 870918037e16
parent 0 522cd55cc3d7
equal deleted inserted replaced
17:1fc85118c3ae 18:870918037e16
       
     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:  Concrete Class for Location Events.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_EVTEVENT_H
       
    20 #define C_EVTEVENT_H
       
    21 
       
    22 // System Includes
       
    23 #include <e32base.h>
       
    24 #include <lbs.h>
       
    25 
       
    26 // User Includes
       
    27 #include "evtdefs.h"
       
    28 
       
    29 // Forward Declarations
       
    30 class CEvtAction;
       
    31 
       
    32 // extern data types
       
    33 
       
    34 // global Functions
       
    35 
       
    36 // constants go here
       
    37 
       
    38 /**
       
    39  *  @class CEvtEvent
       
    40  *  Concrete class that encapsulates all the information related for
       
    41  *	Event.
       
    42  *
       
    43  *  This class is used to store the detailed information for an event.
       
    44  *
       
    45  *  @lib evtstorage.lib
       
    46  *  @since S60 v9.1
       
    47  */
       
    48 class CEvtEvent : public CBase
       
    49     {
       
    50 public:  
       
    51     /**
       
    52      * Constructs a new instance of Event.
       
    53      *
       
    54      * @return The new instance of Event object.
       
    55      * @leave System wide error code if the object creation fails.         
       
    56      */
       
    57     IMPORT_C static CEvtEvent* NewL();
       
    58     
       
    59     /**
       
    60      * Constructs a new instance of Event Object.
       
    61      * Leaves the created instance on the cleanup stack.
       
    62      *
       
    63      * @return The new instance of Event object.
       
    64      * @leave System wide error code if the object creation fails.         
       
    65      */
       
    66     IMPORT_C static CEvtEvent* NewLC();  
       
    67 
       
    68     /**
       
    69     * Destructor.
       
    70     */
       
    71     virtual ~CEvtEvent();
       
    72 
       
    73 public: // Get and Set methods
       
    74     
       
    75     /**
       
    76      * Gets the Trigger id, identifying the Location Event.
       
    77      * This identifier is definded by Location Triggering Engine.   
       
    78      *
       
    79      * @since S60 v9.1     
       
    80      * @return Event identifier identifying the Location Event.
       
    81      */
       
    82     IMPORT_C TEvtEventId EventId() const;
       
    83  
       
    84     /**
       
    85      * Set the Trigger id, identifying the Location Event. The
       
    86      * identifer is definded by Location Triggering Engine.
       
    87      *
       
    88      * @since S60 v9.1   
       
    89      * @param[in] aId Event identifier identifying the Location Event.
       
    90      */
       
    91     IMPORT_C void SetEventId( const TEvtEventId aId );
       
    92     
       
    93     /**
       
    94      * Gets the Subject for the Location Events.
       
    95      * The Subject is defined by the Location EventsUi on Creation.
       
    96      * A reference to the object's internal string is returned.
       
    97      *
       
    98      * @since S60 v9.1    
       
    99      * @return Subject for the Location Event. If the Subject has not 
       
   100      *         been set for the Location Event, then a NULL
       
   101      *         string is returned.
       
   102      */
       
   103     IMPORT_C TPtrC Subject() const;
       
   104 
       
   105     /** 
       
   106      * Set the Subject String for the Location Event. The Subject is 
       
   107      * copied.
       
   108      *
       
   109      * @since S60 v9.1  
       
   110      * @param[in] aSubject Subject String for the Location Event. 
       
   111      *                  The Subject string is copied.
       
   112      * @leave KErrNoMemory If there is not enough memory to copy the string.
       
   113      */
       
   114     IMPORT_C void SetSubjectL( const TDesC& aSubject );
       
   115     
       
   116     /**
       
   117      * Gets the Place for the Location Events.
       
   118      * The Place is defined by the Location EventsUi on Creation.
       
   119      * A reference to the object's internal string is returned.
       
   120      *
       
   121      * @since S60 v9.1    
       
   122      * @return Place String for the Location Event. If the Place has not 
       
   123      *         been set for the Location Event, then a NULL
       
   124      *         string is returned.
       
   125      */
       
   126     IMPORT_C TPtrC Place() const;
       
   127 
       
   128     /** 
       
   129      * Set the Place String for the Location Event. The Place is 
       
   130      * copied.
       
   131      *
       
   132      * @since S60 v9.1  
       
   133      * @param[in] aPlace Place String for the Location Event. 
       
   134      *                  The Place string is copied.
       
   135      * @leave KErrNoMemory If there is not enough memory to copy the string.
       
   136      */
       
   137     IMPORT_C void SetPlaceL( const TDesC& aPlace );
       
   138     
       
   139     /**
       
   140      * Gets the Status of the Location Event.
       
   141      * The Status is defined by the Location EventsUi on Creation.
       
   142      * Status is updated as and when the Event moves to different state.
       
   143      *
       
   144      * @since S60 v9.1    
       
   145      * @return TEvtEventStatus Status for the Location Event.
       
   146      */
       
   147     IMPORT_C TEvtEventStatus EventStatus() const;
       
   148 
       
   149     /** 
       
   150      * Set the Status for the Location Event.
       
   151      *
       
   152      * @since S60 v9.1  
       
   153      * @param[in] aEventStatus Status for the Location Event. 
       
   154      */
       
   155     IMPORT_C void SetEventStatus( 
       
   156                             const TEvtEventStatus aEventStatus );
       
   157                             
       
   158     /**
       
   159      * Gets the Radius for the Location Events.
       
   160      * The Radius is defined by the Location EventsUi on Creation.
       
   161      * Radius is defined based on the place.
       
   162      *
       
   163      * @since S60 v9.1    
       
   164      * @return Radius for the Location Event.
       
   165      */
       
   166     IMPORT_C TReal Radius() const;
       
   167 
       
   168     /** 
       
   169      * Set the Radius for the Location Event.
       
   170      *
       
   171      * @since S60 v9.1  
       
   172      * @param[in] aRadius Radius for the Location Event. 
       
   173      */
       
   174     IMPORT_C void SetRadius( const TReal aRadius );
       
   175              
       
   176     /**
       
   177      * Gets the Repeast flag for the Location Event.
       
   178      * The Repeast is defined by the Location EventsUi on Creation.
       
   179      *
       
   180      * @since S60 v9.1    
       
   181      * @return TBool Repeat flag for the Location Event.
       
   182      */
       
   183     IMPORT_C TBool Repeat() const;
       
   184 
       
   185     /** 
       
   186      * Set the Repeat flag for the Location Event.
       
   187      *
       
   188      * @since S60 v9.1  
       
   189      * @param[in] TBool Repeat flag for the Location Event. 
       
   190      */
       
   191     IMPORT_C void SetRepeat( const TBool aRepeat );
       
   192         
       
   193     /**
       
   194      * Gets the Description for the Location Events.
       
   195      * The Description is defined by Location EventsUi on Creation.
       
   196      * A reference to the object's internal string is returned.
       
   197      *
       
   198      * @since S60 v9.1    
       
   199      * @return Description for the Location Event. If the Description 
       
   200      *          has not been set for the Location Event, then a NULL
       
   201      *         string is returned.
       
   202      */
       
   203     IMPORT_C TPtrC Description() const;
       
   204 
       
   205     /** 
       
   206      * Set the Description String for the Location Event. The  
       
   207      * Description is copied.
       
   208      *
       
   209      * @since S60 v9.1  
       
   210      * @param[in] aDescription Description String for the Location Event. 
       
   211      *                  The Description string is copied.
       
   212      * @leave KErrNoMemory If there is not enough memory to copy the string.
       
   213      */
       
   214     IMPORT_C void SetDescriptionL( const TDesC& aDescription );
       
   215     
       
   216     /**
       
   217      * Gets the Action for the Location Events.
       
   218      * The Action is defined by the Location EventsUi on Creation.
       
   219      * A reference to the object's action is returned.
       
   220      *
       
   221      * @since S60 v9.1    
       
   222      * @return Action for the Location Event. If the Action has 
       
   223      *          not been set for the Location Event, then a NULL
       
   224      *          is returned.
       
   225      */
       
   226     IMPORT_C CEvtAction& Action() const;
       
   227 
       
   228     /** 
       
   229      * Set the Action for the Location Event. The Action is 
       
   230      * copied.
       
   231      *
       
   232      * @since S60 v9.1  
       
   233      * @param[in] aAction Action for the Location Event. 
       
   234      *                  The ownership of Action is transferred to Event.
       
   235      * @leave KErrNoMemory If there is not enough memory to copy the string.
       
   236      */
       
   237     IMPORT_C void SetActionL( CEvtAction* aAction );
       
   238 
       
   239     /** 
       
   240      * Check if Action is assigned to the Event.
       
   241      *
       
   242      * @since S60 v9.1  
       
   243      * @TBool Returns ETrue if action is present Or else EFalse.
       
   244      */
       
   245     IMPORT_C TBool HasAction( );
       
   246 
       
   247     /** 
       
   248      * Set the Location for the Location Event.
       
   249      *
       
   250      * @since S60 v9.1  
       
   251      * @param[in] aLocation Location for the Location Event. 
       
   252      * @leave KErrNoMemory If there is not enough memory to copy the string.
       
   253      */
       
   254      void SetLocationL( TPosition& aLocation );
       
   255     
       
   256     /**
       
   257      * Gets the Location for the Location Events.
       
   258      * The Location is defined by the Location EventsUi on Creation.
       
   259      * A reference to the object's action is returned.
       
   260      *
       
   261      * @since S60 v9.1    
       
   262      * @return Location for the Location Event. If the Action has 
       
   263      *          not been set for the Location Event, then a NULL
       
   264      *          is returned.
       
   265      */
       
   266      IMPORT_C TPosition& Location() const;
       
   267 
       
   268 private: // methods
       
   269     /**
       
   270      * Default C++ Constructor.
       
   271      */
       
   272     CEvtEvent();
       
   273     
       
   274     /**
       
   275      * Default Copy Constructor.
       
   276      */
       
   277     CEvtEvent(CEvtEvent& );
       
   278 
       
   279     /**
       
   280      * Second phase of the two phase constructor.
       
   281      */
       
   282     void ConstructL();
       
   283 
       
   284 private: // data
       
   285     
       
   286     /**
       
   287      * System wide unique identifier identifying the Location Event. 
       
   288      * This identifier is defined by the Location Triggering Engine.
       
   289      *
       
   290      * Owns
       
   291      */
       
   292     TEvtEventId                      iEventId;
       
   293     
       
   294     /**
       
   295      * Event Subject.
       
   296      * Subject for the Location Event. The Subject is defined by the Location
       
   297      * Events Ui.
       
   298      * 
       
   299      * Owns
       
   300      */
       
   301     HBufC*                          iSubject;
       
   302     
       
   303     /**
       
   304      * Event Place.
       
   305      * Place for the Location Event. The String is defined by the Location
       
   306      * Events Ui.
       
   307      * 
       
   308      * Owns
       
   309      */
       
   310     HBufC*                          iPlace;
       
   311 	
       
   312 	/**
       
   313 	 * Event Status.
       
   314 	 */
       
   315 	TEvtEventStatus					iEventStatus;
       
   316     
       
   317 	/**
       
   318 	 * Radius for Accuracy.
       
   319 	 */
       
   320 	TReal							iRadius;
       
   321     
       
   322 	/**
       
   323 	 * Repeat Event.
       
   324 	 */
       
   325 	TBool							iRepeat;
       
   326     
       
   327     /**
       
   328      * Event Description.
       
   329      * Description for the Location Event. The String is defined by the
       
   330      * Location Events Ui.
       
   331      * 
       
   332      * Owns
       
   333      */
       
   334     HBufC*                          iDescription;
       
   335 	    
       
   336 	/**
       
   337 	 * Tone String for Event.
       
   338 	 */
       
   339 	CEvtAction*				        iAction;
       
   340     
       
   341     /**
       
   342      * lat-long information 
       
   343      * 
       
   344      */
       
   345     TPosition*             			iLocation;
       
   346 
       
   347     };
       
   348 
       
   349 #endif // C_EVTEVENT_H