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