|
1 /* |
|
2 * Copyright (c) 2003 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: This file contains the header file of the CCbsMessageCleanupTimer class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCBSMESSAGECLEANUPTIMER_H |
|
20 #define CCBSMESSAGECLEANUPTIMER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class CCbsDbImpTopicList; |
|
26 class CCbsDbImpSettings; |
|
27 class CCbsMessage; |
|
28 class CCbsRecCollector; |
|
29 |
|
30 typedef CArrayPtrFlat<CCbsMessage> CMessageBuffer; |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 // DESCRIPTION |
|
36 // Handles the cleaning up of read messages, according to time interval |
|
37 // set by the user. |
|
38 |
|
39 class CCbsMessageCleanupTimer : public CTimer |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * C++ default constructor. |
|
45 * |
|
46 * @param aTopicList Reference to topic list database |
|
47 * @param aSettings Reference to settings database |
|
48 */ |
|
49 CCbsMessageCleanupTimer( CCbsRecCollector& aCbsRecCollector, CMessageBuffer& aArray ); |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 * |
|
54 * @param aTopicList Reference to topic list database |
|
55 * @param aSettings Reference to settings database |
|
56 */ |
|
57 static CCbsMessageCleanupTimer* NewL( CCbsRecCollector& aCbsRecCollector, CMessageBuffer& aArray ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 ~CCbsMessageCleanupTimer(); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 /** |
|
67 * Requests the timer to be started. |
|
68 */ |
|
69 void StartTimer(); |
|
70 |
|
71 /** |
|
72 * Requests the timer to be stopped. |
|
73 */ |
|
74 void StopTimer(); |
|
75 |
|
76 public: // Functions from base classes |
|
77 |
|
78 /** |
|
79 * Called when the timer expires. Renews the request. |
|
80 */ |
|
81 void RunL(); |
|
82 |
|
83 private: |
|
84 |
|
85 /** |
|
86 * By default constructor is private. |
|
87 */ |
|
88 void ConstructL(); |
|
89 |
|
90 private: // Data |
|
91 |
|
92 TTimeIntervalMinutes iInterval; |
|
93 CCbsRecCollector& iCbsRecCollector; |
|
94 CMessageBuffer& iArray; |
|
95 }; |
|
96 |
|
97 #endif // CCbsMessageCleanupTimer_H |
|
98 |
|
99 // End of File |