epoc32/include/mw/lbttriggerconditionarea.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Data class for the area trigger condition.
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
#ifndef LBTTRIGGERCONDITIONAREA_H
williamr@2
    22
#define LBTTRIGGERCONDITIONAREA_H
williamr@2
    23
williamr@2
    24
#include <e32base.h>
williamr@2
    25
#include <lbttriggerconditionbase.h>
williamr@2
    26
williamr@2
    27
class CLbtGeoAreaBase;
williamr@2
    28
williamr@2
    29
/**
williamr@2
    30
 *  Data class for the trigger condition based on the geographical area and movement
williamr@2
    31
 *  of the terminal.
williamr@2
    32
 *
williamr@2
    33
 *  The trigger condition specifies where and when a location trigger shall be 
williamr@2
    34
 *  fired.
williamr@2
    35
 *
williamr@2
    36
 *  Trigger area defines where the trigger shall be fired. It is a 
williamr@2
    37
 *  geographical area. Currently, only geographical circular area
williamr@2
    38
 *  is supported by the system. 
williamr@2
    39
 *
williamr@2
    40
 *  Direction of movement defines when the trigger shall be fired. It specifies
williamr@2
    41
 *  if the trigger shall be fired wether the terminal enters or exits the trigger area.
williamr@2
    42
 * 
williamr@2
    43
 *  When a trigger has been fired, it will not be ready to be fired again until 
williamr@2
    44
 *  the terminal has moved a certain distance ( "hysteresis distance" ) outside 
williamr@2
    45
 *  of the trigger area. 
williamr@2
    46
 *
williamr@2
    47
 *  Hysteresis distance is defined by system and can't be accessed
williamr@2
    48
 *  by client applications.
williamr@2
    49
 *
williamr@2
    50
 *  @lib lbt.lib
williamr@2
    51
 *  @since S60 5.1
williamr@2
    52
 */
williamr@2
    53
