|
1 /* |
|
2 * Copyright (c) 2008 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: Base class for the Agenda Model event and todo item adapters |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPIMAGNITEMADAPTER_H |
|
20 #define CPIMAGNITEMADAPTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "pimcommon.h" |
|
24 #include <tz.h> |
|
25 #include "functionserver.h" |
|
26 #include "fs_methodcall.h" |
|
27 |
|
28 // TYPE DEFINITIONS |
|
29 enum TPIMDateFormat |
|
30 { |
|
31 EPIMDateUTC, EPIMDateLocal |
|
32 }; |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CCalenInterimUtils2; |
|
36 class CCalEntry; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 /** |
|
40 * Agenda Item Adapter |
|
41 * Base class for Todo item adapter and Event item adapters. |
|
42 */ |
|
43 NONSHARABLE_CLASS(CPIMAgnItemAdapter): public CBase |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 virtual ~CPIMAgnItemAdapter(); |
|
51 |
|
52 protected: // Non-public operations |
|
53 |
|
54 // Allow derivation with protected default constructor. |
|
55 CPIMAgnItemAdapter(java::util::FunctionServer* aFuncServer); |
|
56 |
|
57 /** |
|
58 * By default Symbian 2nd phase constructor is private. |
|
59 */ |
|
60 void ConstructL(); |
|
61 |
|
62 /** |
|
63 * Checks that a requested date is in valid agenda ragne |
|
64 * |
|
65 * @param aDate Date to check |
|
66 * @return True if valid, false if not |
|
67 */ |
|
68 TBool IsDateInValidAgendaRange(TPIMDate aDate) const; |
|
69 |
|
70 /** |
|
71 * StartOfDay |
|
72 * Converts time to start of the passed time |
|
73 * @param aTime Time which will be converted to start of date |
|
74 * @return Start of the requested date |
|
75 */ |
|
76 TPIMDate StartOfDay(const TPIMDate& aTime) const; |
|
77 |
|
78 /** |
|
79 * ConvertTimeL |
|
80 * Converts Time to specified time format. Conversion can be made |
|
81 * from UTC to local or from local to UTC. |
|
82 * @param aTime Time which will be converted. On return this contains |
|
83 * the converted value |
|
84 * @param aRequestedFormat The format to which the time needs to |
|
85 * be converted |
|
86 */ |
|
87 void ConvertTimeL( |
|
88 TPIMDate& aTime, |
|
89 const TPIMDateFormat aRequestedFormat); |
|
90 |
|
91 /** |
|
92 * Creates a new native calendar entry. The created item is left to |
|
93 * the cleanup stack and the caller takes ownership of the object |
|
94 * |
|
95 * @param aType Type of the native calendar entry |
|
96 * @return A new native calendar entry |
|
97 */ |
|
98 CCalEntry* CreateCalendarEntryLC(const TInt aType); |
|
99 |
|
100 private: // Prohibited operations |
|
101 |
|
102 // Prohibit copy constructor. |
|
103 CPIMAgnItemAdapter(const CPIMAgnItemAdapter&) |
|
104 {} |
|
105 |
|
106 // Prohibit assigment operator. |
|
107 CPIMAgnItemAdapter& operator=(const CPIMAgnItemAdapter&); |
|
108 |
|
109 void DoClose(); |
|
110 |
|
111 private: // Data |
|
112 |
|
113 // Used to generate guids. Owned |
|
114 CCalenInterimUtils2* iCalenInterimUtils; |
|
115 // Time zone API is used in time conversions. Owned |
|
116 RTz iTzServer; |
|
117 |
|
118 protected: |
|
119 |
|
120 java::util::FunctionServer* iFuncServer; |
|
121 |
|
122 }; |
|
123 |
|
124 #endif // CPIMAGNITEMADAPTER_H |
|
125 // End of file |