1 /* |
|
2 * Copyright (c) 2005-2006 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: Shortcut plug-in engine extension |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "caiscutextdata.h" |
|
20 #include <fbs.h> |
|
21 #include <gulicon.h> |
|
22 |
|
23 // ======== LOCAL DEFINITIONS ======== |
|
24 |
|
25 namespace |
|
26 { |
|
27 } |
|
28 |
|
29 // ======== MEMBER FUNCTIONS ======== |
|
30 |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 // --------------------------------------------------------------------------- |
|
34 // |
|
35 CAiScutExtData* CAiScutExtData::NewL( const TDesC& aTargetDefinition ) |
|
36 { |
|
37 CAiScutExtData* self = CAiScutExtData::NewLC( aTargetDefinition ); |
|
38 CleanupStack::Pop( self ); |
|
39 return self; |
|
40 } |
|
41 |
|
42 CAiScutExtData* CAiScutExtData::NewLC( const TDesC& aTargetDefinition ) |
|
43 { |
|
44 CAiScutExtData* self = new( ELeave ) CAiScutExtData; |
|
45 CleanupStack::PushL( self ); |
|
46 self->ConstructL( aTargetDefinition ); |
|
47 return self; |
|
48 } |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 CAiScutExtData::~CAiScutExtData() |
|
54 { |
|
55 delete iIcon; |
|
56 delete iPopupLineArray; |
|
57 delete iTargetDefinition; |
|
58 } |
|
59 |
|
60 // --------------------------------------------------------------------------- |
|
61 // |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 CAiScutExtData::CAiScutExtData() |
|
65 { |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 void CAiScutExtData::ConstructL( const TDesC& aTargetDefinition ) |
|
73 { |
|
74 iTargetDefinition = aTargetDefinition.AllocL(); |
|
75 } |
|
76 |
|
77 // --------------------------------------------------------------------------- |
|
78 // |
|
79 // --------------------------------------------------------------------------- |
|
80 // |
|
81 const TDesC& CAiScutExtData::TargetDefinition() const |
|
82 { |
|
83 return *iTargetDefinition; |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // |
|
88 // --------------------------------------------------------------------------- |
|
89 // |
|
90 void CAiScutExtData::SwitchPopupLineArray( CDesCArray* aPopupLineArray ) |
|
91 { |
|
92 delete iPopupLineArray; |
|
93 iPopupLineArray = aPopupLineArray; |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 void CAiScutExtData::ResetPopupLineArray() |
|
101 { |
|
102 delete iPopupLineArray; |
|
103 iPopupLineArray = NULL; |
|
104 } |
|
105 |
|
106 // --------------------------------------------------------------------------- |
|
107 // |
|
108 // --------------------------------------------------------------------------- |
|
109 // |
|
110 void CAiScutExtData::SwitchIcon( CGulIcon* aIcon ) |
|
111 { |
|
112 delete iIcon; |
|
113 iIcon = aIcon; |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // |
|
118 // --------------------------------------------------------------------------- |
|
119 // |
|
120 void CAiScutExtData::ResetIcon() |
|
121 { |
|
122 delete iIcon; |
|
123 iIcon = NULL; |
|
124 } |
|
125 |
|
126 // --------------------------------------------------------------------------- |
|
127 // |
|
128 // --------------------------------------------------------------------------- |
|
129 // |
|
130 const MDesCArray* CAiScutExtData::PopupLineArray() const |
|
131 { |
|
132 return iPopupLineArray; |
|
133 } |
|
134 |
|
135 // --------------------------------------------------------------------------- |
|
136 // |
|
137 // --------------------------------------------------------------------------- |
|
138 // |
|
139 const CGulIcon* CAiScutExtData::Icon() const |
|
140 { |
|
141 return iIcon; |
|
142 } |
|
143 |
|
144 // --------------------------------------------------------------------------- |
|
145 // |
|
146 // --------------------------------------------------------------------------- |
|
147 // |
|
148 /* |
|
149 CGulIcon* CAiScutExtData::DuplicateIconL() const |
|
150 { |
|
151 if( !iIcon ) |
|
152 { |
|
153 return NULL; |
|
154 } |
|
155 |
|
156 CGulIcon* newIcon = CGulIcon::NewLC(); |
|
157 |
|
158 CFbsBitmap* iconBitmap = iIcon->Bitmap(); |
|
159 if( iconBitmap && iconBitmap->Handle() != 0 ) |
|
160 { |
|
161 CFbsBitmap* newBitmap = new( ELeave ) CFbsBitmap(); |
|
162 CleanupStack::PushL( newBitmap ); |
|
163 User::LeaveIfError( newBitmap->Duplicate( iconBitmap->Handle() ) ); |
|
164 CleanupStack::Pop( newBitmap ); |
|
165 newIcon->SetBitmap( newBitmap ); |
|
166 } |
|
167 |
|
168 CFbsBitmap* iconMask = iIcon->Mask(); |
|
169 if( iconMask && iconMask->Handle() != 0 ) |
|
170 { |
|
171 CFbsBitmap* newMask = new( ELeave ) CFbsBitmap(); |
|
172 CleanupStack::PushL( newMask ); |
|
173 User::LeaveIfError( newMask->Duplicate( iconMask->Handle() ) ); |
|
174 CleanupStack::Pop( newMask ); |
|
175 newIcon->SetMask( newMask ); |
|
176 } |
|
177 |
|
178 CleanupStack::Pop( newIcon ); |
|
179 return newIcon; |
|
180 } |
|
181 */ |
|
182 |
|
183 // End of File. |
|