locationtriggering/tsrc/lbtengine_test/Additionaltests/inc/AsynOperationAO.h
changeset 0 667063e416a2
child 31 380473e13443
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2002 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:    Test module to implement Test cases found during review
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef T_TRIGGERFIREOBSERVER_H
       
    23 #define T_TRIGGERFIREOBSERVER_H
       
    24 
       
    25   //  INCLUDES
       
    26 
       
    27   #include <lbtcommon.h>
       
    28   #include <lbttriggerfiringeventobserver.h>
       
    29   #include <lbttriggerfiringeventnotifier.h>
       
    30   #include <lbtsessiontrigger.h>
       
    31   #include <lbtstartuptrigger.h>
       
    32   #include <lbttriggerentry.h>		
       
    33   #include <lbtgeocell.h>
       
    34   #include <lbttriggerchangeeventobserver.h>
       
    35   #include <lbttriggerchangeeventnotifier.h>
       
    36   #include <lbttriggeringsystemsettings.h>
       
    37   #include <lbttriggeringsystemsettingschangeeventobserver.h>
       
    38   #include <lbttriggeringsystemsettingschangeeventnotifier.h>		
       
    39   
       
    40   #include <lbtmanager.h> 	
       
    41 //	#include "lbtcidchangenotifier.h"
       
    42   // FORWARD DECLARATIONS
       
    43   
       
    44   class RLbt; 
       
    45   class CLbtTriggerFiringEventNotifier;
       
    46   class CLbtTriggeringSystemSettingsChangeEventNotifier;
       
    47   class CLbtTriggerEntry;
       
    48   class CLbtTriggerInfo;
       
    49 //  class CLBTOperation;
       
    50   const TUid KPSUidTriggerIdInfo = { 0xA0000196 };  
       
    51   const TUint32 KLbttesttriggerid = 0x00000001; 
       
    52   const TUid KPSUid = { 0x101FB3E3 };  
       
    53   const TUint32 KLbttriggerid = 0x00000001;   
       
    54   
       
    55   const TUid DeletetestUid = { 0x2001FDE1 };  
       
    56   const TUid ModifytestUid = { 0x2001FDDF };  
       
    57    
       
    58 
       
    59   class CTriggerFireObserver: public CTimer,MLbtTriggerFiringEventObserver
       
    60     
       
    61     {
       
    62     
       
    63     public:  // Constructors and destructor
       
    64 
       
    65         /**
       
    66         * Two-phased constructor.
       
    67         */
       
    68         static CTriggerFireObserver* NewL( RLbt& aLbt);
       
    69 
       
    70         /**
       
    71         * Destructor.
       
    72         */
       
    73         ~CTriggerFireObserver();
       
    74         
       
    75         
       
    76         void TriggerFiredL( const TLbtTriggerFireInfo& aFireInfo );
       
    77         
       
    78         void StartNotification( CActiveSchedulerWait* aWait );
       
    79         
       
    80         void CancelNotification( );
       
    81         
       
    82         void CreateTrigger( );
       
    83         
       
    84         void CheckPositionInfoL( const TLbtTriggerFireInfo& aFireInfo );
       
    85         
       
    86                
       
    87         void CreateTriggers( RLbt& aLbt,
       
    88                              CLbtTriggerEntry& aEntry,
       
    89                              TLbtTriggerId& aId,
       
    90                              TBool aFireOnCreation,
       
    91                              CActiveSchedulerWait* aWait
       
    92                            );
       
    93                            
       
    94         void GetTriggersList(RLbt& aLbt, RPointerArray < CLbtTriggerInfo >& aTriggerList,
       
    95            CActiveSchedulerWait* aWait ,CLbtListTriggerOptions* aListOptions=NULL) ;  
       
    96        void ListTriggerIdsList(RLbt& aLbt, RArray < TLbtTriggerId >& aTriggerIdList,
       
    97             CActiveSchedulerWait* aWait,CLbtListTriggerOptions* aListOptions=NULL);                          
       
    98         void CreateIterator(RLbt& aLbt,CActiveSchedulerWait* aWait,CLbtListTriggerOptions* aListOptions=NULL);   
       
    99         void CTriggerFireObserver::DeleteFilteredTriggers( RLbt& aLbt,CLbtTriggerFilterBase* aFilter,CActiveSchedulerWait* aWait ); 
       
   100         TInt GetFireCount( ) ; 
       
   101         TInt GetError( ) ; 
       
   102         
       
   103         TLbtTriggerFireInfo GetFiredTrigger( ) ; 
       
   104         void UpdateTriggersState(RLbt& aLbt, CLbtTriggerEntry::TLbtTriggerState aState, 
       
   105             CActiveSchedulerWait* aWait,CLbtTriggerFilterBase *  aFilter=NULL) ;
       
   106             
       
   107         void CTriggerFireObserver::PopulateFromCurrentCell(CLbtGeoCell& cell,CActiveSchedulerWait* aWait )  ;             
       
   108         
       
   109         void RunL( );
       
   110         
       
   111 	    void DoCancel( );
       
   112 	    
       
   113 //	    CLBTOperation * CreateGeoAreaForCurrentLocationL(CLbtGeoAreaBase::TGeoAreaType aTechType,CLbtGeoAreaBase** aArea,CActiveSchedulerWait* aWait);
       
   114 	    
       
   115 
       
   116 	//	  RTimer iTimer;
       
   117         TRequestStatus iWaitStatus;
       
   118         TInt iTriggerFireCount ;  
       
   119     private:
       
   120 
       
   121         /**
       
   122         * C++ default constructor.
       
   123         */
       
   124         CTriggerFireObserver( );
       
   125 
       
   126         /**
       
   127         * By default Symbian 2nd phase constructor is private.
       
   128         */
       
   129         void ConstructL( RLbt& aLbt );
       
   130         
       
   131     private:
       
   132     
       
   133         CLbtTriggerFiringEventNotifier* iNotifier;
       
   134         
       
   135         CActiveSchedulerWait* iWait;  
       
   136         
       
   137         
       
   138         TLbtTriggerFireInfo iFireInfo;
       
   139         TInt error;     
       
   140 
       
   141     };
       
   142     
       
   143     class CLbtEventObserver : public CTimer,MLbtTriggeringSystemSettingsChangeEventObserver,MLbtTriggerChangeEventObserver
       
   144     
       
   145     {
       
   146     
       
   147     public:  // Constructors and destructor
       
   148 
       
   149         /**
       
   150         * Two-phased constructor.
       
   151         */
       
   152         static CLbtEventObserver* NewL( RLbt& aLbt );
       
   153 
       
   154               
       
   155         /**
       
   156         * Destructor.
       
   157         */
       
   158         ~CLbtEventObserver();
       
   159         
       
   160         
       
   161        void CreateTriggers( RLbt& aLbt,
       
   162                              CLbtTriggerEntry& aEntry,
       
   163                              TLbtTriggerId& aId,
       
   164                              TBool aFireOnCreation,
       
   165                              CActiveSchedulerWait* aWait
       
   166                            );
       
   167        
       
   168         void TriggerChangedL( const TLbtTriggerChangeEvent& aEvent );
       
   169         void NotifyTriggerChangeEvent( RLbt& aLbt,TLbtTriggerChangeEvent  &aEvent ,CActiveSchedulerWait* aWait )   ;
       
   170         void NotifyTriggerChangeEvent( RLbtManager& aLbt,TLbtTriggerChangeEvent  &aEvent ,CActiveSchedulerWait* aWait )   ;
       
   171         void NotifyTriggerChangeEvent2L( RLbt& aLbt,CActiveSchedulerWait* aWait )   ;
       
   172         void TriggerChangeEventDestructor( )   ;
       
   173         void TriggeringsettingsChangeEventDestructor( )   ;
       
   174         void NotifyTriggeringsettingsChangeEventL( RLbt& aLbt,CActiveSchedulerWait* aWait )   ;
       
   175         void TriggeringSystemSettingsChangedL( const TLbtTriggeringSystemSettings& aSettings );
       
   176         
       
   177         void RunL( );
       
   178         
       
   179 	    void DoCancel( );
       
   180 	    
       
   181 
       
   182 
       
   183 
       
   184     
       
   185     private:
       
   186 
       
   187         /**
       
   188         * C++ default constructor.
       
   189         */
       
   190     CLbtEventObserver(  );
       
   191 
       
   192         /**
       
   193         * By default Symbian 2nd phase constructor is private.
       
   194         */
       
   195         void ConstructL( RLbt& aLbt );
       
   196         
       
   197     private:
       
   198     
       
   199         
       
   200         CActiveSchedulerWait* iWait;
       
   201         TLbtTriggerChangeEvent iEvent;
       
   202         TLbtTriggeringSystemSettings iSettings;
       
   203         CLbtTriggerChangeEventNotifier * itrigchangenotifier;
       
   204         CLbtTriggeringSystemSettingsChangeEventNotifier * isettingschangenotifier;
       
   205 
       
   206     };
       
   207 
       
   208 
       
   209 #endif      // T_TRIGGERFIREOBSERVER_H
       
   210 
       
   211 // End of File