locationtriggering/ltcontainer/inc/lbttriggerstoreinterface.h
changeset 56 4e949f03ecc5
equal deleted inserted replaced
-1:000000000000 56:4e949f03ecc5
       
     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:  This file defines the interface which the trigger stores must
       
    15 *                implement.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef M_TRIGGERSTORE_INTERFACE_H
       
    21 #define M_TRIGGERSTORE_INTERFACE_H
       
    22 
       
    23 #include <lbtlisttriggeroptions.h>
       
    24 #include <lbttriggerdynamicinfo.h>
       
    25 #include "lbtcontainertriggerentry.h"
       
    26 #include "lbtcontainerlistoptions.h"
       
    27 #include "lbtcontainerupdatefilter.h"
       
    28 #include "lbtsecuritypolicy.h"
       
    29 
       
    30 // FORWARD DECLARATION
       
    31 class MLbtTriggerStoreObserver;
       
    32 
       
    33 /**
       
    34  * This typedef defines a bitmask of the triggers supported by 
       
    35  * a trigger store. It is a bitmask of the CLbtTriggerEntry::TType enumerator.
       
    36  */
       
    37 typedef TInt32 TTriggerTypeMask;
       
    38 
       
    39 /**
       
    40  *  This M class defines the interface for the trigger stores.
       
    41  *
       
    42  *  The Trigger Store Managers must implement this interface to
       
    43  *  provide the store functionality.
       
    44  */
       
    45 class MLbtTriggerStore
       
    46     {
       
    47 public: // Methods of the interface.
       
    48 
       
    49 	/**
       
    50 	 * Structure used to supply data on notifing observers of any trigger 
       
    51 	 * store modification operation
       
    52 	 *
       
    53 	 */
       
    54 	struct TLbtTriggerModifiedInfo
       
    55 		{
       
    56 		// The id of the trigger that is modified
       
    57 		TLbtTriggerId iTriggerId;
       
    58 		
       
    59 		// The area type of the trigger that is modified
       
    60 		CLbtGeoAreaBase::TGeoAreaType iAreaType;
       
    61 		
       
    62 		// Uid of manager ui
       
    63 		TUid iManagerUi;
       
    64 		
       
    65 		// Uid of the owner
       
    66 		TUid iOwner;
       
    67 		
       
    68 		// Uid of the startup process
       
    69 		TUid iStartupProcess;
       
    70 		};
       
    71 	
       
    72     /**
       
    73      * This method returns the types of triggers that are supported in this
       
    74      * trigger store.
       
    75      *
       
    76      * @return a bitmask of the types of triggers supported by a trigger 
       
    77      * store.
       
    78      */
       
    79     virtual TTriggerTypeMask SupportedTriggerTypes() = 0;
       
    80     
       
    81 	/**
       
    82      * Creates a trigger in the trigger store in a asynchronous fashion. 
       
    83      * Once the creation is complete the client is signalled by completing
       
    84      * its active object. The request staus of the active object will hold
       
    85      * the error code which informs the client of the status of the creation.
       
    86      *
       
    87      * @param aEntry reference to the trigger entry object that contains the 
       
    88      *        trigger data which has to be created.
       
    89      *
       
    90      * @param aStatus the clients request status
       
    91      */    
       
    92     virtual void CreateTriggerL( CLbtContainerTriggerEntry &aEntry,
       
    93                     		     TRequestStatus& aStatus ) = 0;	
       
    94 	
       
    95 	/** 
       
    96 	 * Function should append the information of the trigger that has been modfied
       
    97 	 * by the latest operation
       
    98 	 *
       
    99 	 * @param aArray the array of the client to which the trigger info should be appended
       
   100 	 */
       
   101 	virtual void TriggersModified(RArray<TLbtTriggerModifiedInfo>& aArray) = 0;
       
   102 	
       
   103 	/**
       
   104 	 * Used to set the time till when compaction is preferred. Over the time specified
       
   105 	 * compaction should not happed in ideal cases. As and when compaction happens this
       
   106 	 * time is check to see that compaction does not over shoot this time interval
       
   107 	 *
       
   108 	 * @param aTime the time untill which compaction can proceed without effecting
       
   109 	 *        the system
       
   110 	 */ 
       
   111 	virtual void SetTimeTillCompaction(TTime aTime) = 0;
       
   112 	
       
   113 	
       
   114 	/**
       
   115 	 * Used to retreive a specified list of triggers from the store. This triggers
       
   116 	 * are specifed using an array of trigger ids.
       
   117 	 *
       
   118 	 * @param aTriggerIds the array of trigger ids which need to be retreived
       
   119 	 *
       
   120 	 * @param aTriggers reference to the pointer array into which the trigger are 
       
   121      *        retreived from the trigger store
       
   122      *
       
   123      * @param aStatus the clients active status
       
   124      *
       
   125      * @param aSecurityPolicy the security policy that the triggers have to satisfy
       
   126 	 */
       
   127 	virtual void GetTriggersL( RArray<TLbtTriggerId>& aTriggerIds,
       
   128 							   RPointerArray<CLbtContainerTriggerEntry>& aTriggers, 
       
   129     						   TLbtSecurityPolicy& aSecurityPolicy,
       
   130     						   TRequestStatus &aStatus ) = 0;
       
   131     
       
   132     /**
       
   133      * Used to list trigger based on list options. The list options contains a filter
       
   134      * based on which the trigger will be listed. The listing is done asynchronously
       
   135      * 
       
   136      * @param aFilter the container list options which contains the filter based on
       
   137      *        which trigger are filtered in the trigger store
       
   138      *
       
   139      * @param aTriggers refernce to the pointer array into which the trigger are 
       
   140      *        retreived from the trigger store and stored
       
   141      *
       
   142      * @param aStatus the clients active status
       
   143      */
       
   144     virtual void ListTriggersL( CLbtContainerListOptions* aFilter, 
       
   145     							RPointerArray<CLbtContainerTriggerEntry>& aTriggers, 
       
   146     							TLbtSecurityPolicy& aSecurityPolicy,
       
   147     							TRequestStatus &aStatus ) = 0;    
       
   148     
       
   149     /**
       
   150      * Updates the contents of a trigger in the trigger store based on masks. The trigger 
       
   151      * is searched in the trigger store based on the trigger id supplied in the trigger 
       
   152      * entry object. The masks define the trigger data members that need to be updated. 
       
   153      * This request is processed asychronously.
       
   154      *
       
   155      * @param aEntry reference to the trigger entry object that contains the 
       
   156      *        trigger data which has to be created.
       
   157      *
       
   158      * @param aDataMask the data mask based on which the contents in the triggers dynamic
       
   159      *        info is updated. The masks are defined by enumeration
       
   160      *        TLbtTriggerDynamicInfo::TLbtDynamicInfoAttribute
       
   161      * 
       
   162      * @param aAttrMask the attribute mask based on which the atrributes of the trigger
       
   163      *        are updated. The masks are defined by enumeration
       
   164      *        CLbtTriggerEntry::TAttribute
       
   165      *
       
   166      * @param aStatus the clients active status
       
   167      */
       
   168     virtual void UpdateTriggerL( CLbtContainerTriggerEntry& aEntry,
       
   169     						     TLbtTriggerDataMask aDataMask,
       
   170     						     TLbtTriggerAttributeFieldsMask aAttrMask,
       
   171     						     TLbtSecurityPolicy& aSecurityPolicy,
       
   172     						     TRequestStatus& aStatus) = 0;
       
   173     /**
       
   174      * Updates the state of multiple triggers based on container filter. This request 
       
   175      * is processed asychronously.
       
   176      *
       
   177      * @param aState the state to which the triggers that fall in the filter needs to 
       
   178      *               be to updated to
       
   179      * @param aFilter the filter based on which the triggers are selected to be updated
       
   180      * @param aStatus the clients active status
       
   181      */
       
   182     virtual void  UpdateTriggersStateL( CLbtTriggerEntry::TLbtTriggerState aState,
       
   183 					                    CLbtContainerUpdateFilter* aFilter,
       
   184 					                    TLbtFireOnUpdate aFireOnUpdate,
       
   185 					                    TLbtSecurityPolicy& aSecurityPolicy,
       
   186 					                    TRequestStatus& aStatus ) = 0;
       
   187 	
       
   188 	/**
       
   189      * Updates the validity of multiple triggers specified by trigger ids.
       
   190      *
       
   191      * @param aValidity the validity to which the triggers have to be changed to
       
   192      * @param aTriggerIds the array of trigger ids of which the validity have to be 
       
   193      *        changed
       
   194      * @param aStatus the clients active status
       
   195      */
       
   196     virtual void UpdateTriggersValidityL( TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidity,
       
   197 					                      RArray<TLbtTriggerId>& aTriggerIds,
       
   198 					                      TLbtSecurityPolicy& aSecurityPolicy,
       
   199 					                      TRequestStatus& aStatus) = 0;
       
   200 
       
   201 	/**
       
   202 	 * Updates the fired state of multiple triggers specified by the trigger ids
       
   203 	 *
       
   204 	 * @param aTriggerIds the array of trigger ids of which the validity have to be 
       
   205      *        changed
       
   206      * @param aFireBool the state to which the fired attributes has to be changed to
       
   207      * @param aStatus the clients active status
       
   208 	 */
       
   209 	virtual void UpdateTriggerFiredStateL( RArray<TLbtTriggerId>& aTriggerIds,
       
   210 										   TBool aFireBool,
       
   211 					                       TRequestStatus& aStatus) = 0;
       
   212 
       
   213 	/**
       
   214      * Deletes multiple triggers based container update filter. All the trigger in the store
       
   215      * that satisfy the supplied filter are deleted from the store.
       
   216      *
       
   217      * @param aFilter the filter based on which the triggers are selected to be updated
       
   218      * @param aStatus the clients active status
       
   219      */
       
   220     virtual void DeleteTriggersL( CLbtContainerUpdateFilter* aFilter, 
       
   221     							  TLbtSecurityPolicy& aSecurityPolicy,
       
   222     						 	  TRequestStatus& aStatus) = 0;            
       
   223     
       
   224     /**
       
   225      * Deletes a single trigger which matches the trigger id supplied
       
   226      *
       
   227      * @param aTriggerId the id of the trigger which needs to be deleted
       
   228      */
       
   229     virtual void DeleteTriggerL( TLbtTriggerId aTriggerId ) = 0;
       
   230     
       
   231     /**
       
   232      * Returns the count of all the enabled and valid triggers in the store.
       
   233      *
       
   234      * @return the number of enabled and valid triggers
       
   235      */
       
   236     virtual TInt GetCountOfEnabledAndValidTriggers() =0;
       
   237     
       
   238     /**
       
   239      * Method to check if the trigger store is busy. The store could be busy due to many
       
   240      * reasons with the mail reason being compaction.
       
   241      *
       
   242      * @return ETrue if the store is busy, EFalse otherwise
       
   243      */
       
   244     virtual TBool IsStoreBusy() = 0;    
       
   245     
       
   246     /**
       
   247      * Used to set the trigger store observer. The set observer will be notifed if any updation
       
   248      * operation is preformed on the trigger store. The modification include creation, updation 
       
   249      * or deletion of any trigger
       
   250      *
       
   251      * @param pointer to the observed that needs to be notified when the store is updated
       
   252      */
       
   253     virtual void SetStoreChangeObserver(MLbtTriggerStoreObserver* aObserver) = 0;
       
   254     
       
   255     /**
       
   256      * The implementation of this method should cancel any ongoing async 
       
   257      * operation
       
   258      */
       
   259     virtual TInt CancelCurrentOperation() = 0;
       
   260     
       
   261     /**
       
   262      * pure virtual destructor
       
   263      */
       
   264      virtual ~MLbtTriggerStore() {};    
       
   265     };
       
   266 
       
   267 
       
   268 #endif // M_TRIGGERSTORE_INTERFACE_H
       
   269 
       
   270 // end of file
       
   271 
       
   272