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