29
|
1 |
/*
|
31
|
2 |
* Copyright (c) 2010 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".
|
29
|
8 |
*
|
31
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
29
|
11 |
*
|
31
|
12 |
* Contributors:
|
29
|
13 |
*
|
31
|
14 |
* Description: Class for managing user notification and query objects,
|
|
15 |
* and for serializing access to the notification server.
|
|
16 |
*
|
29
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef BTNOTIFICATIONMANAGER_H
|
|
20 |
#define BTNOTIFICATIONMANAGER_H
|
|
21 |
|
|
22 |
|
|
23 |
#include <e32base.h>
|
|
24 |
|
|
25 |
class CBTNotifServer;
|
|
26 |
class CBluetoothNotification;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* CBTNotificationManager manages Bt Notifications
|
|
30 |
*
|
|
31 |
* @since Symbian^4
|
|
32 |
*/
|
|
33 |
NONSHARABLE_CLASS( CBTNotificationManager ) : public CBase
|
|
34 |
{
|
|
35 |
|
|
36 |
public:
|
|
37 |
|
|
38 |
/** Enumeration for the priority of the notification. */
|
|
39 |
enum TNotificationPriority
|
|
40 |
{
|
|
41 |
EPriorityLow,
|
|
42 |
EPriorityStandard,
|
|
43 |
EPriorityHigh
|
|
44 |
};
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Two-phased constructor.
|
|
48 |
* @param aServer Pointer to our parent
|
|
49 |
*/
|
|
50 |
static CBTNotificationManager* NewL( const CBTNotifServer* aServer );
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Destructor.
|
|
54 |
*/
|
|
55 |
virtual ~CBTNotificationManager();
|
|
56 |
|
|
57 |
CBluetoothNotification* GetNotification();
|
|
58 |
|
|
59 |
void ReleaseNotification( CBluetoothNotification* aNotification );
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Add a notification to the queue of notifications scheduled to be
|
|
63 |
* shown. Notifications are serialized, to avoid overlapping notes.
|
|
64 |
* The queue is managed on priority of each notification.
|
|
65 |
*
|
|
66 |
* @since Symbian^4
|
|
67 |
* @param aNotification The notification to be added.
|
|
68 |
* @param aPriority The priority of the notification. EPriorityHigh means
|
|
69 |
* that the note is put to the front of the queue.
|
|
70 |
* EPriorityStandard means that it is appended to the end,
|
|
71 |
* and should be used for most notes. EPriorityLow is not
|
|
72 |
* used yet.
|
|
73 |
*/
|
31
|
74 |
void QueueNotificationL( CBluetoothNotification* aNotification,
|
29
|
75 |
TNotificationPriority aPriority = EPriorityStandard );
|
|
76 |
|
|
77 |
private:
|
|
78 |
|
|
79 |
CBTNotificationManager( const CBTNotifServer* aServer );
|
|
80 |
|
|
81 |
void ConstructL();
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Process the notification queue and launch the next notification.
|
|
85 |
*
|
|
86 |
* @since Symbian^4
|
|
87 |
*/
|
|
88 |
void ProcessNotificationQueueL();
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Process the notification queue and launch the next notification.
|
|
92 |
*
|
|
93 |
* @since Symbian^4
|
|
94 |
*/
|
|
95 |
void CleanupUnusedQueueL();
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Create and queue an idle timer if there are no outstanding notifications,
|
|
99 |
* otherwise cancel the idle timer.
|
|
100 |
*
|
|
101 |
* @since Symbian^4
|
|
102 |
*/
|
|
103 |
void CheckIdle();
|
|
104 |
|
|
105 |
private: // data
|
|
106 |
|
|
107 |
/**
|
|
108 |
* The queue of notifications to be shown to the user.
|
|
109 |
*/
|
|
110 |
RPointerArray<CBluetoothNotification> iNotificationQ;
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Pointer to our parent.
|
|
114 |
* Not own.
|
|
115 |
*/
|
|
116 |
const CBTNotifServer* iServer;
|
|
117 |
|
|
118 |
};
|
|
119 |
|
|
120 |
#endif // BTNOTIFICATIONMANAGER_H
|