class CLbtTriggerConditionArea : public CLbtTriggerConditionBase
williamr@2
    54
    {
williamr@2
    55
public:  // Data types
williamr@2
    56
    /**
williamr@2
    57
     *  Specifies in which direction the location trigger is fired.
williamr@2
    58
     */
williamr@2
    59
    enum TDirection
williamr@2
    60
        {
williamr@2
    61
        /** The trigger is fired when the terminal is entering the 
williamr@2
    62
         * trigger area. 
williamr@2
    63
         */
williamr@2
    64
        EFireOnEnter = 1,
williamr@2
    65
        /** The trigger is fired when the terminal is exiting the 
williamr@2
    66
         * trigger area.
williamr@2
    67
         */
williamr@2
    68
        EFireOnExit  = 2 
williamr@2
    69
        };
williamr@2
    70
williamr@2
    71
public:  
williamr@2
    72
    /**
williamr@2
    73
     * Constructs a new instance of trigger condition class based
williamr@2
    74
     * on the geographical area and movement of the terminal.
williamr@2
    75
     *
williamr@2
    76
     * @panic ELbtErrArgument If the input trigger area is a 
williamr@2
    77
     * class of CLbtGeoRect.
williamr@2
    78
     *
williamr@2
    79
     * @param[in] aArea The trigger area. Only pointer to 
williamr@2
    80
     * CLbtGeoCircle object is supported. Ownership is transferred
williamr@2
    81
     * to the returned CLbtTriggerConditionArea object.
williamr@2
    82
     * @param[in] aDirection The direction( enter/exit ) of when a 
williamr@2
    83
     * trigger shall be fired. 
williamr@2
    84
     * @return A new instance of trigger condition class.
williamr@2
    85
     */
williamr@2
    86
    IMPORT_C static CLbtTriggerConditionArea* NewL( 
williamr@2
    87
        CLbtGeoAreaBase* aArea,
williamr@2
    88
        TDirection aDirection );
williamr@2
    89
williamr@2
    90
    /**
williamr@2
    91
     * Constructs a new instance of trigger condition class.
williamr@2
    92
     *
williamr@2
    93
     * If construction is successful, it returns s a pointer to the 
williamr@2
    94
     * trigger condition object. The returned object has no 
williamr@2
    95
     * trigger area set, and the direction is @p EFireOnEnter.
williamr@2
    96
     *
williamr@2
    97
     * @return A new instance of this class.
williamr@2
    98
     */
williamr@2
    99
    IMPORT_C static CLbtTriggerConditionArea* NewL();
williamr@2
   100
williamr@2
   101
    /**
williamr@2
   102
     * Constructs a new instance of trigger condition class
williamr@2
   103
     * and pushes it onto cleanup stack.
williamr@2
   104
     *
williamr@2
   105
     * If construction is successful, it returns s a pointer to the 
williamr@2
   106
     * trigger condition object. The returned object has no 
williamr@2
   107
     * trigger area set, and the direction is @p EFireOnEnter.
williamr@2
   108
     *
williamr@2
   109
     * @return A new instance of this class.
williamr@2
   110
     */
williamr@2
   111
    IMPORT_C static CLbtTriggerConditionArea* NewLC();
williamr@2
   112
williamr@2
   113
    /**
williamr@2
   114
     * Returns CLbtTriggerConditionBase::ETriggerConditionArea.
williamr@2
   115
     *
williamr@2
   116
     * @return CLbtTriggerConditionBase::ETriggerConditionArea
williamr@2
   117
     */
williamr@2
   118
    virtual TType Type() const;
williamr@2
   119
williamr@2
   120
    /**
williamr@2
   121
     * Destructor.
williamr@2
   122
     */
williamr@2
   123
    IMPORT_C virtual ~CLbtTriggerConditionArea();
williamr@2
   124
williamr@2
   125
public: // Member functions
williamr@2
   126
williamr@2
   127
    /**
williamr@2
   128
     * Gets the direction that defines when a trigger shall be fired.
williamr@2
   129
     *
williamr@2
   130
     * If no direction has been set for the trigger, it will return
williamr@2
   131
     * @p EFireOnEnter.
williamr@2
   132
     *
williamr@2
   133
     * @return The direction that specified when a trigger shall be fired.
williamr@2
   134
     */
williamr@2
   135
    IMPORT_C TDirection Direction() const;
williamr@2
   136
williamr@2
   137
    /**
williamr@2
   138
     * Sets the direction that defines when a trigger shall be fired.
williamr@2
   139
     *
williamr@2
   140
     * @param[in] aDirection The trigger direction. It defines when a trigger
williamr@2
   141
     * shall be fired.
williamr@2
   142
     */
williamr@2
   143
    IMPORT_C void SetDirection( 
williamr@2
   144
        TDirection aDirection );
williamr@2
   145
williamr@2
   146
    /**
williamr@2
   147
     * Gets trigger area. 
williamr@2
   148
     *
williamr@2
   149
     * If the trigger area is not set before, NULL is returned.
williamr@2
   150
     * Ownership of the returned trigger area is not transferred
williamr@2
   151
     * to the client.
williamr@2
   152
     *
williamr@2
   153
     * @return Pointer to the trigger area. Ownership of returned
williamr@2
   154
     * object is not transfered to the client.
williamr@2
   155
     */
williamr@2
   156
    IMPORT_C CLbtGeoAreaBase* TriggerArea() const;
williamr@2
   157
williamr@2
   158
    /**
williamr@2
   159
     * Sets trigger area. 
williamr@2
   160
     *
williamr@2
   161
     * @panic ELbtErrArgument If the input trigger area is a 
williamr@2
   162
     * class of CLbtGeoRect.
williamr@2
   163
     * @param[in] aArea The trigger area. Only pointer to 
williamr@2
   164
     * CLbtGeoCircle class is supported by current system. 
williamr@2
   165
     * Ownership is transferred to this object.
williamr@2
   166
     */
williamr@2
   167
    IMPORT_C void SetTriggerArea( 
williamr@2
   168
        CLbtGeoAreaBase* aArea );
williamr@2
   169
        
williamr@2
   170
    
williamr@2
   171
protected:
williamr@2
   172
    /**
williamr@2
   173
     * Externalize method that subclass must implement.
williamr@2
   174
     * @param[in] aStream Stream to which the object should be externalized.
williamr@2
   175
     */
williamr@2
   176
	virtual void DoExternalizeL(RWriteStream& aStream)const;
williamr@2
   177
	
williamr@2
   178
	/**
williamr@2
   179
     * Internalize method that subclass must implement.
williamr@2
   180
     * @param[in] aStream Stream from which the object should be internalized.
williamr@2
   181
     */
williamr@2
   182
	virtual void DoInternalizeL(RReadStream& aStream);
williamr@2
   183
	
williamr@2
   184
	
williamr@2
   185
private:
williamr@2
   186
    /**
williamr@2
   187
     * Default constructor.
williamr@2
   188
     *
williamr@2
   189
     * Trigger area is set as NULL and default direction 
williamr@2
   190
     * is @p EFireOnEnter.
williamr@2
   191
     */
williamr@2
   192
    CLbtTriggerConditionArea();
williamr@2
   193
williamr@2
   194
    /**
williamr@2
   195
     *  Symbian 2nd phase constructor.
williamr@2
   196
     */
williamr@2
   197
    void ConstructL();
williamr@2
   198
    
williamr@2
   199
    /**
williamr@2
   200
     *  Symbian 2nd phase constructor.
williamr@2
   201
     */
williamr@2
   202
    void ConstructL(CLbtGeoAreaBase* aArea,
williamr@2
   203
        TDirection aDirection);  
williamr@2
   204
    
williamr@2
   205
    /**
williamr@2
   206
     * By default, prohibit copy constructor
williamr@2
   207
     */
williamr@2
   208
    CLbtTriggerConditionArea( const CLbtTriggerConditionArea& );
williamr@2
   209
    
williamr@2
   210
    /**
williamr@2
   211
     * Prohibit assigment operator
williamr@2
   212
     */
williamr@2
   213
    CLbtTriggerConditionArea& operator= ( const CLbtTriggerConditionArea& );
williamr@2
   214
williamr@2
   215
williamr@2
   216
private:// Data
williamr@2
   217
    /**
williamr@2
   218
     * Area
williamr@2
   219
     */
williamr@2
   220
    CLbtGeoAreaBase* iArea;
williamr@2
   221
    
williamr@2
   222
    /**
williamr@2
   223
     * Direction
williamr@2
   224
     */
williamr@2
   225
    TDirection iDirection;
williamr@2
   226
    
williamr@2
   227
    /**
williamr@2
   228
     * Reserved pointer for future extension
williamr@2
   229
     */
williamr@2
   230
    TAny* iReserved;
williamr@2
   231
    };
williamr@2
   232
#endif // LBTTRIGGERCONDITIONAREA_H