epoc32/include/mw/lbttriggerchangeeventnotifier.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:  location triggering server client interface
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
#ifndef LBTTRIGGERCHANGEEVENTNOTIFIER_H
williamr@2
    21
#define LBTTRIGGERCHANGEEVENTNOTIFIER_H
williamr@2
    22
williamr@2
    23
#include <lbt.h>
williamr@2
    24
#include <lbttriggerchangeeventobserver.h>
williamr@2
    25
williamr@2
    26
/**
williamr@2
    27
 * Helper class to receive trigger change event 
williamr@2
    28
 * through observer interface. 
williamr@2
    29
 *
williamr@2
    30
 * @see RLbt::NotifyTriggerChangeEvent
williamr@2
    31
 *
williamr@2
    32
 * @lib lbt.lib
williamr@2
    33
 *
williamr@2
    34
 * @since S60 5.1
williamr@2
    35
 */
williamr@2
    36
class CLbtTriggerChangeEventNotifier : public CActive
williamr@2
    37
    {
williamr@2
    38
public:
williamr@2
    39
    /**
williamr@2
    40
     * Construct a trigger change event notifier object. 
williamr@2
    41
     *
williamr@2
    42
     * When the object is constructed. The trigger change 
williamr@2
    43
     * notification request is not issued to the
williamr@2
    44
     * Location Triggering Server. Client shall call 
williamr@2
    45
     * CLbtTriggerChangeEventNotifier::Start() to start
williamr@2
    46
     * notification.
williamr@2
    47
     *
williamr@2
    48
     * @param[in] aLbt A reference to RLbt object. The subsession 
williamr@2
    49
     * must be opened. Otherwise a panic is raised.
williamr@2
    50
     * @param[in] aObserver A reference to the 
williamr@2
    51
     * observer object to receive trigger change event.
williamr@2
    52
     * @param[in] aPriority An integer specifying the 
williamr@2
    53
     * priority of this active object. CActive::TPriority 
williamr@2
    54
     * defines a standard set of priorities. 
williamr@2
    55
     *
williamr@2
    56
     * @panic LocTriggering ELbtServerBadHandle If the 
williamr@2
    57
     * subsession of aLbt is not opened.
williamr@2
    58
     */
williamr@2
    59
    IMPORT_C static CLbtTriggerChangeEventNotifier* NewL( 
williamr@2
    60
        RLbt& aLbt,
williamr@2
    61
        MLbtTriggerChangeEventObserver& aObserver,
williamr@2
    62
        TInt aPriority = CActive::EPriorityStandard );
williamr@2
    63
williamr@2
    64
    /**
williamr@2
    65
     * Destructor. 
williamr@2
    66
     *
williamr@2
    67
     * If the notification is started, the 
williamr@2
    68
     * destructor will cancel the notification.
williamr@2
    69
     */
williamr@2
    70
    IMPORT_C ~CLbtTriggerChangeEventNotifier();
williamr@2
    71
williamr@2
    72
    /**
williamr@2
    73
     * Start trigger change event notification. 
williamr@2
    74
     *
williamr@2
    75
     * After this function is called, when any 
williamr@2
    76
     * trigger is changed in Location Trigger Server, the
williamr@2
    77
     * client will be notified from the observer interface.
williamr@2
    78
     * 
williamr@2
    79
     * Client shall call Cancel() function to stop the
williamr@2
    80
     * trigger change event notification.
williamr@2
    81
     */
williamr@2
    82
    IMPORT_C void Start();
williamr@2
    83
williamr@2
    84
williamr@2
    85
private:
williamr@2
    86
    //Derived from CActive
williamr@2
    87
    void RunL();
williamr@2
    88
    TInt RunError( TInt aError );
williamr@2
    89
    void DoCancel();
williamr@2
    90
williamr@2
    91
private:
williamr@2
    92
    /**
williamr@2
    93
     * C++ default constructor
williamr@2
    94
     */
williamr@2
    95
    CLbtTriggerChangeEventNotifier(
williamr@2
    96
        RLbt& aLbt,
williamr@2
    97
        MLbtTriggerChangeEventObserver& aObserver,
williamr@2
    98
        TInt aPriority = CActive::EPriorityStandard );
williamr@2
    99
    
williamr@2
   100
    /**
williamr@2
   101
     * Symbian 2nd phase constructor 
williamr@2
   102
     */
williamr@2
   103
    void ConstructL();
williamr@2
   104
williamr@2
   105
private:
williamr@2
   106
    /**
williamr@2
   107
     * Trigger change event object.
williamr@2
   108
     */
williamr@2
   109
    TLbtTriggerChangeEvent iChangeEvent;
williamr@2
   110
    
williamr@2
   111
    /** 
williamr@2
   112
     * Reference to Lbt subsession.
williamr@2
   113
     */
williamr@2
   114
    RLbt& iLbt;
williamr@2
   115
    
williamr@2
   116
    /**
williamr@2
   117
     * Reference to trigger change event observer.
williamr@2
   118
     */
williamr@2
   119
    MLbtTriggerChangeEventObserver& iObserver;
williamr@2
   120
    
williamr@2
   121
    };
williamr@2
   122
williamr@2
   123
#endif // LBTTRIGGERCHANGEEVENTNOTIFIER_H