|
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: Implementation of the class CFscContactAction. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "emailtrace.h" |
|
20 #include <StringLoader.h> |
|
21 #include <gulicon.h> |
|
22 |
|
23 #include "cfsccontactaction.h" |
|
24 #include "mfscreasoncallback.h" |
|
25 |
|
26 // ======== LOCAL FUNCTIONS ======== |
|
27 |
|
28 // ======== MEMBER FUNCTIONS ======== |
|
29 |
|
30 // --------------------------------------------------------------------------- |
|
31 // CFscContactAction::NewL |
|
32 // --------------------------------------------------------------------------- |
|
33 // |
|
34 CFscContactAction* CFscContactAction::NewL( |
|
35 MFscReasonCallback& aReasonCallback, |
|
36 TUid aContactActionUid, |
|
37 TUint64 aActionType, |
|
38 TInt aActionMenuTextResourceId, |
|
39 CGulIcon* aIcon ) |
|
40 { |
|
41 FUNC_LOG; |
|
42 CFscContactAction* self = |
|
43 new ( ELeave ) CFscContactAction( |
|
44 aReasonCallback, |
|
45 aContactActionUid, |
|
46 aActionType, |
|
47 aIcon ); |
|
48 |
|
49 CleanupStack::PushL( self ); |
|
50 |
|
51 self->ConstructL( aActionMenuTextResourceId ); |
|
52 CleanupStack::Pop( self ); |
|
53 |
|
54 return self; |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // CFscContactAction::~CFscContactAction |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 CFscContactAction::~CFscContactAction() |
|
62 { |
|
63 FUNC_LOG; |
|
64 delete iIcon; |
|
65 delete iActionMenuText; |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // CFscContactAction::Uid |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 TUid CFscContactAction::Uid() const |
|
73 { |
|
74 FUNC_LOG; |
|
75 return iContactActionUid; |
|
76 } |
|
77 |
|
78 // --------------------------------------------------------------------------- |
|
79 // CFscContactAction::Type |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 TUint64 CFscContactAction::Type() const |
|
83 { |
|
84 FUNC_LOG; |
|
85 return iActionType; |
|
86 } |
|
87 |
|
88 // --------------------------------------------------------------------------- |
|
89 // CFscContactAction::Icon |
|
90 // --------------------------------------------------------------------------- |
|
91 // |
|
92 const CGulIcon* CFscContactAction::Icon() const |
|
93 { |
|
94 FUNC_LOG; |
|
95 return iIcon; |
|
96 } |
|
97 |
|
98 // --------------------------------------------------------------------------- |
|
99 // CFscContactAction::ActionMenuText |
|
100 // --------------------------------------------------------------------------- |
|
101 // |
|
102 const TDesC& CFscContactAction::ActionMenuText() const |
|
103 { |
|
104 FUNC_LOG; |
|
105 return *iActionMenuText; |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------------------------- |
|
109 // CFscContactAction::ReasonL |
|
110 // --------------------------------------------------------------------------- |
|
111 // |
|
112 void CFscContactAction::ReasonL( TInt aReasonId, HBufC*& aReason ) const |
|
113 { |
|
114 FUNC_LOG; |
|
115 iReasonCallback.GetReasonL( iContactActionUid, aReasonId, aReason ); |
|
116 } |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // CFscContactAction::SetIcon |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 void CFscContactAction::SetIcon( CGulIcon* aIcon ) |
|
123 { |
|
124 FUNC_LOG; |
|
125 delete iIcon; |
|
126 iIcon = NULL; |
|
127 iIcon = aIcon; |
|
128 } |
|
129 |
|
130 // --------------------------------------------------------------------------- |
|
131 // CFscContactAction::CFscContactAction |
|
132 // --------------------------------------------------------------------------- |
|
133 // |
|
134 CFscContactAction::CFscContactAction( |
|
135 MFscReasonCallback& aReasonCallback, |
|
136 TUid aContactActionUid, |
|
137 TUint64 aActionType, |
|
138 CGulIcon* aIcon ) |
|
139 : iContactActionUid( aContactActionUid ), |
|
140 iActionType( aActionType ), |
|
141 iIcon( aIcon ), |
|
142 iReasonCallback( aReasonCallback ) |
|
143 { |
|
144 FUNC_LOG; |
|
145 } |
|
146 |
|
147 // --------------------------------------------------------------------------- |
|
148 // CFscContactAction::ConstructL |
|
149 // --------------------------------------------------------------------------- |
|
150 // |
|
151 void CFscContactAction::ConstructL( TInt aActionMenuTextResourceId ) |
|
152 { |
|
153 FUNC_LOG; |
|
154 iActionMenuText = StringLoader::LoadL( aActionMenuTextResourceId ); |
|
155 } |
|
156 |
|
157 // ======== GLOBAL FUNCTIONS ======== |
|
158 |