|
1 /* |
|
2 * Copyright (c) 2008 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: missed alarm store class description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MISSEDALARMSTORE_H__ |
|
20 #define __MISSEDALARMSTORE_H__ |
|
21 |
|
22 //Include files |
|
23 #include <centralrepository.h> |
|
24 #include <e32cons.h> |
|
25 |
|
26 #include "missedalarm.h" |
|
27 |
|
28 /** |
|
29 * Class Declaration. |
|
30 * CMissedAlarmStore is the implementation for storing missed alarms' information. |
|
31 */ |
|
32 NONSHARABLE_CLASS( CMissedAlarmStore ) : public CBase |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * First stage constructor |
|
38 * Creates an instance of CMissedAlarmStore and places it |
|
39 * on the cleanup stack before passing ownership to the caller. |
|
40 */ |
|
41 IMPORT_C static CMissedAlarmStore* NewLC(); |
|
42 |
|
43 /** |
|
44 * First stage constructor |
|
45 * Creates an instance of CMissedAlarmStore and places it |
|
46 * on the cleanup stack before passing ownership to the caller. |
|
47 */ |
|
48 IMPORT_C static CMissedAlarmStore* NewL(CRepository& aRepository); |
|
49 |
|
50 /** |
|
51 * Class destructor |
|
52 * Frees all resources used by this class |
|
53 */ |
|
54 ~CMissedAlarmStore(); |
|
55 |
|
56 public: |
|
57 |
|
58 /** |
|
59 * AddL |
|
60 * Add the list of CMissedAlarm in the Central Repository. |
|
61 * @param aMissedAlarmList Pointer array of CMissedAlarm objects. |
|
62 */ |
|
63 IMPORT_C void AddL( RPointerArray<CMissedAlarm>& aMissedAlarmList ); |
|
64 |
|
65 /** |
|
66 * GetL |
|
67 * Gets the list of CMissedAlarm from the Central Repository. |
|
68 * @param aMissedAlarmList Pointer array of CMissedAlarm objects. |
|
69 * @return Error code |
|
70 */ |
|
71 IMPORT_C void GetL( RPointerArray<CMissedAlarm> &aArray ); |
|
72 |
|
73 /** |
|
74 * RemoveAllL |
|
75 * Removes all the entries from the central repository. |
|
76 * @return Error code |
|
77 */ |
|
78 IMPORT_C void RemoveAllL(); |
|
79 |
|
80 /** |
|
81 * RemoveL |
|
82 * Removes an entry from the central repository. |
|
83 * @param aMissedAlarm The entry to be removed. |
|
84 * @return Error code |
|
85 */ |
|
86 IMPORT_C void RemoveL( CMissedAlarm& aMissedAlarm ); |
|
87 |
|
88 /** |
|
89 * CountL |
|
90 * Counts the number of entries in the central repository. |
|
91 * @param aCount The total number of entries in the central repository. |
|
92 * @return Error code |
|
93 */ |
|
94 IMPORT_C void CountL( TUint32 &aCount ); |
|
95 |
|
96 public: |
|
97 |
|
98 /** |
|
99 * This callback method is used to notify the client about |
|
100 * changes for real value keys, i.e. key type is ERealKey. |
|
101 * |
|
102 * @param aId Id of the key that has changed. |
|
103 * @param aNewValue The new value of the key. |
|
104 */ |
|
105 void HandleNotifyGeneric( TUint32 aId ); |
|
106 |
|
107 private: |
|
108 |
|
109 /** |
|
110 * SetL |
|
111 * Add the single entry in the Central Repository. |
|
112 * @param aLuid The LUID of the missed alarm. |
|
113 * @param aTTime The instance start time. |
|
114 * @param aCalFileName The Calendar file name. |
|
115 * @return Error code |
|
116 */ |
|
117 void SetL( const TInt aLuid, const TTime aTTime, const TDesC& aCalFileName ); |
|
118 |
|
119 /** |
|
120 * Delete old entry and insert new entry when the |
|
121 * missed alarms count is more than 10 entries. |
|
122 */ |
|
123 void DeleteEntryAndReArrangeL(TInt aDeletedIndex); |
|
124 |
|
125 private: |
|
126 |
|
127 /** |
|
128 * Private constructor |
|
129 */ |
|
130 CMissedAlarmStore(); |
|
131 |
|
132 /** |
|
133 * Private constructor |
|
134 */ |
|
135 CMissedAlarmStore(CRepository& aRepository); |
|
136 |
|
137 /** |
|
138 * Second stage constructor |
|
139 * Performs any leaving operations needed for construction. |
|
140 */ |
|
141 void ConstructL(); |
|
142 |
|
143 private: |
|
144 CRepository* iRepository; |
|
145 }; |
|
146 |
|
147 #endif //__MISSEDALARMSTORE_H__ |
|
148 |
|
149 // End of file |