locationtriggering/ltcontainer/inc/lbtcontainertriggerentry.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     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:  Abstract base class for location triggering entries
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_LBT_CONTAINER_TRIGGER_ENTRY_H
       
    20 #define C_LBT_CONTAINER_TRIGGER_ENTRY_H
       
    21 
       
    22 #include <lbtcommon.h>
       
    23 #include <lbttriggerinfo.h>
       
    24 #include <lbttriggerentry.h>
       
    25 
       
    26 // CONSTANTS
       
    27 const static TInt KVisitedCellSize(2); 
       
    28 
       
    29 typedef TUint64 TLbtTriggerDataMask;
       
    30 
       
    31 // forward declaration
       
    32 class CLbtExtendedTriggerInfo;
       
    33 
       
    34 // Activity status for strategy
       
    35 enum TLbtTriggerActivityStatus
       
    36     {
       
    37     /**
       
    38      * Active
       
    39      */
       
    40     EActive = 1,        
       
    41     /**
       
    42      * Inactive
       
    43      */
       
    44     EInactive = 2       
       
    45     };
       
    46 // Hybrid status of the trigger
       
    47 enum THybridState
       
    48     {
       
    49     EHybridNone,
       
    50     
       
    51     EHybridActive,
       
    52     
       
    53     EHybridInActive 
       
    54     };
       
    55 
       
    56 /**
       
    57  * Structure used by startegy for storing supervision
       
    58  * information
       
    59  */ 
       
    60 struct TStrategyData
       
    61 	{
       
    62 	// Trigger hybrid status
       
    63 	THybridState iHybridState;
       
    64 	// The time at which the trigger fired
       
    65 	TInt64 iFireTime;
       
    66 	
       
    67 	// The activity status of the trigger
       
    68 	TLbtTriggerActivityStatus iActivityStatus;
       
    69 	
       
    70 	// Boundary condition for cell supervision
       
    71 	TInt iBoundaryCondition;
       
    72 	
       
    73 	// Visited cells 
       
    74 	TInt iVisitedCell[KVisitedCellSize];
       
    75 	};
       
    76    
       
    77 
       
    78        	
       
    79 /* This is the main Trigger Information class used to set and access trigger information in the container.
       
    80 * It is derived from the CLbtTriggerInfo class from the Location Triggering API.
       
    81 */
       
    82        	
       
    83 NONSHARABLE_CLASS( CLbtContainerTriggerEntry ) : public CLbtTriggerInfo
       
    84     {
       
    85 public:
       
    86     enum TLbtContainerTriggerAttribute
       
    87         {
       
    88         EContainerAttributeRectTriggerArea=0x00010000,
       
    89         EContainerAttributeHysteresisRadius=0x00020000,
       
    90         EContainerAttributeIsFired=0x00040000,
       
    91         EContainerAttributeStrategyData=0x0080000,
       
    92         EContainerAttributeOwnerSid=0x00100000,
       
    93         EContainerDynInfoAttributeValidity=0x00200000,
       
    94         EContainerDynInfoAttributeActivity=0x00400000,
       
    95         EContainerDynInfoAttributeDistance=0x00800000,
       
    96         EContainerAttributeIsTriggerFireOnCreation=0x001000000,
       
    97         EContainerAttributeFireInfo=0X002000000,
       
    98         EContainerAttributeAll = 0xFFFFFFFF
       
    99         };
       
   100         
       
   101     /**
       
   102      * Constructs a new instance of container trigger entry object.
       
   103      *
       
   104      * @return The new instance of the container trigger entry object.
       
   105      */
       
   106     IMPORT_C static CLbtContainerTriggerEntry* NewL();
       
   107 
       
   108     /**
       
   109      * Constructs a new instance of container trigger entry object with the 
       
   110      * given parameters.
       
   111      *
       
   112      * @param[in] aEntry The pointer to the trigger entry. 
       
   113      * Ownership is transferred.
       
   114      * @param[in] aDynInfo The pointer to the trigger dynamic 
       
   115      * information object. Ownership is transferred.
       
   116      * @param[in] aExtendedTriggerInfo The pointer to the trigger derived dynamic 
       
   117      * information object. Ownership is transferred.
       
   118      *
       
   119      * @return The new instance of trigger information object.
       
   120      */
       
   121     IMPORT_C static CLbtContainerTriggerEntry* NewL(
       
   122                         CLbtTriggerEntry* aEntry,
       
   123                         TLbtTriggerDynamicInfo* aDynInfo,
       
   124                         CLbtExtendedTriggerInfo* aExtendedTriggerInfo );                
       
   125        
       
   126     /**
       
   127      * Destructor
       
   128      */
       
   129     IMPORT_C virtual ~CLbtContainerTriggerEntry();
       
   130 
       
   131   
       
   132     /**
       
   133      * Gets extended trigger information object.
       
   134      *
       
   135      * @return Pointer to the extended trigger information object.
       
   136      * Ownership is not transferred.
       
   137      */
       
   138     IMPORT_C CLbtExtendedTriggerInfo* ExtendedTriggerInfo();
       
   139 		
       
   140     /**
       
   141      * Sets extended trigger information object.
       
   142      *
       
   143      * @param[in] aDynInfo Pointer to the extended trigger
       
   144      * information object. Ownership is transferred.
       
   145      */
       
   146     IMPORT_C void SetExtendedTriggerInfo( 
       
   147                         CLbtExtendedTriggerInfo* aExtendedTriggerInfo );
       
   148                         
       
   149     /**
       
   150      * 
       
   151      */
       
   152     IMPORT_C void SetStrategyData( TStrategyData& aStartegyData );    
       
   153     
       
   154     /**
       
   155      * 
       
   156      */
       
   157     IMPORT_C TStrategyData StrategyData();                  
       
   158                         
       
   159     /**
       
   160      * Copy constructor
       
   161      */                    
       
   162     CLbtContainerTriggerEntry( CLbtContainerTriggerEntry& aEntry);   	
       
   163 
       
   164 private:
       
   165     /**
       
   166      * Constructor.
       
   167      */
       
   168  	CLbtContainerTriggerEntry();
       
   169         
       
   170      // CLbtContainerTriggerEntry( CLbtContainerTriggerEntry& aEntry);   
       
   171     /**
       
   172      * Symbian 2nd phase of Construction.
       
   173      */
       
   174     void ConstructL();
       
   175 
       
   176     /**
       
   177      * Symbian 2nd phase of Construction.
       
   178      */
       
   179     void ConstructL(
       
   180                     CLbtTriggerEntry* aEntry,
       
   181                     TLbtTriggerDynamicInfo* aDynInfo,
       
   182                     CLbtExtendedTriggerInfo* aExtendedTriggerInfo ); 
       
   183 
       
   184 
       
   185 	void InitializeStrategyData();
       
   186                     
       
   187     void CloneL(CLbtContainerTriggerEntry& aEntry);              
       
   188        
       
   189 private:
       
   190     
       
   191     /**
       
   192      * Derived Trigger dynamic info
       
   193      */
       
   194     CLbtExtendedTriggerInfo *iExtendedTriggerInfo;
       
   195     
       
   196     // Strategy Data
       
   197     TStrategyData iStrategyData;
       
   198     };
       
   199 
       
   200 
       
   201 #endif // C_LBT_CONTAINER_TRIGGER_ENTRY_H