epoc32/include/mw/lbttriggerfiringeventnotifier.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/lbttriggerfiringeventnotifier.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,122 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  location triggering server client interface
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +#ifndef LBTTRIGGERFIRINGEVENTNOTIFIER_H
    1.24 +#define LBTTRIGGERFIRINGEVENTNOTIFIER_H
    1.25 +
    1.26 +#include <lbt.h>
    1.27 +#include <lbttriggerfiringeventobserver.h>
    1.28 +
    1.29 +/**
    1.30 + * Helper class to receive trigger firing event 
    1.31 + * through observer interface. 
    1.32 + *
    1.33 + * @see RLbt::NotifyTriggerFired
    1.34 + *
    1.35 + * @lib lbt.lib
    1.36 + *
    1.37 + * @since S60 5.1
    1.38 + */
    1.39 +
    1.40 +class CLbtTriggerFiringEventNotifier : public CActive
    1.41 +    {
    1.42 +public:
    1.43 +    /**
    1.44 +     * Construct a trigger firing event notifier object. 
    1.45 +     *
    1.46 +     * When the object is constructed. The trigger firing event 
    1.47 +     * notification request is not issued to the
    1.48 +     * Location Triggering Server. Client shall call 
    1.49 +     * CLbtTriggerFiringEventNotifier::Start() to start
    1.50 +     * notification.
    1.51 +     *
    1.52 +     * @param[in] aLbt A referece to RLbt object. The subsession 
    1.53 +     * must be opened. Otherwise a panic is raised.
    1.54 +     * @param[in] aObserver A referece to the 
    1.55 +     * observer object to receive trigger firing event.
    1.56 +     * @param[in] aPriority An integer specifying the 
    1.57 +     * priority of this active object. CActive::TPriority 
    1.58 +     * defines a standard set of priorities. 
    1.59 +     *
    1.60 +     * @panic LocTriggering ELbtServerBadHandle If the 
    1.61 +     * subsession of aLbt is not opened.
    1.62 +     */
    1.63 +    IMPORT_C static CLbtTriggerFiringEventNotifier* NewL(
    1.64 +        RLbt& aLbt,
    1.65 +        MLbtTriggerFiringEventObserver& aObserver,
    1.66 +        TInt aPriority = CActive::EPriorityStandard);
    1.67 +
    1.68 +    /**
    1.69 +     * Destructor. 
    1.70 +     *
    1.71 +     * If the notification is started, the 
    1.72 +     * destructor will cancel the notification.
    1.73 +     */
    1.74 +    IMPORT_C ~CLbtTriggerFiringEventNotifier();
    1.75 +
    1.76 +    /**
    1.77 +     * Start trigger firing event notification. 
    1.78 +     *
    1.79 +     * After this function is called, when a 
    1.80 +     * trigger is fired, the
    1.81 +     * client will be notified from the observer interface.
    1.82 +     * 
    1.83 +     * Client shall call Cancel() function to stop the
    1.84 +     * trigger firing event notification.
    1.85 +     */
    1.86 +    IMPORT_C void Start();
    1.87 +
    1.88 +private:
    1.89 +    //Derived from CActive
    1.90 +    void RunL();
    1.91 +    TInt RunError( TInt aError );
    1.92 +    void DoCancel();
    1.93 +
    1.94 +private:
    1.95 +    /**
    1.96 +     * Default constructor
    1.97 +     */
    1.98 +    CLbtTriggerFiringEventNotifier(
    1.99 +        RLbt& aLbt,
   1.100 +        MLbtTriggerFiringEventObserver& aObserver,
   1.101 +        TInt aPriority = CActive::EPriorityStandard );
   1.102 +    
   1.103 +    /**
   1.104 +     * Second phase constructor
   1.105 +     */
   1.106 +    void ConstructL();
   1.107 +
   1.108 +private:
   1.109 +    /** 
   1.110 +     * Trigger fire info
   1.111 +     */
   1.112 +    TLbtTriggerFireInfo iFiringEvent;
   1.113 +    
   1.114 +    /**
   1.115 +     * Reference to Lbt subsession.
   1.116 +     */
   1.117 +    RLbt& iLbt;
   1.118 +    
   1.119 +    /**
   1.120 +     * Reference to trigger fire event observer
   1.121 +     */
   1.122 +    MLbtTriggerFiringEventObserver& iObserver;
   1.123 +    };
   1.124 +
   1.125 +#endif //LBTTRIGGERFIRINGEVENTNOTIFIER_H