|
1 /* |
|
2 * Copyright (c) 2007 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: Implements UI utils |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CALENACTIONUIUTILS_H |
|
20 #define CALENACTIONUIUTILS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <badesca.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class AgendaEntry; |
|
27 class AgendaUtil; |
|
28 class TCalenInstanceId; |
|
29 class QString; |
|
30 class QDateTime; |
|
31 // CLASS DEFINITIONS |
|
32 |
|
33 |
|
34 |
|
35 /** |
|
36 * Implements UI utils found in the services API. We have to do this here |
|
37 * because both the controller and the services need these functions, but |
|
38 * the controller doesn't know about the services (and to link the two |
|
39 * would create a circular dependency). |
|
40 */ |
|
41 NONSHARABLE_CLASS( CalenActionUiUtils ) |
|
42 { |
|
43 |
|
44 public: |
|
45 enum TDeleteConfirmationType |
|
46 { |
|
47 EDeleteEntry = 1, |
|
48 EDeleteToDo, |
|
49 EDeleteToDos, |
|
50 EDeleteAll |
|
51 }; |
|
52 |
|
53 enum TRepeatQueryType |
|
54 { |
|
55 ESave = 1, |
|
56 EDelete, |
|
57 EEdit |
|
58 }; |
|
59 public: // New functions |
|
60 |
|
61 /** |
|
62 * Find a instance with the given instance id and instance view |
|
63 * @param aId Target Instance Id |
|
64 * @param aInstanceView reference to InstanceView |
|
65 * @return Pointer to CCalInstance |
|
66 */ |
|
67 static AgendaEntry findPossibleInstanceL( const TCalenInstanceId& id, |
|
68 AgendaUtil* agendaUtil ); |
|
69 |
|
70 /** |
|
71 * Mark to-do entry as completed or restore a completed to-do and save. |
|
72 * @param aEntryView CCalEntryView to save this instance to. |
|
73 * @param aToDoEntry CCalEntry reference. Entry type must be CCalEntry::ETodo. |
|
74 * @param aStatus ETrue, to set as completed. EFalse to restore completed to-do. |
|
75 * @panic Function panics if the type of aToDoEntry is different than CCalEntry::ETodo. |
|
76 **/ |
|
77 static void setToDoCompleteStatus(AgendaUtil* agendaUtil, |
|
78 AgendaEntry& entry, |
|
79 const bool status ); |
|
80 |
|
81 static int showDeleteConfirmationQueryL(const TDeleteConfirmationType type, |
|
82 const TInt count = 0); |
|
83 |
|
84 private: // Construction and destruction |
|
85 // Hiding constructor, because this is static utility class. |
|
86 //lint -e{1526} |
|
87 /** |
|
88 * Private C++ constructor |
|
89 */ |
|
90 CalenActionUiUtils(); |
|
91 |
|
92 // Hiding assignment, because this is static utility class. |
|
93 //lint -e{1526} |
|
94 /** |
|
95 * Private assignment operator |
|
96 */ |
|
97 CalenActionUiUtils& operator=( const CalenActionUiUtils& ); |
|
98 }; |
|
99 |
|
100 #endif // CALENACTIONUIUTILS_H |
|
101 |
|
102 // End of file |