|
1 /* |
|
2 * Copyright (c) 2009 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 : Model(Engine related functionality) for calendar list dialog. |
|
15 */ |
|
16 |
|
17 #ifndef CMultiCalUiDialogModel_H_ |
|
18 #define CMultiCalUiDialogModel_H_ |
|
19 |
|
20 //System include |
|
21 #include <e32base.h> |
|
22 |
|
23 |
|
24 // Forward delclarations. |
|
25 class CCalenInterimUtils2; |
|
26 class CCalCalendarInfo; |
|
27 class CCalSession; |
|
28 class CCalEntryView; |
|
29 class CCalEntry; |
|
30 |
|
31 NONSHARABLE_CLASS(CMultiCalUiDialogModel) : public CBase |
|
32 { |
|
33 public: |
|
34 /** |
|
35 * 1st phase constructor pushes pointer on the cleanup stack |
|
36 * @return CCalenMultiDbUtility* A pointer to CCalenMultiDbUtility |
|
37 */ |
|
38 static CMultiCalUiDialogModel* NewL(); |
|
39 |
|
40 /** |
|
41 * 1st phase constructor pushes pointer on the cleanup stack |
|
42 * @return CCalenMultiDbUtility* A pointer to CCalenMultiDbUtility |
|
43 */ |
|
44 static CMultiCalUiDialogModel* NewLC(); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CMultiCalUiDialogModel(); |
|
50 |
|
51 /** |
|
52 * Setter function for calendar entry. |
|
53 * @param aCalEntry. Calendar Entry. |
|
54 */ |
|
55 void SetCalEntryL(const RPointerArray<CCalEntry>& aCalEntries); |
|
56 |
|
57 /** |
|
58 * Stores the calendar entry into the calendars selected by the user. |
|
59 */ |
|
60 void StoreCalEntryL(); |
|
61 |
|
62 /** |
|
63 * Getter function for Multidbinfo. |
|
64 */ |
|
65 RPointerArray<CCalCalendarInfo>& GetCalendarInfoArray(); |
|
66 |
|
67 /** |
|
68 * @brief Sets the calendar status in the array whether calendar is |
|
69 * marked or unmarked by the user. |
|
70 * @param aIndex Index of the calendar to be marked. |
|
71 * @param aStatus EFalse for Marked and ETrue for UnMarked. |
|
72 */ |
|
73 void SetCalendarStatus(TInt aIndex, TBool aStatus); |
|
74 |
|
75 /** |
|
76 * @brief Gets marked or unmarked status of calendar. |
|
77 * @param aIndex Index of the calendar for which status is obtained. |
|
78 */ |
|
79 TBool GetCalendarStatus(TInt aIndex); |
|
80 |
|
81 /** |
|
82 * @brief Gets the count of marked calendars. |
|
83 * @return Count of marked calendars. |
|
84 */ |
|
85 TInt MarkedCalendarsCount(); |
|
86 |
|
87 /** |
|
88 * @brief Creates the copy of calendar entry, generates new guid while |
|
89 * creating the copy. |
|
90 * @param aCalEntries Calendar entries to be copied. |
|
91 */ |
|
92 void CreateCopyL(RPointerArray<CCalEntry>& aCalCopyEntries); |
|
93 |
|
94 /* |
|
95 * |
|
96 */ |
|
97 |
|
98 |
|
99 private: |
|
100 |
|
101 /* |
|
102 * Class constructor |
|
103 */ |
|
104 CMultiCalUiDialogModel(); |
|
105 |
|
106 /* |
|
107 * Second phase constructor |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 /* |
|
112 * Gets all calendar info available on the device. |
|
113 * @param aCalendarInfoList array of CCalCalendarInfo out param |
|
114 * @return void |
|
115 */ |
|
116 void GetAllCalendarInfoL(RPointerArray<CCalCalendarInfo>& aCalendarInfoList); |
|
117 |
|
118 private: |
|
119 //data |
|
120 RPointerArray<CCalSession> iCalSessionArray; |
|
121 RPointerArray<CCalEntryView> iCalEntryViewArray; |
|
122 RPointerArray<CCalEntry> iCalEntries; |
|
123 RPointerArray<CCalCalendarInfo> iCalendarInfoList; |
|
124 RArray<TBool> iCalendarStatus; |
|
125 CCalenInterimUtils2* iInterimUtils; |
|
126 CCalSession* iCalendarsSession; |
|
127 }; |
|
128 |
|
129 #endif |