66
|
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: This is the header file for the CClockAlarmArray class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __CLOCK_ALARM_ARRAY_H__
|
|
19 |
#define __CLOCK_ALARM_ARRAY_H__
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <bamdesca.h>
|
|
24 |
#include <asshddefs.h>
|
|
25 |
#include <badesca.h>
|
|
26 |
|
|
27 |
// User includes
|
|
28 |
#include "clkcommon.h"
|
|
29 |
|
|
30 |
// Forward declarations
|
|
31 |
class CClkUiAlarmModel;
|
|
32 |
class CCoeEnv;
|
|
33 |
|
|
34 |
// Class declaration
|
|
35 |
/**
|
|
36 |
* @class CClockAlarmArray
|
|
37 |
* @brief This the MDesCArray inheriting class. This acts as the data provider for the alarm list.
|
|
38 |
*/
|
|
39 |
class CClockAlarmArray : public CBase, public MDesCArray
|
|
40 |
{
|
|
41 |
public: // Constructor and destructor
|
|
42 |
|
|
43 |
/**
|
|
44 |
* @brief Two-phased constructor.
|
|
45 |
* @param aAlarmModel Pointer to the alarm model.
|
|
46 |
* @param aCoeEnv The the control environment.
|
|
47 |
*/
|
|
48 |
static CClockAlarmArray* NewL( CClkUiAlarmModel* aAlarmModel, CCoeEnv* aCoeEnv );
|
|
49 |
|
|
50 |
/**
|
|
51 |
* @brief Destructor.
|
|
52 |
*/
|
|
53 |
virtual ~CClockAlarmArray();
|
|
54 |
|
|
55 |
public: // From base classes
|
|
56 |
|
|
57 |
/**
|
|
58 |
* @brief From MDesCArray. Returns the number of items in the array.
|
|
59 |
* @return TInt The number of items in the array.
|
|
60 |
*/
|
|
61 |
TInt MdcaCount() const;
|
|
62 |
|
|
63 |
/**
|
|
64 |
* @brief Returns a descriptor to list item text of the given index.
|
|
65 |
* @param aIndex The index of the list item.
|
|
66 |
* @return TPtrC16 Descriptor pointing to the list item content.
|
|
67 |
*/
|
|
68 |
TPtrC16 MdcaPoint( TInt aIndex ) const;
|
|
69 |
|
|
70 |
public: // New functions
|
|
71 |
|
|
72 |
/**
|
|
73 |
* @brief Returns the index of the listbox item with the given alarm id.
|
|
74 |
* @param aAlarmId The id of the alarm.
|
|
75 |
* @return TInt The index of the list item.
|
|
76 |
*/
|
|
77 |
TInt ListBoxIndex( TAlarmId aAlarmId );
|
|
78 |
|
|
79 |
/**
|
|
80 |
* @brief Returns the index of the active alarm with the given alarm id.
|
|
81 |
* @param aAlarmId The id of the alarm.
|
|
82 |
* @param aErrorValue
|
|
83 |
* @return TInt The Enabled Alarm's index.
|
|
84 |
*/
|
|
85 |
TInt GetEnabledAlarmIndex( TAlarmId aAlarmId, TInt aErrorValue );
|
|
86 |
|
|
87 |
/**
|
|
88 |
* @brief Returns the index of the inactive alarm with the given alarm id.
|
|
89 |
* @param aAlarmId The id of the alarm.
|
|
90 |
* @param aErrorValue
|
|
91 |
* @return TInt The Disabled Alarm's index.
|
|
92 |
*/
|
|
93 |
TInt GetDisabledAlarmIndex( TAlarmId aAlarmId, TInt aErrorValue );
|
|
94 |
|
|
95 |
/**
|
|
96 |
* @brief Initialize the alarmid list.
|
|
97 |
*/
|
|
98 |
void InitIdList();
|
|
99 |
|
|
100 |
/**
|
|
101 |
* @brief Gives the alarm id and alarm information of the alarm in the list indexed at aIndex.
|
|
102 |
* @param aIndex The index of the alarm list item in the list.
|
|
103 |
* @param aAlarmId The id of the alarm at aIndex in the list.
|
|
104 |
* @param aAlarmInfo The information of the alarm at aIndex in the list.
|
|
105 |
*/
|
|
106 |
void GetSortedAlmIdInfo( TInt aIndex, TAlarmId &aAlarmId, SClkAlarmInfo& aAlarmInfo ) const;
|
|
107 |
|
|
108 |
/**
|
|
109 |
* @brief Gives the enabled alarm's count.
|
|
110 |
* @return Enabled alarms count
|
|
111 |
*/
|
|
112 |
TInt GetEnabledAlarmCount() const;
|
|
113 |
|
|
114 |
/**
|
|
115 |
* @brief Gives alarm information of the active alarm in the list indexed at aIndex.
|
|
116 |
* @param aIndex The index of the alarm list item in the list.
|
|
117 |
* @param aAlarmId The id of the alarm at aIndex in the list.
|
|
118 |
* @param aAlarmInfo The information of the alarm at aIndex in the list.
|
|
119 |
*/
|
|
120 |
void GetActiveAlarmInfo(TInt aIndex, TAlarmId& aAlarmId, SClkAlarmInfo& aAlarmInfo ) const;
|
|
121 |
|
|
122 |
/**
|
|
123 |
* @brief Gives alarm information of the inactive alarm in the list indexed at aIndex.
|
|
124 |
* @param aIndex The index of the alarm list item in the list.
|
|
125 |
* @param aAlarmId The id of the alarm at aIndex in the list.
|
|
126 |
* @param aAlarmInfo The information of the alarm at aIndex in the list.
|
|
127 |
*/
|
|
128 |
void GetInActiveAlarmInfo(TInt aIndex, TAlarmId& aAlarmId, SClkAlarmInfo& aAlarmInfo ) const;
|
|
129 |
|
|
130 |
HBufC* NewAlarmText() const;
|
|
131 |
|
|
132 |
private: // New functions
|
|
133 |
|
|
134 |
/**
|
|
135 |
* @brief This performs the 2nd phase of the two-phase construction.
|
|
136 |
* @param aAlarmModel Pointer to the alarm model.
|
|
137 |
* @param aCoeEnv The the control environment.
|
|
138 |
*/
|
|
139 |
void ConstructL( CClkUiAlarmModel* aAlarmModel, CCoeEnv* aCoeEnv );
|
|
140 |
|
|
141 |
/**
|
|
142 |
* @brief C++ default constructor.
|
|
143 |
*/
|
|
144 |
CClockAlarmArray();
|
|
145 |
|
|
146 |
/**
|
|
147 |
* @brief This uses the Pow() API to get the workday from the workday list.
|
|
148 |
* @param aNum The workday to be calculated.
|
|
149 |
* @return TInt The computed value.
|
|
150 |
*/
|
|
151 |
TInt Power( TInt aNum ) const;
|
|
152 |
|
|
153 |
private: // Data
|
|
154 |
|
|
155 |
/**
|
|
156 |
* @var iAlarmModel
|
|
157 |
* @brief Pointer to the alarm model object. Not owned.
|
|
158 |
*/
|
|
159 |
CClkUiAlarmModel* iAlarmModel;
|
|
160 |
|
|
161 |
/**
|
|
162 |
* @var iOccuranceList
|
|
163 |
* @brief Descriptor array for the occurance items.
|
|
164 |
*/
|
|
165 |
CDesCArrayFlat* iOccuranceList;
|
|
166 |
|
|
167 |
/**
|
|
168 |
* @var iWorkDaysList
|
|
169 |
* @brief Descriptor array for the workdays items.
|
|
170 |
*/
|
|
171 |
CDesCArrayFlat* iWorkDaysList;
|
|
172 |
|
|
173 |
/**
|
|
174 |
* @var iShortWorkDaysList
|
|
175 |
* @brief Descriptor array for the workdays items in short form.
|
|
176 |
*/
|
|
177 |
CDesCArrayFlat* iShortWorkDaysList;
|
|
178 |
|
|
179 |
/**
|
|
180 |
* @var iListBoxEntry
|
|
181 |
* @brief Will hold the string to be displayed in the listbox.
|
|
182 |
*/
|
|
183 |
HBufC* iListBoxEntry;
|
|
184 |
|
|
185 |
/**
|
|
186 |
* @var iAlarmInactiveText
|
|
187 |
* @brief String holder for the string "Inactive".
|
|
188 |
*/
|
|
189 |
HBufC* iAlarmInactiveText;
|
|
190 |
|
|
191 |
/**
|
|
192 |
* @var iTimeFormat
|
|
193 |
* @brief String holder to hold the timeformatting string.
|
|
194 |
*/
|
|
195 |
HBufC* iTimeFormat;
|
|
196 |
|
|
197 |
/**
|
|
198 |
* @var iDate
|
|
199 |
* @brief String holder for the date string.
|
|
200 |
*/
|
|
201 |
HBufC* iDate;
|
|
202 |
|
|
203 |
/**
|
|
204 |
* @var iEnv
|
|
205 |
* @brief The control environment. Not owned.
|
|
206 |
*/
|
|
207 |
CCoeEnv* iEnv;
|
|
208 |
|
|
209 |
/**
|
|
210 |
* @var iAlarmIdArray
|
|
211 |
* @brief The array of alarm ids.
|
|
212 |
*/
|
|
213 |
RArray< TAlarmId > iAlarmIdArray;
|
|
214 |
|
|
215 |
/**
|
|
216 |
* @var iNewAlarmText
|
|
217 |
* @brief String holder for the string "NewAlarm".
|
|
218 |
*/
|
|
219 |
HBufC* iNewAlarmText;
|
|
220 |
};
|
|
221 |
|
|
222 |
#endif // __CLOCK_ALARM_ARRAY_H__
|
|
223 |
|
|
224 |
// End of file
|