56
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 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: Implementation to fire triggers, both session and startup
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef LBTTRIGGERFIREHANDLER_H
|
|
20 |
#define LBTTRIGGERFIREHANDLER_H
|
|
21 |
|
|
22 |
// INCLUDE FILES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include "lbtcommon.h"
|
|
25 |
|
|
26 |
// FORWARD DECLARATIONS
|
|
27 |
class CLbtContainer;
|
|
28 |
class CLbtContainerTriggerEntry;
|
|
29 |
class CLbtNotificationMap;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Class declaration for trigger fire handler.
|
|
33 |
* Once provided with a trigger to be fired, this
|
|
34 |
* class fire's the trigger asynchrnously
|
|
35 |
*
|
|
36 |
* @since S60 v4.0
|
|
37 |
*/
|
|
38 |
class CLbtTriggerFireHandler : public CActive
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
/**
|
|
42 |
* Instantiates a new object of
|
|
43 |
* CLbtTriggerFireHandler
|
|
44 |
*
|
|
45 |
* @param[in] aNotificationMap notification map in which all
|
|
46 |
* the IPC requests are stored by server logic. This notification
|
|
47 |
* map is used to retreive the appropriate message for notification
|
|
48 |
* @param[in] aId the id of the trigger which has to be fired
|
|
49 |
* @param[in] aPosInfo the position information where the
|
|
50 |
* trigger fired
|
|
51 |
* @param[in] aContainer reference to location triggering
|
|
52 |
* container
|
|
53 |
* @return a pointer to an instance of CLbtTriggerFireHandler
|
|
54 |
*
|
|
55 |
*/
|
|
56 |
static CLbtTriggerFireHandler* NewL( CLbtNotificationMap& aNotificationMap,
|
|
57 |
CLbtContainer& aContainer );
|
|
58 |
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Destructor
|
|
62 |
*
|
|
63 |
*/
|
|
64 |
~CLbtTriggerFireHandler();
|
|
65 |
|
|
66 |
public: // new functions
|
|
67 |
/**
|
|
68 |
* Fires the trigger asynchronously.
|
|
69 |
* After firing the trigger, the object
|
|
70 |
* destroys iteself
|
|
71 |
*
|
|
72 |
*/
|
|
73 |
void FireTriggerL(TLbtTriggerFireInfo aFireInfo);
|
|
74 |
|
|
75 |
private: // Helper methods
|
|
76 |
/**
|
|
77 |
* 2nd phase constuctor for instantiating member variables
|
|
78 |
*
|
|
79 |
*/
|
|
80 |
void ConstructL();
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Default C++ Constructor
|
|
84 |
*
|
|
85 |
* @param[in] aMessageArray the message array in which all
|
|
86 |
* the IPC requests are stored by server logic. This array
|
|
87 |
* will be iterated through to get the appropriate message
|
|
88 |
* @param[in] aId the id of the trigger which has to be fired
|
|
89 |
* @param[in] aPosInfo the position information where the
|
|
90 |
* trigger fired
|
|
91 |
* @param[in] aContainer reference to location triggering
|
|
92 |
* container
|
|
93 |
* @return a pointer to an instance of CLbtTriggerFireHandler
|
|
94 |
*/
|
|
95 |
CLbtTriggerFireHandler(CLbtNotificationMap& aNotificationMap,
|
|
96 |
CLbtContainer& aContainer);
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Fetches the information from Container for the next trigger
|
|
100 |
* in the trigger fired Queue.
|
|
101 |
*/
|
|
102 |
void FireNextTrigger();
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Notify the client, about trigger fire if there is any pending
|
|
106 |
* notification request.
|
|
107 |
*/
|
|
108 |
void NotifyTriggerFired();
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Start the trigger handling process for the fired trigger.
|
|
112 |
*/
|
|
113 |
void StartTriggerHandlingProcess(CLbtTriggerEntry* aTriggerEntry);
|
|
114 |
|
|
115 |
protected: // From CActive
|
|
116 |
void RunL();
|
|
117 |
void DoCancel();
|
|
118 |
TInt RunError( TInt aError );
|
|
119 |
|
|
120 |
private: // Data
|
|
121 |
|
|
122 |
// Reference to the notification map
|
|
123 |
CLbtNotificationMap& iNotificationMap;
|
|
124 |
|
|
125 |
// Reference to the Location Triggering Container
|
|
126 |
CLbtContainer& iContainer;
|
|
127 |
|
|
128 |
// Trigger array that will be populated by the container
|
|
129 |
RPointerArray<CLbtContainerTriggerEntry> iTriggerArray;
|
|
130 |
|
|
131 |
// Array to hold the fire info of triggers
|
|
132 |
RArray<TLbtTriggerFireInfo> iFireInfoArray;
|
|
133 |
|
|
134 |
// Variable to hold the internal state of the handler
|
|
135 |
TInt iState;
|
|
136 |
// Integer that identifies AO operation
|
|
137 |
TInt iAOIdentificationNum;
|
|
138 |
};
|
|
139 |
|
|
140 |
#endif //LBTTRIGGERFIREHANDLER_H
|
|
141 |
|