|
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: Converts PIM Event items and native calendar day notes |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPIMAGNMEMOADAPTER_H |
|
20 #define CPIMAGNMEMOADAPTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "cpimagneventadapter.h" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MPIMEventItem; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 /** |
|
30 * Day note Item Adapter |
|
31 * Converts PIM Event items and native calendar day notes |
|
32 */ |
|
33 NONSHARABLE_CLASS(CPIMAgnMemoAdapter) : public CPIMAgnEventAdapter |
|
34 { |
|
35 public: // Constructor and destructor |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 */ |
|
40 static CPIMAgnMemoAdapter* NewL(java::util::FunctionServer* aFuncServer); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 virtual ~CPIMAgnMemoAdapter(); |
|
46 |
|
47 public: // new methods |
|
48 |
|
49 /** |
|
50 * Constructs a Agenda Model entry from the framework PIM item. |
|
51 * |
|
52 * @param aItem The item to convert |
|
53 * |
|
54 * @return A CCalEntry constructed according to framework item. |
|
55 * The \b ownership of the card is transferred to the caller. |
|
56 * |
|
57 * @par Leaving: |
|
58 * This method may leave. |
|
59 */ |
|
60 CCalEntry* CreateItemToAgnL(const MPIMEventItem& aItem); |
|
61 |
|
62 /** |
|
63 * Converts from Agenda Model entry to the framework PIM item. |
|
64 * |
|
65 * @param aItem PIM Item data container store the entry data. |
|
66 * @param aEntry Agenda Model entry to convert. |
|
67 * |
|
68 * @par Leaving: |
|
69 * This method may leave. |
|
70 */ |
|
71 void ReadAgnToItemL(MPIMEventItem& aItem, |
|
72 CCalEntry& aEntry); |
|
73 |
|
74 /** |
|
75 * Updates the Agenda Model entry according to the framework PIM item. |
|
76 * |
|
77 * @param aItem PIM Item with the current data. |
|
78 * @param aEntry Agenda Model entry to update. |
|
79 * |
|
80 * @par Leaving: |
|
81 * This method may leave. |
|
82 */ |
|
83 void UpdateItemToAgnL(const MPIMEventItem& aItem, |
|
84 CCalEntry& aEntry); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * C++ constructor. |
|
90 */ |
|
91 CPIMAgnMemoAdapter(java::util::FunctionServer* aFuncServer); |
|
92 |
|
93 /** |
|
94 * Converts the start field of an Agenda Model entry into |
|
95 * the framework PIM item field. |
|
96 * Implements the pure virtual method from the base class. |
|
97 * |
|
98 * @param aItem Framework PIM Item. |
|
99 * @param aEntry Agenda Model entry |
|
100 * |
|
101 * @par Leaving: |
|
102 * This method may leave. |
|
103 */ |
|
104 void ReadStartFromAgnL(MPIMEventItem& aItem, |
|
105 CCalEntry& aEntry); |
|
106 |
|
107 /** |
|
108 * Converts the end field of an Agenda Model entry into |
|
109 * the framework PIM item field. |
|
110 * Implements the pure virtual method from the base class. |
|
111 * |
|
112 * @param aItem Framework PIM Item. |
|
113 * @param aEntry Agenda Model entry |
|
114 * |
|
115 * @par Leaving: |
|
116 * This method may leave. |
|
117 */ |
|
118 void ReadEndFromAgnL(MPIMEventItem& aItem, |
|
119 CCalEntry& aEntry); |
|
120 |
|
121 /** |
|
122 * Adds default values to the native entry. This function MUST call |
|
123 * the version from the base class since it adds common values for all |
|
124 * event entries in the native database. |
|
125 * |
|
126 * @param aItem PIM API Event item |
|
127 * @param aEntry Native entry which will contain PIM data |
|
128 */ |
|
129 void AddDefaultValuesToEntryL( |
|
130 const MPIMEventItem& aItem, |
|
131 CCalEntry& aEntry) const; |
|
132 |
|
133 protected: |
|
134 |
|
135 void ConstructL(); |
|
136 |
|
137 }; |
|
138 |
|
139 #endif // CPIMAGNMEMOADAPTER_H |
|
140 // End of file |