1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/lbttriggerchangeeventnotifier.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,123 @@
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 LBTTRIGGERCHANGEEVENTNOTIFIER_H
1.24 +#define LBTTRIGGERCHANGEEVENTNOTIFIER_H
1.25 +
1.26 +#include <lbt.h>
1.27 +#include <lbttriggerchangeeventobserver.h>
1.28 +
1.29 +/**
1.30 + * Helper class to receive trigger change event
1.31 + * through observer interface.
1.32 + *
1.33 + * @see RLbt::NotifyTriggerChangeEvent
1.34 + *
1.35 + * @lib lbt.lib
1.36 + *
1.37 + * @since S60 5.1
1.38 + */
1.39 +class CLbtTriggerChangeEventNotifier : public CActive
1.40 + {
1.41 +public:
1.42 + /**
1.43 + * Construct a trigger change event notifier object.
1.44 + *
1.45 + * When the object is constructed. The trigger change
1.46 + * notification request is not issued to the
1.47 + * Location Triggering Server. Client shall call
1.48 + * CLbtTriggerChangeEventNotifier::Start() to start
1.49 + * notification.
1.50 + *
1.51 + * @param[in] aLbt A reference to RLbt object. The subsession
1.52 + * must be opened. Otherwise a panic is raised.
1.53 + * @param[in] aObserver A reference to the
1.54 + * observer object to receive trigger change event.
1.55 + * @param[in] aPriority An integer specifying the
1.56 + * priority of this active object. CActive::TPriority
1.57 + * defines a standard set of priorities.
1.58 + *
1.59 + * @panic LocTriggering ELbtServerBadHandle If the
1.60 + * subsession of aLbt is not opened.
1.61 + */
1.62 + IMPORT_C static CLbtTriggerChangeEventNotifier* NewL(
1.63 + RLbt& aLbt,
1.64 + MLbtTriggerChangeEventObserver& aObserver,
1.65 + TInt aPriority = CActive::EPriorityStandard );
1.66 +
1.67 + /**
1.68 + * Destructor.
1.69 + *
1.70 + * If the notification is started, the
1.71 + * destructor will cancel the notification.
1.72 + */
1.73 + IMPORT_C ~CLbtTriggerChangeEventNotifier();
1.74 +
1.75 + /**
1.76 + * Start trigger change event notification.
1.77 + *
1.78 + * After this function is called, when any
1.79 + * trigger is changed in Location Trigger Server, the
1.80 + * client will be notified from the observer interface.
1.81 + *
1.82 + * Client shall call Cancel() function to stop the
1.83 + * trigger change event notification.
1.84 + */
1.85 + IMPORT_C void Start();
1.86 +
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 + * C++ default constructor
1.97 + */
1.98 + CLbtTriggerChangeEventNotifier(
1.99 + RLbt& aLbt,
1.100 + MLbtTriggerChangeEventObserver& aObserver,
1.101 + TInt aPriority = CActive::EPriorityStandard );
1.102 +
1.103 + /**
1.104 + * Symbian 2nd phase constructor
1.105 + */
1.106 + void ConstructL();
1.107 +
1.108 +private:
1.109 + /**
1.110 + * Trigger change event object.
1.111 + */
1.112 + TLbtTriggerChangeEvent iChangeEvent;
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 change event observer.
1.121 + */
1.122 + MLbtTriggerChangeEventObserver& iObserver;
1.123 +
1.124 + };
1.125 +
1.126 +#endif // LBTTRIGGERCHANGEEVENTNOTIFIER_H