|
1 /* |
|
2 * Copyright (c) 2007-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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Mocked classes for testing CalenDayInfo class |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CALENDAYINFO_H |
|
19 #define CALENDAYINFO_H |
|
20 |
|
21 #include <calinstance.h> |
|
22 #include "caleninstanceid.h" |
|
23 |
|
24 const int KFSCalMaxDescriptionLength = 100; |
|
25 |
|
26 /*! |
|
27 Mocked struct SCalenApptInfo |
|
28 */ |
|
29 struct SCalenApptInfo |
|
30 { |
|
31 QModelIndex iIndex; |
|
32 QDateTime iStartTime; |
|
33 QDateTime iEndTime; |
|
34 bool iAllDay; |
|
35 TCalenInstanceId iId; |
|
36 AgendaEntry::Status iStatus; |
|
37 TBufC<KFSCalMaxDescriptionLength> iSummary; |
|
38 TUint32 iColor; |
|
39 }; |
|
40 |
|
41 /*! |
|
42 Mocked class CalenTimeColumn |
|
43 */ |
|
44 class CalenTimeColumn |
|
45 { |
|
46 public: |
|
47 CalenTimeColumn() { |
|
48 |
|
49 } |
|
50 |
|
51 ~CalenTimeColumn() { |
|
52 |
|
53 } |
|
54 }; |
|
55 |
|
56 /*! |
|
57 Mocked class CalenTimeRegion |
|
58 */ |
|
59 class CalenTimeRegion |
|
60 { |
|
61 public: |
|
62 CalenTimeRegion() { |
|
63 |
|
64 } |
|
65 |
|
66 ~CalenTimeRegion() { |
|
67 |
|
68 } |
|
69 |
|
70 QList<CalenTimeColumn> iColumns; |
|
71 |
|
72 int iStartSlot; |
|
73 int iEndSlot; |
|
74 }; |
|
75 |
|
76 /*! |
|
77 Mocked class CalenDayInfo |
|
78 */ |
|
79 class CalenDayInfo |
|
80 { |
|
81 public: |
|
82 enum TSlotsInHour |
|
83 { |
|
84 EOne = 1, ETwo, EThree, EFour |
|
85 }; |
|
86 |
|
87 public: |
|
88 |
|
89 CalenDayInfo(TSlotsInHour aSlotsInHour) |
|
90 { |
|
91 Q_UNUSED(aSlotsInHour) |
|
92 } |
|
93 virtual ~CalenDayInfo() |
|
94 { |
|
95 |
|
96 } |
|
97 |
|
98 void GetLocation( const SCalenApptInfo& aItemInfo, int& aStartSlot, |
|
99 int& aEndSlot, int& aColumnIndex, int& aColumns ) |
|
100 { |
|
101 Q_UNUSED(aItemInfo) |
|
102 Q_UNUSED(aStartSlot) |
|
103 Q_UNUSED(aEndSlot) |
|
104 Q_UNUSED(aColumnIndex) |
|
105 Q_UNUSED(aColumns) |
|
106 } |
|
107 |
|
108 int AlldayCount() |
|
109 { |
|
110 return 0; |
|
111 } |
|
112 |
|
113 const QList<CalenTimeRegion>& RegionList() const |
|
114 { |
|
115 return mList; |
|
116 } |
|
117 |
|
118 void InsertAlldayEvent( const SCalenApptInfo& aItemInfo ) |
|
119 { |
|
120 Q_UNUSED(aItemInfo) |
|
121 |
|
122 CalenTimeRegion region; |
|
123 |
|
124 region.iStartSlot = 10; |
|
125 region.iEndSlot = 13; |
|
126 region.iColumns << CalenTimeColumn(); |
|
127 |
|
128 mList << region; |
|
129 } |
|
130 |
|
131 void Reset() {} |
|
132 |
|
133 void InsertTimedEvent( const SCalenApptInfo& aItemInfo ) {Q_UNUSED(aItemInfo);} |
|
134 |
|
135 public: |
|
136 QList<CalenTimeRegion> mList; |
|
137 }; |
|
138 |
|
139 #endif // CALENDAYINFO_H |
|
140 |
|
141 // End of File |