|
1 /* |
|
2 * Copyright (c) 2002 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: TCalenWeekHour has data by one hour. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 //debug |
|
20 #include "calendarui_debug.h" |
|
21 |
|
22 // INCLUDES |
|
23 #include "calenweekhour.h" |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 |
|
27 // C++ default constructor can NOT contain any code, that |
|
28 // might leave. |
|
29 // |
|
30 TCalenWeekHour::TCalenWeekHour() |
|
31 : iDataType(ENoData) |
|
32 { |
|
33 TRACE_ENTRY_POINT; |
|
34 |
|
35 iIconIndex = 0; |
|
36 |
|
37 for(TInt i=0; i < KEventsInHour; ++i) |
|
38 { |
|
39 iEvent[i] = ENoEvent; |
|
40 } |
|
41 |
|
42 TRACE_EXIT_POINT; |
|
43 } |
|
44 |
|
45 // --------------------------------------------------------- |
|
46 // TCalenWeekHour::DataType |
|
47 // Flag of No data or Timed or Non-timed note |
|
48 // (other items were commented in a header). |
|
49 // --------------------------------------------------------- |
|
50 // |
|
51 TCalenWeekHour::TDataType TCalenWeekHour::DataType() const |
|
52 { |
|
53 TRACE_ENTRY_POINT; |
|
54 |
|
55 TRACE_EXIT_POINT; |
|
56 return iDataType; |
|
57 } |
|
58 |
|
59 // --------------------------------------------------------- |
|
60 // TCalenWeekHour::Event |
|
61 // Return event type |
|
62 // (other items were commented in a header). |
|
63 // --------------------------------------------------------- |
|
64 // |
|
65 TUint32 TCalenWeekHour::Event |
|
66 (TInt aMinutes) const // 0 : 0-9minutes 1: 10-19minutes..., |
|
67 { |
|
68 TRACE_ENTRY_POINT; |
|
69 |
|
70 |
|
71 TRACE_EXIT_POINT; |
|
72 return (TUint32) iEvent[aMinutes]; |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------- |
|
76 // TCalenWeekHour::SetEvent |
|
77 // Set a event type |
|
78 // (other items were commented in a header). |
|
79 // --------------------------------------------------------- |
|
80 // |
|
81 void TCalenWeekHour::SetEvent |
|
82 (TInt aMinutes, // 0 : 0-9minutes 1: 10-19minutes..., |
|
83 TUint32 aType) // ENoEvent | EPublicEvent | etc... |
|
84 { |
|
85 TRACE_ENTRY_POINT; |
|
86 |
|
87 iEvent[aMinutes] = (TUint32)aType; |
|
88 iDataType = EHasBar; |
|
89 |
|
90 TRACE_EXIT_POINT; |
|
91 } |
|
92 |
|
93 // --------------------------------------------------------- |
|
94 // TCalenWeekHour::IconIndex |
|
95 // Return a Icon index |
|
96 // (other items were commented in a header). |
|
97 // --------------------------------------------------------- |
|
98 // |
|
99 TInt TCalenWeekHour::IconIndex() const |
|
100 { |
|
101 TRACE_ENTRY_POINT; |
|
102 |
|
103 __ASSERT_ALWAYS(iDataType == EHasIcon, User::Invariant()); |
|
104 |
|
105 TRACE_EXIT_POINT; |
|
106 return iIconIndex; |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------- |
|
110 // TCalenWeekHour::SetIconIndex |
|
111 // Set a Icon index |
|
112 // (other items were commented in a header). |
|
113 // --------------------------------------------------------- |
|
114 // |
|
115 void TCalenWeekHour::SetIconIndex |
|
116 (TInt aIconIndex) // Icon index |
|
117 { |
|
118 TRACE_ENTRY_POINT; |
|
119 |
|
120 iIconIndex = aIconIndex; |
|
121 iDataType = EHasIcon; |
|
122 |
|
123 TRACE_EXIT_POINT; |
|
124 } |
|
125 |
|
126 // End of File |