locationtriggering/ltcontainer/inc/lbtcontainerutilities.h
changeset 0 667063e416a2
child 13 9c303455e256
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:  Utility class for location triggering container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef LBT_CONTAINER_UTILITIES_H
       
    20 #define LBT_CONTAINER_UTILITIES_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <e32cmn.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CLbtContainerFilterBase;
       
    27 class CLbtContainerListOptions;
       
    28 class CLbtContainerUpdateFilter;
       
    29 class CLbtContainerTriggerEntry;
       
    30 class CLbtGeoAreaBase;
       
    31 class CLbtTriggerFilterBase;
       
    32 class TLbtSecurityPolicy;
       
    33 
       
    34 class LbtContainerUtilities
       
    35 	{
       
    36 	public:
       
    37 		/**
       
    38 		 * From the provided Container list options this method extracts the container filter and makes a clone of it.
       
    39 		 * The owner ship of the copy is transferred to the client which invokes this method. The filter could be 
       
    40 		 * any of the following filters derived from CLbtContainerFilterBase :-
       
    41 		 *
       
    42 		 *			1) CLbtContainerAttrFilter
       
    43 		 *			2) CLbtContainerAreaFilter
       
    44 		 *			3) CLbtContainerCompFilter
       
    45 		 *
       
    46 		 * For any other type of filter this function will leave with KErrNotSupported. Support should be added for any 
       
    47 		 * further filters that are derived from CLbtContainerFilterBase.
       
    48 		 * 
       
    49 		 * @param aFilter the filter that needs to be cloned
       
    50 		 *
       
    51 		 * @return pointer to the cloned filter. The client which invokes this method will have to take ownership
       
    52 		 *         of the returned filter. The returned filter is pushed onto the cleanup stack and left in it.
       
    53 		 *		   The client will have to remove the pointer from the cleanup stack.
       
    54 		 */
       
    55 		static CLbtContainerFilterBase* GetContainerFilterFromListOptionsLC( CLbtContainerListOptions* aListOptions );
       
    56 		
       
    57 		/**
       
    58 		 * Makes a copy of the provided trigger filter and returns the pointer to the copy. The filter is based on the 
       
    59 		 * type of filter supplied. The owner ship of the copy is transferred to the client which invokes this method. 
       
    60 		 * The filter could be any of the following filters derived from CLbtTriggerFilterBase :-
       
    61 		 *
       
    62 		 *		1) CLbtTriggerFilterByAttribute
       
    63 		 *		2) CLbtTriggerFilterByArea
       
    64 		 *		3) CLbtTriggerFilterComposite
       
    65 		 *
       
    66 		 * For any other type of filter this function will leave with KErrNotSupported. Support should be added for any 
       
    67 		 * further filters that are derived from CLbtTriggerFilterBase.
       
    68 		 *
       
    69 		 * @param aFilter the filter that needs to be cloned
       
    70 		 *
       
    71 		 * @return pointer to the cloned filter. The client which invokes this method will have to take ownership
       
    72 		 *         of the returned filter
       
    73 		 */
       
    74 		static CLbtTriggerFilterBase* CloneFilterL(CLbtTriggerFilterBase* aFilter);
       
    75 		
       
    76 		/**
       
    77 		 * From the provided Container update filter this method extracts the container filter and makes a clone of it.
       
    78 		 * The owner ship of the copy is transferred to the client which invokes this method. The filter could be 
       
    79 		 * any of the following filters derived from CLbtContainerFilterBase :-
       
    80 		 *
       
    81 		 *			1) CLbtContainerAttrFilter
       
    82 		 *			2) CLbtContainerAreaFilter
       
    83 		 *			3) CLbtContainerCompFilter
       
    84 		 *
       
    85 		 * For any other type of filter this function will leave with KErrNotSupported. Support should be added for any 
       
    86 		 * further filters that are derived from CLbtContainerFilterBase.
       
    87 		 * 
       
    88 		 * @param aFilter the filter that needs to be cloned
       
    89 		 *
       
    90 		 * @return pointer to the cloned filter. The client which invokes this method will have to take ownership
       
    91 		 *         of the returned filter. The returned filter is pushed onto the cleanup stack and left in it.
       
    92 		 *		   The client will have to remove the pointer from the cleanup stack.
       
    93 		 */
       
    94 		static CLbtContainerFilterBase* GetContainerFilterFromUpdateFilterLC( CLbtContainerUpdateFilter* aListOptions );
       
    95 		
       
    96 		/**
       
    97 		 * Copies the provided geo area type and returns a copy of the provided object.
       
    98 		 * 
       
    99 		 * @param aGeoAreaBase the area object that has to be copied
       
   100 		 * @return the copies area object 
       
   101 		 */
       
   102 		static CLbtGeoAreaBase* CopyGeoAreaL( CLbtGeoAreaBase* aGeoAreaBase ); 
       
   103 		
       
   104 		/**
       
   105 		 * Applies the security policy on the supplied trigger and checks if the trigger suffices
       
   106 		 * the security policy 
       
   107 		 * 
       
   108 		 * @return ETrue if the trigger suffices the security polity, EFalse otherwise
       
   109 		 */
       
   110 		static TBool RunSecurityPolicy(CLbtContainerTriggerEntry* aTriggerEntry, TLbtSecurityPolicy& aSecurityPolicy);
       
   111 		
       
   112 		
       
   113 		/**
       
   114 		 * Applies the security policy on the supplied UID values and checks if it suffices
       
   115 		 * the security policy 
       
   116 		 * 
       
   117 		 * @return ETrue if the UIDs suffices the security polity, EFalse otherwise
       
   118 		 */
       
   119 		static TBool LbtContainerUtilities::RunSecurityPolicy( TUid& aOwnerUid,
       
   120 															   TUid& aManagerUid,
       
   121 															   TSecureId& aStartupProcessUid,
       
   122 															   TLbtSecurityPolicy& aSecurityPolicy );
       
   123 	};
       
   124 
       
   125 #endif // LBT_CONTAINER_UTILITIES_H