45
|
1 |
/*
|
57
|
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 CalenDayItemView class
|
|
15 |
*
|
|
16 |
*/
|
45
|
17 |
|
|
18 |
#ifndef CALENDAYINFO_H
|
|
19 |
#define CALENDAYINFO_H
|
|
20 |
|
57
|
21 |
#include <calinstance.h>
|
45
|
22 |
#include "caleninstanceid.h"
|
57
|
23 |
#include <hb_calencommands.hrh>
|
45
|
24 |
|
57
|
25 |
const int KFSCalMaxDescriptionLength = 100;
|
45
|
26 |
|
57
|
27 |
/*!
|
|
28 |
Mocked struct SCalenApptInfo
|
|
29 |
*/
|
45
|
30 |
struct SCalenApptInfo
|
57
|
31 |
{
|
45
|
32 |
QModelIndex iIndex;
|
|
33 |
QDateTime iStartTime;
|
|
34 |
QDateTime iEndTime;
|
|
35 |
bool iAllDay;
|
|
36 |
TCalenInstanceId iId;
|
57
|
37 |
AgendaEntry::Status iStatus;
|
|
38 |
TBufC<KFSCalMaxDescriptionLength> iSummary;
|
45
|
39 |
TUint32 iColor;
|
57
|
40 |
};
|
|
41 |
|
|
42 |
/*!
|
|
43 |
Mocked class CalenTimeColumn
|
|
44 |
*/
|
|
45 |
class CalenTimeColumn
|
|
46 |
{
|
|
47 |
public:
|
|
48 |
CalenTimeColumn() {
|
|
49 |
|
|
50 |
}
|
|
51 |
|
|
52 |
~CalenTimeColumn() {
|
|
53 |
|
|
54 |
}
|
|
55 |
};
|
45
|
56 |
|
57
|
57 |
/*!
|
|
58 |
Mocked class CalenTimeRegion
|
|
59 |
*/
|
|
60 |
class CalenTimeRegion
|
|
61 |
{
|
|
62 |
public:
|
|
63 |
CalenTimeRegion() {
|
|
64 |
|
|
65 |
}
|
|
66 |
|
|
67 |
~CalenTimeRegion() {
|
|
68 |
|
|
69 |
}
|
|
70 |
|
|
71 |
QList<CalenTimeColumn> iColumns;
|
|
72 |
|
|
73 |
int iStartSlot;
|
|
74 |
int iEndSlot;
|
|
75 |
};
|
|
76 |
|
|
77 |
/*!
|
81
|
78 |
Mocked class CalenTimedEventInfo
|
|
79 |
*/
|
|
80 |
class CalenTimedEventInfo
|
|
81 |
{
|
|
82 |
public:
|
|
83 |
CalenTimedEventInfo() {
|
|
84 |
|
|
85 |
}
|
|
86 |
|
|
87 |
~CalenTimedEventInfo() {
|
|
88 |
|
|
89 |
}
|
|
90 |
};
|
|
91 |
|
|
92 |
/*!
|
57
|
93 |
Mocked class CalenDayInfo
|
|
94 |
*/
|
45
|
95 |
class CalenDayInfo
|
|
96 |
{
|
|
97 |
public:
|
57
|
98 |
enum TSlotsInHour
|
|
99 |
{
|
|
100 |
EOne = 1, ETwo, EThree, EFour
|
|
101 |
};
|
45
|
102 |
|
57
|
103 |
public:
|
45
|
104 |
|
57
|
105 |
CalenDayInfo(TSlotsInHour aSlotsInHour)
|
|
106 |
{
|
|
107 |
Q_UNUSED(aSlotsInHour)
|
|
108 |
}
|
|
109 |
virtual ~CalenDayInfo()
|
|
110 |
{
|
|
111 |
|
|
112 |
}
|
45
|
113 |
|
81
|
114 |
void Reset()
|
|
115 |
{
|
|
116 |
mList.clear();
|
|
117 |
iAlldayEvents.clear();
|
|
118 |
}
|
45
|
119 |
|
81
|
120 |
void InsertTimedEvent( const SCalenApptInfo& aItemInfo )
|
|
121 |
{
|
|
122 |
Q_UNUSED(aItemInfo);
|
|
123 |
CalenTimeRegion region;
|
|
124 |
|
|
125 |
region.iStartSlot = 10;
|
|
126 |
region.iEndSlot = 13;
|
|
127 |
region.iColumns << CalenTimeColumn();
|
|
128 |
|
|
129 |
mList << region;
|
|
130 |
}
|
57
|
131 |
|
|
132 |
|
|
133 |
void GetLocation( const SCalenApptInfo& aItemInfo, int& aStartSlot,
|
|
134 |
int& aEndSlot, int& aColumnIndex, int& aColumns )
|
|
135 |
{
|
|
136 |
Q_UNUSED(aItemInfo)
|
|
137 |
Q_UNUSED(aStartSlot)
|
|
138 |
Q_UNUSED(aEndSlot)
|
|
139 |
Q_UNUSED(aColumnIndex)
|
|
140 |
Q_UNUSED(aColumns)
|
|
141 |
}
|
|
142 |
|
|
143 |
int AlldayCount()
|
|
144 |
{
|
81
|
145 |
return iAlldayEvents.count();
|
57
|
146 |
}
|
45
|
147 |
|
57
|
148 |
const QList<CalenTimeRegion>& RegionList() const
|
|
149 |
{
|
|
150 |
return mList;
|
|
151 |
}
|
|
152 |
|
|
153 |
void InsertAlldayEvent( const SCalenApptInfo& aItemInfo )
|
|
154 |
{
|
|
155 |
Q_UNUSED(aItemInfo)
|
|
156 |
|
81
|
157 |
CalenTimedEventInfo info;
|
|
158 |
iAlldayEvents.append(info);
|
57
|
159 |
}
|
|
160 |
|
|
161 |
public:
|
|
162 |
QList<CalenTimeRegion> mList;
|
81
|
163 |
QList<CalenTimedEventInfo> iAlldayEvents;
|
45
|
164 |
};
|
|
165 |
|
57
|
166 |
#endif // CALENDAYINFO_H
|
|
167 |
|
|
168 |
// End of File
|