|
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: Contact item access interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MPIMCONTACTITEM_H |
|
20 #define MPIMCONTACTITEM_H |
|
21 |
|
22 // INTERNAL INCLUDES |
|
23 #include "e32def.h" |
|
24 #include "pimcommon.h" |
|
25 #include "pimcontact.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MPIMItemData; |
|
29 |
|
30 /** |
|
31 * Interface for accessing Contact-specific parts of an item. |
|
32 * See \ref MPIMItemData class. |
|
33 */ |
|
34 class MPIMContactItem |
|
35 { |
|
36 public: |
|
37 // Destructor |
|
38 |
|
39 /** |
|
40 * Destructor. |
|
41 */ |
|
42 virtual ~MPIMContactItem() |
|
43 { |
|
44 } |
|
45 |
|
46 public: |
|
47 // New functions |
|
48 |
|
49 //@{ |
|
50 /** |
|
51 * Provides access to the \ref MPIMItemData representation of this |
|
52 * MPIMContactItemData object. |
|
53 * There are const and non-const versions of this method. |
|
54 * |
|
55 * @return The \ref MPIMItemData representation of the item. |
|
56 */ |
|
57 virtual MPIMItemData& ItemData() = 0; |
|
58 virtual const MPIMItemData& ItemData() const = 0; |
|
59 //@} |
|
60 |
|
61 /** |
|
62 * Provides a single preferred index among the indexes in the value |
|
63 * array of a specific field. |
|
64 * |
|
65 * @param aField The field. |
|
66 * |
|
67 * @return Preferred index in the value array. KPIMNoPreferredIndex |
|
68 * if no preferred index is set. |
|
69 * |
|
70 * @par Leaving: |
|
71 * The method leaves on error. Error codes should be interpreted as |
|
72 * follows: |
|
73 * @li \c KErrArgument - \a aField is not valid for the implementing |
|
74 * PIM item type. |
|
75 * @li \c KErrNotSupported - \a aField is not supported by this |
|
76 * particular implementation. |
|
77 */ |
|
78 virtual TInt getPreferredIndex(TPIMField aField) const = 0; |
|
79 |
|
80 /** |
|
81 * Sets new contact item id for this contact item |
|
82 * |
|
83 * @param aContactItemId New id for this contact item. Old is to |
|
84 * be owerwriten |
|
85 */ |
|
86 virtual void SetContactItemIdL(const TPIMItemID& aContactItemId) = 0; |
|
87 |
|
88 /** |
|
89 * Sets new contact item id for this contact item |
|
90 * This function was introduces for easier item id handling |
|
91 * |
|
92 * @param aContactItemId New id for this contact item. Old is to |
|
93 * be owerwriten |
|
94 */ |
|
95 virtual void SetContactItemIdL(const TUint aContactItemId) = 0; |
|
96 |
|
97 /** |
|
98 * Returns contact item id |
|
99 * The existing PIM item id is converted to a contact |
|
100 * contact database item id, so it is easier to use it |
|
101 * |
|
102 * @return Contact item id |
|
103 */ |
|
104 virtual TUint ContactItemIdL() const = 0; |
|
105 |
|
106 /** |
|
107 * Sets the last modified date/time of the item |
|
108 * @param aLastModified Last modification date of this item |
|
109 */ |
|
110 virtual void SetLastModifiedL(TPIMDate aLastModified) = 0; |
|
111 |
|
112 /** |
|
113 * Resets the item's internal state and remove all data |
|
114 * associated with this item. The item is ready for use |
|
115 * after reset |
|
116 */ |
|
117 virtual void PrepareForLoadL() = 0; |
|
118 |
|
119 protected: |
|
120 // Non-public operations |
|
121 |
|
122 // Allow derivation with protected default constructor. |
|
123 MPIMContactItem() |
|
124 { |
|
125 } |
|
126 |
|
127 private: |
|
128 // Prohibited operations |
|
129 // Prohibit copy constructor. |
|
130 MPIMContactItem(const MPIMContactItem&) |
|
131 { |
|
132 } |
|
133 |
|
134 // Prohibit assigment operator. |
|
135 MPIMContactItem& operator=(const MPIMContactItem&) |
|
136 { |
|
137 return *this; |
|
138 } |
|
139 |
|
140 }; |
|
141 |
|
142 #endif // MPIMCONTACTITEM_H |
|
143 // End of File |