|
1 /* |
|
2 * Copyright (c) 2008-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: Container for icon choice decision data. |
|
15 */ |
|
16 |
|
17 #ifndef CCUSTOMICONDECISIONDATA_H |
|
18 #define CCUSTOMICONDECISIONDATA_H |
|
19 |
|
20 // INCLUDES |
|
21 #include <e32base.h> |
|
22 |
|
23 // FORWARD DECLARATIONS |
|
24 class MVPbkContactLink; |
|
25 |
|
26 /** |
|
27 * Container for icon choice decision data. |
|
28 * |
|
29 * When an application supporting Contact Related Icon Customization API allows |
|
30 * customization for a certain icon, it instantiates this class and passes it to |
|
31 * the icon customization plug-in for getting a reference to the custom icon. |
|
32 * |
|
33 * The plug-in uses the data members of this class for its decision making. For |
|
34 * example, it could use the iPhoneNumber to resolve a certain custom icon |
|
35 * which is related to that phone number. |
|
36 * |
|
37 * Note that member values and semantics are undefined by the API. The |
|
38 * application decides how the values are filled. Application should |
|
39 * at least fill one of the members so that the plug-in can make meaningful |
|
40 * icon choice decision. |
|
41 * |
|
42 * @see CContactIconCustomPluginBase |
|
43 */ |
|
44 class CCustomIconDecisionData : public CBase |
|
45 { |
|
46 public: // Construction and destruction |
|
47 |
|
48 /** |
|
49 * Constructor. |
|
50 */ |
|
51 CCustomIconDecisionData(); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CCustomIconDecisionData(); |
|
57 |
|
58 public: // Interface |
|
59 |
|
60 /** |
|
61 * Returns the context. |
|
62 * |
|
63 * @return UID of the context. |
|
64 * @see iContext |
|
65 */ |
|
66 TUid Context() const; |
|
67 |
|
68 /** |
|
69 * Returns the time. |
|
70 * |
|
71 * @return Time. |
|
72 * @see iTime |
|
73 */ |
|
74 const TTime* Time() const; |
|
75 |
|
76 /** |
|
77 * Returns the phone number. KNullDesC if not set. |
|
78 * |
|
79 * @return Phone number. |
|
80 */ |
|
81 TPtrC PhoneNumber() const; |
|
82 |
|
83 /** |
|
84 * Returns the contact link. |
|
85 * |
|
86 * @return Contact link. |
|
87 */ |
|
88 const MVPbkContactLink* ContactLinkRef() const; |
|
89 |
|
90 /** |
|
91 * Sets context. |
|
92 * |
|
93 * @param aUid Context UID. |
|
94 * @see iContext |
|
95 */ |
|
96 void SetContext( |
|
97 TUid aUid ); |
|
98 |
|
99 /** |
|
100 * Sets the time. |
|
101 * |
|
102 * @param aTime The time to set. Ownership taken. |
|
103 * @see iTime |
|
104 */ |
|
105 void SetTime( |
|
106 TTime* aTime ); |
|
107 |
|
108 /** |
|
109 * Sets the phone number. |
|
110 * |
|
111 * @param aPhoneNumber The phone number to set. |
|
112 */ |
|
113 void SetPhoneNumberL( |
|
114 const TDesC& aPhoneNumber ); |
|
115 |
|
116 /** |
|
117 * Sets contact link. |
|
118 * |
|
119 * @param aLink The link to set. Ownership is not taken. |
|
120 */ |
|
121 void SetContactLinkRef( |
|
122 const MVPbkContactLink* aLink ); |
|
123 |
|
124 private: // Data |
|
125 |
|
126 /// Own: Context property for customization. |
|
127 /// It is up to caller how it sets this. At minimum caller should set this |
|
128 /// value to its application UID or similar. Or, if there are several |
|
129 /// logical application contexts, application may select different |
|
130 /// UID for each use. Caller is allowed to set this to KNullUid. |
|
131 TUid iContext; |
|
132 |
|
133 /// Own: Time property for customization, optional. |
|
134 /// For example in Logs application this could be time of the Logs event. |
|
135 /// The time value should be Universal time. |
|
136 TTime* iTime; |
|
137 |
|
138 /// Own: Phonenumber property for customization, optional. |
|
139 HBufC* iPhoneNumber; |
|
140 |
|
141 /// Ref: Contact link |
|
142 const MVPbkContactLink* iContactLinkRef; |
|
143 }; |
|
144 |
|
145 #include <CCustomIconDecisionData.inl> |
|
146 |
|
147 #endif // CCUSTOMICONDECISIONDATA_H |
|
148 |
|
149 // End of File |