author | qifeima <> |
Thu, 03 Jun 2010 18:57:10 +0800 | |
changeset 12 | 18b321db4884 |
parent 1 | edfc90759b9f |
permissions | -rw-r--r-- |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1 |
/* |
12 | 2 |
* Copyright (c) 2010 Ixonos Plc. |
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the "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 |
* Ixonos Plc |
|
14 |
* |
|
15 |
* Description: |
|
16 |
* Image Editor's view class that handles all view related issues. |
|
17 |
* |
|
18 |
*/ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
19 |
// INCLUDE FILES |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
20 |
#include <eikmenub.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
21 |
#include <eikbtgpc.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
22 |
#include <bautils.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
23 |
#include <avkon.hrh> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
24 |
#include <aknviewappui.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
25 |
#include <aknconsts.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
26 |
#include <akntitle.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
27 |
#include <aknnavi.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
28 |
#include <aknnavide.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
29 |
#include <aknglobalnote.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
30 |
#include <sendui.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
31 |
#include <aknpopup.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
32 |
#include <CMessageData.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
33 |
#include <AknInfoPopupNoteController.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
34 |
#include <Avkon.rsg> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
35 |
#include <apgcli.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
36 |
#include <apadef.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
37 |
#include <apaid.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
38 |
#include <StringLoader.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
39 |
#include <pathinfo.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
40 |
#include <ImageEditorUI.rsg> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
41 |
#include "ImageEditorUI.hrh" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
42 |
#include "ImageEditorUIPanics.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
43 |
#include "ImageEditorUIView.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
44 |
#include "ImageEditorUIContainer.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
45 |
#include "ImageEditorUtils.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
46 |
#include "DrawUtils.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
47 |
#include "PluginInfo.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
48 |
#include "ResolutionUtil.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
49 |
#include "ImageEditorControlBase.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
50 |
#include "SingleParamControl.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
51 |
#include "imageeditordebugutils.h" |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
52 |
#include "plugingrid.h" |
12 | 53 |
#include "text.rsg" |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
54 |
#ifdef AIW_PRINT_PROVIDER_USED |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
55 |
#include <AiwServiceHandler.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
56 |
#include <AiwMenu.h> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
57 |
#include <AiwCommon.hrh> |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
58 |
#endif |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
59 |
// CONSTANTS |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
60 |
_LIT (KResourceDir, "\\resource\\apps\\"); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
61 |
_LIT (KResourceFile, "imageeditorui.rsc"); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
62 |
_LIT (KComponentName, "ImageEditorUI"); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
63 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
64 |
#define KMediaGalleryUID3 0x101F8599 |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
65 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
66 |
// MACRO DEFINITIONS |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
67 |
#ifdef LANDSCAPE_SUPPORT |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
68 |
#define LANDSCAPE_ARG(x) x |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
69 |
#else |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
70 |
#define LANDSCAPE_ARG(x) |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
71 |
#endif |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
72 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
73 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
74 |
EXPORT_C void CImageEditorUIView::ConstructL() |
12 | 75 |
{ |
76 |
LOG(KImageEditorLogFile, "CImageEditorUIView::ConstructL()"); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
77 |
|
12 | 78 |
// Read resource |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
79 |
TFileName resourcefile; |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
80 |
resourcefile.Append(KResourceDir); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
81 |
resourcefile.Append(KResourceFile); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
82 |
|
12 | 83 |
User::LeaveIfError(CompleteWithAppPath(resourcefile)); |
84 |
// Implementation of RConeResourceLoader uses BaflUtils::NearestLanguageFile |
|
85 |
// to search for a localised resource in proper search order |
|
86 |
iResLoader.OpenL(resourcefile); |
|
87 |
||
88 |
// Construct base view |
|
89 |
BaseConstructL(R_IMAGEEDITORUI_VIEW); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
90 |
|
12 | 91 |
// Get reference to status pane |
92 |
CEikStatusPane * sp = AppUi()->StatusPane(); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
93 |
|
12 | 94 |
// Get reference to navi pane |
95 |
iNaviPane = (CAknNavigationControlContainer *) sp->ControlL(TUid::Uid( |
|
96 |
EEikStatusPaneUidNavi)); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
97 |
|
12 | 98 |
// Get reference to title pane |
99 |
iTitlePane = (CAknTitlePane *) sp->ControlL(TUid::Uid( |
|
100 |
EEikStatusPaneUidTitle)); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
101 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
102 |
// Initialize soft key ID:s (needs to be changed if cba resource in |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
103 |
// R_IMAGEEDITORUI_VIEW changes) |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
104 |
iSoftkey1 = EAknSoftkeyEmpty; |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
105 |
iSoftkey2 = EAknSoftkeyEmpty; |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
106 |
iMSK = EAknSoftkeyEmpty; |
12 | 107 |
|
108 |
iInPlugin = EFalse; |
|
109 |
||
110 |
iPopupController = CAknInfoPopupNoteController::NewL(); |
|
111 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
112 |
// Read strings needed for zoom popup |
12 | 113 |
HBufC8 * res8 = CEikonEnv::Static()->AllocReadResourceAsDes8LC(R_ZOOM_TEXTS); |
114 |
TResourceReader resource; |
|
115 |
//Set resource reader buffer |
|
116 |
resource.SetBuffer(res8); |
|
117 |
||
118 |
//Read zoom text count |
|
119 |
TInt16 arraycount = (TInt16) resource.ReadInt16(); |
|
120 |
||
121 |
// There have to be as many zoom texts as there are zoom states |
|
122 |
__ASSERT_ALWAYS( arraycount == ENumOfZooms, User::Panic(KComponentName, |
|
123 |
EImageEditorPanicZoomTextCountDoesntMatch) ); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
124 |
|
12 | 125 |
if (arraycount > 0) |
126 |
{ |
|
127 |
//Construct a new descriptor array |
|
128 |
if (!iZoomTexts) |
|
129 |
{ |
|
130 |
iZoomTexts = new (ELeave) CDesCArraySeg(16); |
|
131 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
132 |
|
12 | 133 |
//Read text to array |
134 |
for (TInt i = 0; i < arraycount; ++i) |
|
135 |
{ |
|
136 |
//Construct a flat descriptor array and read all the texts |
|
137 |
HBufC * parameter = resource.ReadHBufCL(); |
|
138 |
CleanupStack::PushL(parameter); |
|
139 |
TPtrC ptr = parameter->Des(); |
|
140 |
iZoomTexts->AppendL(ptr); |
|
141 |
CleanupStack::PopAndDestroy(); // parameter |
|
142 |
} |
|
143 |
} |
|
144 |
CleanupStack::PopAndDestroy(); // res8 |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
145 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
146 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
147 |
#ifdef AIW_PRINT_PROVIDER_USED |
12 | 148 |
iServiceHandler = CAiwServiceHandler::NewL(); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
149 |
// Attach menu services. |
12 | 150 |
iServiceHandler->AttachMenuL(R_IMAGEEDITORUI_MENUPANE, |
151 |
R_IMAGE_EDITOR_INTEREST); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
152 |
#endif |
12 | 153 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Constructred succesfully"); |
154 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
155 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
156 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
157 |
EXPORT_C CImageEditorUIView::CImageEditorUIView() : |
12 | 158 |
CAknView(), iResLoader(*iEikonEnv), iBusy(ETrue), iContainerInStack(EFalse) |
159 |
{ |
|
160 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
161 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
162 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
163 |
EXPORT_C CImageEditorUIView::~CImageEditorUIView() |
12 | 164 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
165 |
LOG(KImageEditorLogFile, "CImageEditorUIView::~CImageEditorUIView()"); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
166 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
167 |
iResLoader.Close(); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
168 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
169 |
#ifdef AIW_PRINT_PROVIDER_USED |
12 | 170 |
delete iServiceHandler; |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
171 |
#endif |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
172 |
|
12 | 173 |
if (iNaviPane && iNaviDecorator) |
174 |
{ |
|
175 |
iNaviPane->Pop(iNaviDecorator); |
|
176 |
delete iNaviDecorator; |
|
177 |
iNaviDecorator = 0; |
|
178 |
} |
|
179 |
iNaviDecorator = 0; |
|
180 |
||
181 |
if (iNaviPane && iPreviousNaviDecorator) |
|
182 |
{ |
|
183 |
iNaviPane->Pop(iPreviousNaviDecorator); |
|
184 |
delete iPreviousNaviDecorator; |
|
185 |
iPreviousNaviDecorator = 0; |
|
186 |
} |
|
187 |
iPreviousNaviDecorator = 0; |
|
188 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
189 |
RemoveContainerFromStack(); |
12 | 190 |
if (iContainer) |
191 |
{ |
|
192 |
delete iContainer; |
|
193 |
iContainer = 0; |
|
194 |
} |
|
195 |
||
196 |
iArray.Reset(); |
|
197 |
||
198 |
iNaviPane = NULL; |
|
199 |
iTitlePane = NULL; |
|
200 |
iControl = NULL; |
|
201 |
iPreview = NULL; |
|
202 |
iSendAppUi = NULL; |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
203 |
|
12 | 204 |
if (iPopupController) |
205 |
{ |
|
206 |
delete iPopupController; |
|
207 |
} |
|
208 |
||
209 |
if (iZoomTexts) |
|
210 |
{ |
|
211 |
iZoomTexts->Reset(); |
|
212 |
delete iZoomTexts; |
|
213 |
} |
|
214 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
215 |
LOG(KImageEditorLogFile, "CImageEditorUIView: View deleted"); |
12 | 216 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
217 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
218 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
219 |
EXPORT_C TUid CImageEditorUIView::Id() const |
12 | 220 |
{ |
221 |
return KViewId; |
|
222 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
223 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
224 |
//============================================================================= |
12 | 225 |
EXPORT_C void CImageEditorUIView::UpdateLayoutL(TInt LANDSCAPE_ARG(aScreenMode)) const |
226 |
{ |
|
227 |
CEikStatusPane* sp = StatusPane(); |
|
228 |
__ASSERT_ALWAYS( sp, User::Panic(KComponentName, EImageEditorPanicStatusPaneNotAccessible) ); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
229 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
230 |
#ifdef LANDSCAPE_SUPPORT |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
231 |
|
12 | 232 |
TPixelsAndRotation rotation; |
233 |
iEikonEnv->ScreenDevice()->GetScreenModeSizeAndRotation(aScreenMode,rotation); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
234 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
235 |
LOGFMT2(KImageEditorLogFile, "CImageEditorUIView: View mode: ScreenMode: %d, Rotation: %d", aScreenMode, rotation.iRotation); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
236 |
|
12 | 237 |
switch (rotation.iRotation) |
238 |
{ |
|
239 |
case CFbsBitGc::EGraphicsOrientationRotated270: // view mode |
|
240 |
{ |
|
241 |
LOG(KImageEditorLogFile, "CImageEditorUIView: EGraphicsOrientationRotated270"); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
242 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
243 |
#ifndef SWAP_SOFTKEY_POSITIONS |
12 | 244 |
sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_RIGHT); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
245 |
#else |
12 | 246 |
sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_LEFT); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
247 |
#endif |
12 | 248 |
break; |
249 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
250 |
|
12 | 251 |
case CFbsBitGc::EGraphicsOrientationRotated90: // camcorder mode |
252 |
{ |
|
253 |
LOG(KImageEditorLogFile, "CImageEditorUIView: EGraphicsOrientationRotated90"); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
254 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
255 |
#ifndef SWAP_SOFTKEY_POSITIONS |
12 | 256 |
sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_LEFT); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
257 |
#else |
12 | 258 |
sp->SwitchLayoutL(R_AVKON_STACON_PANE_LAYOUT_USUAL_SOFTKEYS_RIGHT); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
259 |
#endif |
12 | 260 |
break; |
261 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
262 |
|
12 | 263 |
case CFbsBitGc::EGraphicsOrientationNormal: |
264 |
default: |
|
265 |
{ |
|
266 |
if (CResolutionUtil::Self()->GetLandscape()) |
|
267 |
{ |
|
268 |
sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL /*R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT*/); |
|
269 |
} |
|
270 |
else |
|
271 |
{ |
|
272 |
sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL); |
|
273 |
} |
|
274 |
break; |
|
275 |
} |
|
276 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
277 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
278 |
#endif |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
279 |
|
12 | 280 |
if (iFullScreen) |
281 |
{ |
|
282 |
// Hide status pane |
|
283 |
sp->MakeVisible(EFalse); |
|
284 |
} |
|
285 |
else |
|
286 |
{ |
|
287 |
// Make status pane visible |
|
288 |
sp->MakeVisible(ETrue); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
289 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
290 |
#ifdef LANDSCAPE_SUPPORT |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
291 |
|
12 | 292 |
// And now the CBA... |
293 |
TRect rect = ClientRect(); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
294 |
|
12 | 295 |
CEikButtonGroupContainer* cba = Cba(); |
296 |
__ASSERT_ALWAYS( cba, User::Panic(KComponentName, EImageEditorPanicCbaNotAccessible) ); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
297 |
|
12 | 298 |
MEikButtonGroup* bgrp = cba->ButtonGroup(); |
299 |
STATIC_CAST( CEikCba*, bgrp)->SetBoundingRect(rect); |
|
300 |
cba->HandleResourceChange(KEikDynamicLayoutVariantSwitch); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
301 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
302 |
#endif |
12 | 303 |
} |
304 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
305 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
306 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
307 |
EXPORT_C TBool CImageEditorUIView::ViewScreenModeCompatible(TInt /*aScreenMode*/) |
12 | 308 |
{ |
309 |
// Supports any screen size |
|
310 |
return ETrue; |
|
311 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
312 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
313 |
//============================================================================= |
12 | 314 |
EXPORT_C void CImageEditorUIView::HandleCommandL(TInt aCommand) |
315 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
316 |
|
12 | 317 |
// If focus is gained or lost |
318 |
if ((aCommand == EImageEditorFocusGained) || (aCommand |
|
319 |
== EImageEditorFocusLost)) |
|
320 |
{ |
|
321 |
if (iContainer && iControl) |
|
322 |
{ |
|
323 |
((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand); |
|
324 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
325 |
} |
12 | 326 |
// If soft key 1 pressed |
327 |
else if (iInPlugin && (aCommand == iSoftkey1) && (aCommand |
|
328 |
!= EAknSoftkeyOptions)) |
|
329 |
{ |
|
330 |
if (iContainer && iContainer->Busy()) |
|
331 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
332 |
return; |
12 | 333 |
} |
334 |
else |
|
335 |
{ |
|
336 |
((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand); |
|
337 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
338 |
} |
12 | 339 |
|
340 |
// If soft key 2 pressed |
|
341 |
else if (iInPlugin && (aCommand == iSoftkey2)) |
|
342 |
{ |
|
343 |
if (iContainer && iContainer->Busy()) |
|
344 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
345 |
return; |
12 | 346 |
} |
347 |
else |
|
348 |
{ |
|
349 |
((CImageEditorControlBase *) iControl)->HandlePluginCommandL( |
|
350 |
aCommand); |
|
351 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
352 |
} |
12 | 353 |
|
354 |
// If msk pressed |
|
355 |
else if (iInPlugin && (aCommand == iMSK)) |
|
356 |
{ |
|
357 |
if (iContainer && iContainer->Busy()) |
|
358 |
{ |
|
359 |
return; |
|
360 |
} |
|
361 |
else |
|
362 |
{ |
|
363 |
((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand); |
|
364 |
} |
|
365 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
366 |
|
12 | 367 |
// Menu plug-in item selected |
368 |
else if (iInPlugin && MenuItemPressedL(aCommand)) |
|
369 |
{ |
|
370 |
((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand); |
|
371 |
} |
|
372 |
||
373 |
else |
|
374 |
{ |
|
375 |
switch (aCommand) |
|
376 |
{ |
|
377 |
case EImageEditorPreGlobalZoomChange: |
|
378 |
case EImageEditorGlobalZoomChanged: |
|
379 |
case EImageEditorGlobalCropChanged: |
|
380 |
case EImageEditorPreGlobalPanChange: |
|
381 |
case EImageEditorGlobalPanChanged: |
|
382 |
case EImageEditorGlobalRotationChanged: |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
383 |
case EImageEditorPreScreenModeChange: |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
384 |
case EImageEditorPostScreenModeChange: |
12 | 385 |
{ |
386 |
if (iInPlugin) |
|
387 |
{ |
|
388 |
((CImageEditorControlBase *) iControl)->HandlePluginCommandL(aCommand); |
|
389 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
390 |
return; |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
391 |
} |
12 | 392 |
case EAknSoftkeyBack: |
393 |
{ |
|
394 |
if (iContainer && iContainer->Busy()) |
|
395 |
{ |
|
396 |
return; |
|
397 |
} |
|
398 |
else |
|
399 |
{ |
|
400 |
AppUi()->HandleCommandL(EImageEditorSoftkeyCmdBack); |
|
401 |
break; |
|
402 |
} |
|
403 |
} |
|
404 |
case EImageEditorUpdateSoftkeys: |
|
405 |
{ |
|
406 |
if (iInPlugin) |
|
407 |
{ |
|
408 |
UpdateSoftkeysL(); |
|
409 |
} |
|
410 |
break; |
|
411 |
} |
|
412 |
case EImageEditorUpdateNavipane: |
|
413 |
{ |
|
414 |
if (iInPlugin) |
|
415 |
{ |
|
416 |
UpdateNaviPaneL(); |
|
417 |
} |
|
418 |
break; |
|
419 |
} |
|
420 |
case EImageEditorTryDisplayMenuBar: |
|
421 |
{ |
|
422 |
CEikMenuBar* menu = MenuBar(); |
|
423 |
__ASSERT_ALWAYS( menu, User::Panic(KComponentName, EImageEditorPanicMenuNotAccessible) ); |
|
424 |
menu->TryDisplayMenuBarL(); |
|
425 |
break; |
|
426 |
} |
|
427 |
case EImageEditorDoPrint: |
|
428 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
429 |
#ifdef AIW_PRINT_PROVIDER_USED |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
430 |
|
12 | 431 |
CAiwGenericParamList& in = iServiceHandler->InParamListL(); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
432 |
|
12 | 433 |
TFileName filename(iImageFileName); |
434 |
TAiwVariant variant(filename); |
|
435 |
TAiwGenericParam param(EGenericParamFile, variant); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
436 |
|
12 | 437 |
in.AppendL(param); |
438 |
||
439 |
iServiceHandler->ExecuteMenuCmdL(iSelectedPrintMenuCmd, in, |
|
440 |
iServiceHandler->OutParamListL()); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
441 |
#endif |
12 | 442 |
break; |
443 |
} |
|
444 |
default: |
|
445 |
{ |
|
446 |
// Print and save |
|
447 |
if (aCommand >= EImageEditorMenuAiwPrintBase && aCommand |
|
448 |
<= EImageEditorMenuAiwPrintLast) |
|
449 |
{ |
|
450 |
iSelectedPrintMenuCmd = aCommand; |
|
451 |
AppUi()->HandleCommandL(EImageEditorSaveAndPrint); |
|
452 |
} |
|
453 |
else |
|
454 |
{ |
|
455 |
AppUi()->HandleCommandL(aCommand); |
|
456 |
} |
|
457 |
break; |
|
458 |
} |
|
459 |
} |
|
460 |
} |
|
461 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
462 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
463 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
464 |
EXPORT_C void CImageEditorUIView::HandleClientRectChange() |
12 | 465 |
{ |
466 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Client rect changed"); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
467 |
|
12 | 468 |
if (iContainer) |
469 |
{ |
|
470 |
iContainer->SetRect(ClientRect()); |
|
471 |
} |
|
472 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
473 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
474 |
//============================================================================= |
12 | 475 |
EXPORT_C void CImageEditorUIView::SetImageL(CFbsBitmap * aBitmap) |
476 |
{ |
|
477 |
iPreview = aBitmap; |
|
478 |
if (iContainer) |
|
479 |
{ |
|
480 |
iContainer->SetImageL(aBitmap); |
|
481 |
} |
|
482 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
483 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
484 |
//============================================================================= |
12 | 485 |
EXPORT_C void CImageEditorUIView::SetImageFileName(const TDesC& aFileName) |
486 |
{ |
|
487 |
iImageFileName.Copy(aFileName); |
|
488 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
489 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
490 |
//============================================================================= |
12 | 491 |
EXPORT_C CCoeControl * CImageEditorUIView::GetContainer() const |
492 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
493 |
return iContainer; |
12 | 494 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
495 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
496 |
//============================================================================= |
12 | 497 |
EXPORT_C void CImageEditorUIView::ActivatePluginL(CCoeControl * aControl) |
498 |
{ |
|
499 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin"); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
500 |
|
12 | 501 |
// Activate the plugin based on UI type |
502 |
switch (iArray[iIndex]->PluginUiType()) |
|
503 |
{ |
|
504 |
case 1: // EPluginUiTypeNone |
|
505 |
{ |
|
506 |
// For non-UI plug-ins active main view and render |
|
507 |
iInPlugin = EFalse; |
|
508 |
ActivateMainViewL(); |
|
509 |
HandleCommandL(EImageEditorCmdRender); |
|
510 |
break; |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
511 |
|
12 | 512 |
} |
513 |
case 2: // EPluginUiTypeSingleParam |
|
514 |
case 3: // EPluginUiTypeMultiParam |
|
515 |
case 4: // EPluginUiTypeCustomized |
|
516 |
{ |
|
517 |
iInPlugin = ETrue; |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
518 |
|
12 | 519 |
// Set control |
520 |
iControl = aControl; |
|
521 |
if (iContainer) |
|
522 |
{ |
|
523 |
iContainer->SetControl(iControl); |
|
524 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
525 |
|
12 | 526 |
// Set plug-in item |
527 |
if (iControl) |
|
528 |
{ |
|
529 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin: calling SetSelectedUiItemL"); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
530 |
|
12 | 531 |
((CImageEditorControlBase *) iControl)->SetSelectedUiItemL( iArray[iIndex]); |
532 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
533 |
|
12 | 534 |
// Prepare the plug-in item |
535 |
if (iControl) |
|
536 |
{ |
|
537 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Activating plugin: calling "); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
538 |
|
12 | 539 |
((CImageEditorControlBase *) iControl)->PrepareL(); |
540 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
541 |
|
12 | 542 |
// Update soft keys |
543 |
UpdateSoftkeysL(); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
544 |
|
12 | 545 |
// Update navigation pane |
546 |
UpdateNaviPaneL(); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
547 |
|
12 | 548 |
break; |
549 |
} |
|
550 |
default: |
|
551 |
{ |
|
552 |
iInPlugin = ETrue; |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
553 |
|
12 | 554 |
// Set control |
555 |
iControl = aControl; |
|
556 |
if (iContainer) |
|
557 |
{ |
|
558 |
iContainer->SetControl(iControl); |
|
559 |
} |
|
560 |
break; |
|
561 |
} |
|
562 |
} |
|
563 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
564 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
565 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
566 |
EXPORT_C void CImageEditorUIView::ActivateMainViewL() |
12 | 567 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
568 |
|
12 | 569 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Activating main view"); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
570 |
|
12 | 571 |
iInPlugin = EFalse; |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
572 |
|
12 | 573 |
// Reset buttons |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
574 |
iSoftkey1 = EAknSoftkeyOptions; |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
575 |
iSoftkey2 = EAknSoftkeyBack; |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
576 |
iMSK = EImageEditorMenuCmdApplyEffect; |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
577 |
|
12 | 578 |
if (InZoomingState()) |
579 |
{ |
|
580 |
if (iZoomMode == (ENumOfZooms - 1)) |
|
581 |
{ |
|
582 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL); |
|
583 |
} |
|
584 |
else |
|
585 |
{ |
|
586 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN); |
|
587 |
} |
|
588 |
} |
|
589 |
else |
|
590 |
{ |
|
591 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY); |
|
592 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
593 |
|
12 | 594 |
// Reset navi pane |
595 |
ClearNaviPaneTextL(); |
|
596 |
||
597 |
// Set control in container to NULL |
|
598 |
iControl = 0; |
|
599 |
if (iContainer) |
|
600 |
{ |
|
601 |
iContainer->SetControl(iControl); |
|
602 |
} |
|
603 |
||
604 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
605 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
606 |
//============================================================================= |
12 | 607 |
EXPORT_C CPluginInfo * CImageEditorUIView::GetSelectedPluginInfoL() |
608 |
{ |
|
609 |
TInt selectedItem; |
|
610 |
TInt dialog_ok = CPluginSelectionDialog::RunDlgLD(&iPreview, selectedItem, |
|
611 |
&iArray, ClientRect()); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
612 |
|
12 | 613 |
if (dialog_ok && selectedItem != KErrCancel) |
614 |
{ |
|
615 |
iIndex = selectedItem; |
|
616 |
return iArray[selectedItem]; |
|
617 |
} |
|
618 |
else |
|
619 |
{ |
|
620 |
if (InZoomingState()) |
|
621 |
{ |
|
622 |
if (iZoomMode == (ENumOfZooms - 1)) |
|
623 |
{ |
|
624 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL); |
|
625 |
} |
|
626 |
else |
|
627 |
{ |
|
628 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN); |
|
629 |
} |
|
630 |
} |
|
631 |
else |
|
632 |
{ |
|
633 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY); |
|
634 |
} |
|
635 |
return NULL; |
|
636 |
} |
|
637 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
638 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
639 |
//============================================================================= |
12 | 640 |
EXPORT_C void CImageEditorUIView::AddPluginUiItemL( |
641 |
const CPluginInfo * aPluginInfo) |
|
642 |
{ |
|
643 |
TLinearOrder<CPluginInfo> order(CPluginInfo::ComparePluginOrder); |
|
644 |
iArray.InsertInOrder(aPluginInfo, order); |
|
645 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
646 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
647 |
//============================================================================= |
12 | 648 |
EXPORT_C void CImageEditorUIView::SetCustomButtonsL(TInt aResourceID) const |
649 |
{ |
|
650 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Setting buttons"); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
651 |
|
12 | 652 |
CEikButtonGroupContainer* cba = Cba(); |
653 |
__ASSERT_ALWAYS( cba, User::Panic(KComponentName, EImageEditorPanicCbaNotAccessible) ); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
654 |
|
12 | 655 |
cba->SetCommandSetL(aResourceID); |
656 |
cba->DrawDeferred(); |
|
657 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
658 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
659 |
//============================================================================= |
12 | 660 |
EXPORT_C TInt CImageEditorUIView::LaunchSaveChangesQueryL() const |
661 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
662 |
// Create dialog prompt |
12 | 663 |
HBufC * prompt = iEikonEnv->AllocReadResourceLC( |
664 |
R_LIST_QUERY_SAVE_CONFIRMATION); |
|
665 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
666 |
// Execute query dialog |
12 | 667 |
TInt ret = SDrawUtils::LaunchQueryDialogL(*prompt); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
668 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
669 |
CleanupStack::PopAndDestroy(); // prompt |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
670 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
671 |
return ret; |
12 | 672 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
673 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
674 |
//============================================================================= |
12 | 675 |
EXPORT_C TInt CImageEditorUIView::LaunchExitWithoutSavingQueryL() const |
676 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
677 |
// Create dialog prompt |
12 | 678 |
HBufC * prompt = iEikonEnv->AllocReadResourceLC( |
679 |
R_LIST_QUERY_EXIT_WITHOUT_SAVING_CONFIRMATION); |
|
680 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
681 |
// Execute query dialog |
12 | 682 |
TInt ret = SDrawUtils::LaunchQueryDialogL(*prompt); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
683 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
684 |
CleanupStack::PopAndDestroy(); // prompt |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
685 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
686 |
return ret; |
12 | 687 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
688 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
689 |
//============================================================================= |
12 | 690 |
EXPORT_C TInt CImageEditorUIView::LaunchCancelTextInputQueryL() const |
691 |
{ |
|
692 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
693 |
// Create dialog prompt |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
694 |
// At the moment query is not in use and corresponding string is removed |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
695 |
// from the loc file. To enable this, a new string has to be defined. |
12 | 696 |
HBufC * prompt = iEikonEnv->AllocReadResourceLC( |
697 |
R_LIST_QUERY_CANCEL_TEXT_INPUT); |
|
698 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
699 |
// Execute query dialog |
12 | 700 |
TInt ret = SDrawUtils::LaunchQueryDialogOkOnlyL(*prompt); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
701 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
702 |
CleanupStack::PopAndDestroy(); // save_conf, prompt |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
703 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
704 |
return ret; |
12 | 705 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
706 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
707 |
//============================================================================= |
12 | 708 |
EXPORT_C void CImageEditorUIView::LaunchSendQueryL( |
709 |
const TSendingCapabilities& aCaps, TFileName& aFileName) const |
|
710 |
{ |
|
711 |
if (iSendAppUi) |
|
712 |
{ |
|
713 |
CMessageData* msgData = CMessageData::NewLC(); |
|
714 |
msgData->AppendAttachmentL(aFileName); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
715 |
|
12 | 716 |
iSendAppUi->ShowQueryAndSendL(msgData, aCaps); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
717 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
718 |
CleanupStack::PopAndDestroy(msgData); |
12 | 719 |
} |
720 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
721 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
722 |
//============================================================================= |
12 | 723 |
EXPORT_C void CImageEditorUIView::LaunchSendQueryL( |
724 |
const TSendingCapabilities& aCaps, RFile& aFileHandle) const |
|
725 |
{ |
|
726 |
if (iSendAppUi) |
|
727 |
{ |
|
728 |
CMessageData* msgData = CMessageData::NewLC(); |
|
729 |
msgData->AppendAttachmentHandleL(aFileHandle); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
730 |
|
12 | 731 |
iSendAppUi->ShowQueryAndSendL(msgData, aCaps); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
732 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
733 |
CleanupStack::PopAndDestroy(msgData); |
12 | 734 |
} |
735 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
736 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
737 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
738 |
EXPORT_C void CImageEditorUIView::LaunchSaveWaitDialogL( |
12 | 739 |
CAknProgressDialog** aSelfPtr, TInt aFinalValue, |
740 |
MProgressDialogCallback* aCallback) const |
|
741 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
742 |
// Create dialog prompt |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
743 |
HBufC * prompt; |
12 | 744 |
|
745 |
TApaAppCaption caption; |
|
746 |
TRAPD( err, ResolveCaptionNameL( caption ) ); |
|
747 |
||
748 |
// If something goes wrong, show basic "Saving" note |
|
749 |
if (err) |
|
750 |
{ |
|
751 |
prompt = iEikonEnv->AllocReadResourceLC(R_WAIT_NOTE_SAVING); |
|
752 |
} |
|
753 |
else |
|
754 |
{ |
|
755 |
prompt = StringLoader::LoadLC(R_WAIT_NOTE_SAVING_TO, caption); |
|
756 |
} |
|
757 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
758 |
// Launch wait dialog with Cancel softkey |
12 | 759 |
SDrawUtils::LaunchProgressNoteL(aSelfPtr, R_PROGRESS_DIALOG, *prompt, |
760 |
aFinalValue, aCallback); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
761 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
762 |
CleanupStack::PopAndDestroy(); // prompt |
12 | 763 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
764 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
765 |
//============================================================================= |
12 | 766 |
void CImageEditorUIView::ResolveCaptionNameL(TApaAppCaption& aCaption) const |
767 |
{ |
|
768 |
RApaLsSession appArcSession; |
|
769 |
CleanupClosePushL(appArcSession); |
|
770 |
User::LeaveIfError(appArcSession.Connect()); |
|
771 |
||
772 |
// Get Media Gallery caption |
|
773 |
TApaAppInfo appInfo; |
|
774 |
User::LeaveIfError(appArcSession.GetAppInfo(appInfo, TUid::Uid( |
|
775 |
KMediaGalleryUID3))); |
|
776 |
||
777 |
aCaption = appInfo.iCaption; |
|
778 |
||
779 |
CleanupStack::PopAndDestroy(&appArcSession); |
|
780 |
} |
|
781 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
782 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
783 |
EXPORT_C void CImageEditorUIView::LaunchLoadWaitDialogL( |
12 | 784 |
CAknWaitDialog** aSelfPtr, MProgressDialogCallback* aCallback) const |
785 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
786 |
// Create dialog prompt |
12 | 787 |
HBufC * prompt = iEikonEnv->AllocReadResourceLC(R_WAIT_NOTE_LOADING); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
788 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
789 |
// Launch wait dialog with empty softkeys |
12 | 790 |
SDrawUtils::LaunchWaitNoteL(aSelfPtr, R_WAIT_DIALOG, *prompt, aCallback); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
791 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
792 |
CleanupStack::PopAndDestroy(); // prompt |
12 | 793 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
794 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
795 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
796 |
EXPORT_C void CImageEditorUIView::LaunchWaitDialog() const |
12 | 797 |
{ |
798 |
// Show empty set of cba buttons while animation on the screen |
|
799 |
SetCustomButtonsL(R_AVKON_SOFTKEYS_EMPTY); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
800 |
iContainer->ShowWaitNote(); |
12 | 801 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
802 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
803 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
804 |
EXPORT_C void CImageEditorUIView::HideWaitDialog() const |
12 | 805 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
806 |
iContainer->HideWaitNote(); |
12 | 807 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
808 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
809 |
//============================================================================= |
12 | 810 |
EXPORT_C void CImageEditorUIView::ShowInformationNoteL(const TDesC& aNoteText) const |
811 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
812 |
|
12 | 813 |
CAknGlobalNote * globalnote = CAknGlobalNote::NewLC(); |
814 |
globalnote->ShowNoteL(EAknGlobalInformationNote, aNoteText); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
815 |
|
12 | 816 |
CleanupStack::PopAndDestroy(); // globalnote |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
817 |
|
12 | 818 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
819 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
820 |
//============================================================================= |
12 | 821 |
EXPORT_C void CImageEditorUIView::ShowConfirmationNoteL(const TDesC& aNoteText) const |
822 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
823 |
|
12 | 824 |
CAknGlobalNote * globalnote = CAknGlobalNote::NewLC(); |
825 |
globalnote->ShowNoteL(EAknGlobalConfirmationNote, aNoteText); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
826 |
|
12 | 827 |
CleanupStack::PopAndDestroy(); // globalnote |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
828 |
|
12 | 829 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
830 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
831 |
//============================================================================= |
12 | 832 |
EXPORT_C void CImageEditorUIView::SetNaviPaneTextL(const TDesC & aText, |
833 |
TBool aLeftNaviPaneScrollButtonVisibile, |
|
834 |
TBool aRightNaviPaneScrollButtonVisible) |
|
835 |
{ |
|
836 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Setting navi pane text"); |
|
837 |
||
838 |
if (iNaviPane) |
|
839 |
{ |
|
840 |
// Create a new decorator |
|
841 |
CAknNavigationDecorator* newNaviDecorator = |
|
842 |
iNaviPane->CreateNavigationLabelL(aText); |
|
843 |
CleanupStack::PushL(newNaviDecorator); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
844 |
|
12 | 845 |
// Set the navi scroll indicators for the new decorator |
846 |
newNaviDecorator->SetScrollButtonDimmed( |
|
847 |
CAknNavigationDecorator::ELeftButton, |
|
848 |
!aLeftNaviPaneScrollButtonVisibile); |
|
849 |
newNaviDecorator->SetScrollButtonDimmed( |
|
850 |
CAknNavigationDecorator::ERightButton, |
|
851 |
!aRightNaviPaneScrollButtonVisible); |
|
852 |
if (aLeftNaviPaneScrollButtonVisibile |
|
853 |
|| aRightNaviPaneScrollButtonVisible) |
|
854 |
{ |
|
855 |
newNaviDecorator->MakeScrollButtonVisible(ETrue); |
|
856 |
} |
|
857 |
||
858 |
// Set new decorator on top of Navi Pane's decorator stack |
|
859 |
// (topmost decorator is the one to show) |
|
860 |
iNaviPane->PushL(*newNaviDecorator); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
861 |
|
12 | 862 |
// remove old "previous decorator" from decorator stack and delete it |
863 |
if (iPreviousNaviDecorator) |
|
864 |
{ |
|
865 |
iNaviPane->Pop(iPreviousNaviDecorator); |
|
866 |
delete iPreviousNaviDecorator; |
|
867 |
iPreviousNaviDecorator = NULL; |
|
868 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
869 |
|
12 | 870 |
// update decorator pointers to new ones |
871 |
iPreviousNaviDecorator = iNaviDecorator; |
|
872 |
iNaviDecorator = newNaviDecorator; |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
873 |
|
12 | 874 |
// set observer for the currently shown decorator |
875 |
(iNaviPane->Top())->SetNaviDecoratorObserver(iContainer); |
|
876 |
||
877 |
CleanupStack::Pop(newNaviDecorator); |
|
878 |
} |
|
879 |
||
880 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
881 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
882 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
883 |
EXPORT_C void CImageEditorUIView::ClearNaviPaneTextL() |
12 | 884 |
{ |
885 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Clearing navi pane text"); |
|
886 |
if (iNaviPane) |
|
887 |
{ |
|
888 |
if (iNaviDecorator) |
|
889 |
{ |
|
890 |
iNaviPane->Pop(iNaviDecorator); |
|
891 |
delete iNaviDecorator; |
|
892 |
iNaviDecorator = 0; |
|
893 |
} |
|
894 |
||
895 |
if (iPreviousNaviDecorator) |
|
896 |
{ |
|
897 |
iNaviPane->Pop(iPreviousNaviDecorator); |
|
898 |
delete iPreviousNaviDecorator; |
|
899 |
iPreviousNaviDecorator = 0; |
|
900 |
} |
|
901 |
HBufC * title = iEikonEnv->AllocReadResourceLC(R_MAIN_VIEW_TITLE); |
|
902 |
iNaviDecorator = iNaviPane->CreateNavigationLabelL(title->Des()); |
|
903 |
iPreviousNaviDecorator |
|
904 |
= iNaviPane->CreateNavigationLabelL(title->Des()); |
|
905 |
||
906 |
iNaviPane->PushL(*iPreviousNaviDecorator); |
|
907 |
iNaviPane->PushL(*iNaviDecorator); |
|
908 |
iNaviPane->DrawDeferred(); |
|
909 |
iNaviDecorator->DrawDeferred(); |
|
910 |
CleanupStack::PopAndDestroy(); // title |
|
911 |
} |
|
912 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
913 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
914 |
//============================================================================= |
12 | 915 |
EXPORT_C void CImageEditorUIView::SetTitlePaneTextL(const TDesC & aText) |
916 |
{ |
|
917 |
iTitlePane->SetTextL(aText); |
|
918 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
919 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
920 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
921 |
EXPORT_C void CImageEditorUIView::ClearTitlePaneTextL() |
12 | 922 |
{ |
923 |
iTitlePane->SetTextL(KNullDesC); |
|
924 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
925 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
926 |
//============================================================================= |
12 | 927 |
EXPORT_C void CImageEditorUIView::SetSoftKey1L(const TDesC & aText, |
928 |
const TInt aCommand) |
|
929 |
{ |
|
930 |
CEikButtonGroupContainer * cba = Cba(); |
|
931 |
// TInt replace_position = cba->PositionById (iSoftkey1); |
|
932 |
TInt replace_position(CEikButtonGroupContainer::ELeftSoftkeyPosition); |
|
933 |
cba->SetCommandL(replace_position, aCommand, aText); |
|
934 |
cba->DrawDeferred(); |
|
935 |
iSoftkey1 = aCommand; |
|
936 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
937 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
938 |
//============================================================================= |
12 | 939 |
EXPORT_C void CImageEditorUIView::SetSoftKey2L(const TDesC & aText, |
940 |
const TInt aCommand) |
|
941 |
{ |
|
942 |
CEikButtonGroupContainer * cba = Cba(); |
|
943 |
//TInt replace_position = cba->PositionById (iSoftkey2); |
|
944 |
TInt replace_position(CEikButtonGroupContainer::ERightSoftkeyPosition); |
|
945 |
cba->SetCommandL(replace_position, aCommand, aText); |
|
946 |
cba->DrawDeferred(); |
|
947 |
iSoftkey2 = aCommand; |
|
948 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
949 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
950 |
//============================================================================= |
12 | 951 |
EXPORT_C void CImageEditorUIView::SetMiddleSoftKeyL(const TDesC & aText, |
952 |
const TInt aCommand) |
|
953 |
{ |
|
954 |
CEikButtonGroupContainer * cba = Cba(); |
|
955 |
||
956 |
if (aCommand == EAknSoftkeyContextOptions) |
|
957 |
{ |
|
958 |
TInt |
|
959 |
contextMenuId = |
|
960 |
((CImageEditorControlBase *) iControl)->GetContextMenuResourceId(); |
|
961 |
if (contextMenuId) |
|
962 |
{ |
|
963 |
//if in doodle don't show select dialog. |
|
964 |
if (contextMenuId != R_TEXT_CONTEXT_MENUBAR) |
|
965 |
{ |
|
966 |
MenuBar()->SetContextMenuTitleResourceId(contextMenuId); |
|
967 |
} |
|
968 |
} |
|
969 |
} |
|
970 |
||
971 |
TInt replace_position(CEikButtonGroupContainer::EMiddleSoftkeyPosition); |
|
972 |
cba->SetCommandL(replace_position, aCommand, aText); |
|
973 |
cba->DrawDeferred(); |
|
974 |
iMSK = aCommand; |
|
975 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
976 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
977 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
978 |
EXPORT_C void CImageEditorUIView::SetBusy() |
12 | 979 |
{ |
980 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
981 |
if (iContainer) |
12 | 982 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
983 |
iContainer->SetBusy(); |
12 | 984 |
} |
985 |
||
986 |
iBusy = ETrue; |
|
987 |
RemoveContainerFromStack(); |
|
988 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
989 |
} |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
990 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
991 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
992 |
EXPORT_C void CImageEditorUIView::ResetBusy() |
12 | 993 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
994 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
995 |
AddContainerToStack(); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
996 |
iBusy = EFalse; |
12 | 997 |
|
998 |
if (iContainer) |
|
999 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1000 |
iContainer->ResetBusy(); |
12 | 1001 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1002 |
} |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1003 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1004 |
//============================================================================= |
12 | 1005 |
EXPORT_C void CImageEditorUIView::SetUndoFlag(const TBool aUndo) |
1006 |
{ |
|
1007 |
iCanUndo = aUndo; |
|
1008 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1009 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1010 |
//============================================================================= |
12 | 1011 |
EXPORT_C void CImageEditorUIView::SetSaveFlag(const TBool aSave) |
1012 |
{ |
|
1013 |
iCanSave = aSave; |
|
1014 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1015 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1016 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1017 |
EXPORT_C void CImageEditorUIView::SetFullScreen() |
12 | 1018 |
{ |
1019 |
if (iContainer) |
|
1020 |
{ |
|
1021 |
iContainer->SetFullScreen(); |
|
1022 |
} |
|
1023 |
iFullScreen = ETrue; |
|
1024 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1025 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1026 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1027 |
EXPORT_C void CImageEditorUIView::ResetFullScreen() |
12 | 1028 |
{ |
1029 |
if (iContainer) |
|
1030 |
{ |
|
1031 |
iContainer->ResetFullScreen(); |
|
1032 |
} |
|
1033 |
iFullScreen = EFalse; |
|
1034 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1035 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1036 |
//============================================================================= |
12 | 1037 |
EXPORT_C void CImageEditorUIView::SetZoomModeL(const TZoomMode& aMode) |
1038 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1039 |
iZoomMode = aMode; |
12 | 1040 |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1041 |
HandleZoomModeChangeL(); |
12 | 1042 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1043 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1044 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1045 |
void CImageEditorUIView::HandleZoomModeChangeL() |
12 | 1046 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1047 |
|
12 | 1048 |
if (!iInPlugin && iZoomMode != EZoomNormal) |
1049 |
{ |
|
1050 |
if (iZoomMode != (ENumOfZooms - 1)) |
|
1051 |
{ |
|
1052 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL_ZOOMIN); |
|
1053 |
} |
|
1054 |
else |
|
1055 |
{ |
|
1056 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_CANCEL); |
|
1057 |
} |
|
1058 |
} |
|
1059 |
else if (!iInPlugin && iZoomMode == EZoomNormal) |
|
1060 |
{ |
|
1061 |
||
1062 |
SetCustomButtonsL(R_IMAGEEDITORUI_SK_OPTIONS_BACK_APPLY); |
|
1063 |
} |
|
1064 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1065 |
// hide previous tooltip |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1066 |
iPopupController->HideInfoPopupNote(); |
12 | 1067 |
|
1068 |
// show tooltip (also if in plugin) |
|
1069 |
if (iZoomMode != EZoomNormal) |
|
1070 |
{ |
|
1071 |
||
1072 |
SDrawUtils::ShowToolTip(iPopupController, (CCoeControl*) iContainer, |
|
1073 |
TPoint(iContainer->Rect().iTl.iX, iContainer->Rect().iTl.iY), |
|
1074 |
EHRightVTop, iZoomTexts->MdcaPoint(iZoomMode)); |
|
1075 |
} |
|
1076 |
||
1077 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1078 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1079 |
//============================================================================= |
12 | 1080 |
EXPORT_C void CImageEditorUIView::DynInitMenuPaneL(TInt aResourceId, |
1081 |
CEikMenuPane * aMenuPane) |
|
1082 |
{ |
|
1083 |
// This is called by the framework, aMenuPane should never be null pointer... |
|
1084 |
__ASSERT_ALWAYS( aMenuPane, User::Panic(KComponentName, EImageEditorPanicMenuNotAccessible) ); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1085 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1086 |
#ifdef AIW_PRINT_PROVIDER_USED |
12 | 1087 |
if (iServiceHandler->HandleSubmenuL(*aMenuPane)) |
1088 |
{ |
|
1089 |
// Return if AIW submenu |
|
1090 |
return; |
|
1091 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1092 |
#endif |
12 | 1093 |
|
1094 |
if (aResourceId != R_IMAGEEDITORUI_MENUPANE) |
|
1095 |
{ |
|
1096 |
return; |
|
1097 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1098 |
|
12 | 1099 |
// In busy mode |
1100 |
if (iBusy) |
|
1101 |
{ |
|
1102 |
DimAllL(aResourceId, *aMenuPane); |
|
1103 |
} |
|
1104 |
// In idle mode |
|
1105 |
else |
|
1106 |
{ |
|
1107 |
// In plug-in mode |
|
1108 |
if (iInPlugin) |
|
1109 |
{ |
|
1110 |
DimAllL(aResourceId, *aMenuPane); |
|
1111 |
InsertPluginItemsL(*aMenuPane); |
|
1112 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1113 |
#ifdef FULLSCREEN_AVAILABLE |
12 | 1114 |
// After plugin specific items, add menu commands that are common |
1115 |
// for all plugins' options menus |
|
1116 |
// In normal screen mode |
|
1117 |
if ( !iFullScreen ) |
|
1118 |
{ |
|
1119 |
aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, EFalse ); |
|
1120 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1121 |
|
12 | 1122 |
// In full screen mode |
1123 |
||
1124 |
else |
|
1125 |
{ |
|
1126 |
aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, EFalse ); |
|
1127 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1128 |
#endif // FULLSCREEN_AVAILABLE |
12 | 1129 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdHelp, EFalse); |
1130 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdExit, EFalse); |
|
1131 |
} |
|
1132 |
else if (InZoomingState()) |
|
1133 |
{ |
|
1134 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdUndo, ETrue); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1135 |
#ifdef FULLSCREEN_AVAILABLE |
12 | 1136 |
aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, ETrue ); |
1137 |
aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, ETrue ); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1138 |
#endif // FULLSCREEN_AVAILABLE |
12 | 1139 |
if (!iCanSave || IsMemoryInCriticalLevel()) |
1140 |
{ |
|
1141 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdSave, ETrue); |
|
1142 |
} |
|
1143 |
||
1144 |
TInt position; |
|
1145 |
if (aMenuPane->MenuItemExists(EImageEditorMenuCmdSend, position)) |
|
1146 |
{ |
|
1147 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdSend, ETrue); |
|
1148 |
} |
|
1149 |
if (aMenuPane->MenuItemExists(EImageEditorAiwCriteriaPrint,position)) |
|
1150 |
{ |
|
1151 |
aMenuPane->SetItemDimmed(EImageEditorAiwCriteriaPrint, ETrue); |
|
1152 |
} |
|
1153 |
||
1154 |
if (iZoomMode == EZoomIn3) |
|
1155 |
{ |
|
1156 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdZoomIn, ETrue); |
|
1157 |
} |
|
1158 |
// Set "Apply Effect" item to be after "Zoom Out" in zooming |
|
1159 |
// state's options menu |
|
1160 |
if (aMenuPane->MenuItemExists(EImageEditorMenuCmdApplyEffect,position)) |
|
1161 |
{ |
|
1162 |
CEikMenuPaneItem::SData data = aMenuPane->ItemData( |
|
1163 |
EImageEditorMenuCmdApplyEffect); |
|
1164 |
aMenuPane->DeleteMenuItem(EImageEditorMenuCmdApplyEffect); |
|
1165 |
aMenuPane->AddMenuItemL(data, EImageEditorMenuCmdZoomOut); |
|
1166 |
} |
|
1167 |
} |
|
1168 |
// In main view mode |
|
1169 |
else |
|
1170 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1171 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1172 |
#ifdef AIW_PRINT_PROVIDER_USED |
12 | 1173 |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1174 |
#else |
12 | 1175 |
aMenuPane->SetItemDimmed( EImageEditorAiwCriteriaPrint, ETrue ); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1176 |
#endif |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1177 |
|
12 | 1178 |
// Display CSendUi menu item |
1179 |
if (iSendAppUi) |
|
1180 |
{ |
|
1181 |
iSendAppUi->AddSendMenuItemL(*aMenuPane, |
|
1182 |
SIE_SENDUI_MENU_ITEM_INDEX, EImageEditorMenuCmdSend, |
|
1183 |
TSendingCapabilities(0, 0, |
|
1184 |
TSendingCapabilities::ESupportsAttachments)); |
|
1185 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1186 |
|
12 | 1187 |
// Nothing to undo |
1188 |
if (!iCanUndo) |
|
1189 |
{ |
|
1190 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdUndo, ETrue); |
|
1191 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1192 |
#ifdef FULLSCREEN_AVAILABLE |
12 | 1193 |
// In full screen mode |
1194 |
if ( iFullScreen ) |
|
1195 |
{ |
|
1196 |
aMenuPane->SetItemDimmed( EImageEditorMenuCmdFullScreen, ETrue ); |
|
1197 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1198 |
|
12 | 1199 |
// In normal screen mode |
1200 |
||
1201 |
else |
|
1202 |
{ |
|
1203 |
aMenuPane->SetItemDimmed( EImageEditorMenuCmdNormalScreen, ETrue ); |
|
1204 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1205 |
#endif // FULLSCREEN_AVAILABLE |
12 | 1206 |
if (!iCanSave || IsMemoryInCriticalLevel()) |
1207 |
{ |
|
1208 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdSave, ETrue); |
|
1209 |
} |
|
1210 |
||
1211 |
if (iZoomMode == EZoomNormal) |
|
1212 |
{ |
|
1213 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdZoomOut, ETrue); |
|
1214 |
aMenuPane->SetItemDimmed(EImageEditorMenuCmdFitToScreen, ETrue); |
|
1215 |
} |
|
1216 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1217 |
#ifdef AIW_PRINT_PROVIDER_USED |
12 | 1218 |
if (iServiceHandler->IsAiwMenu(aResourceId)) |
1219 |
{ |
|
1220 |
CAiwGenericParamList& in = iServiceHandler->InParamListL(); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1221 |
|
12 | 1222 |
TFileName filename(iImageFileName); |
1223 |
TAiwVariant variant(filename); |
|
1224 |
TAiwGenericParam param(EGenericParamFile, variant); |
|
1225 |
||
1226 |
in.AppendL(param); |
|
1227 |
||
1228 |
iServiceHandler->InitializeMenuPaneL(*aMenuPane, aResourceId, |
|
1229 |
EImageEditorMenuAiwPrintBase, in); |
|
1230 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1231 |
#endif |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1232 |
|
12 | 1233 |
} |
1234 |
} |
|
1235 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1236 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1237 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1238 |
EXPORT_C void CImageEditorUIView::SetSendAppUi(CSendUi* aSendAppUi) |
12 | 1239 |
{ |
1240 |
iSendAppUi = aSendAppUi; |
|
1241 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1242 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1243 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1244 |
EXPORT_C void CImageEditorUIView::HandleStatusPaneSizeChange() |
12 | 1245 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1246 |
|
12 | 1247 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1248 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1249 |
//============================================================================= |
12 | 1250 |
void CImageEditorUIView::DimAllL(TInt /*aResourceId*/, CEikMenuPane & aMenuPane) const |
1251 |
{ |
|
1252 |
LOG(KImageEditorLogFile, "CImageEditorUIView::DimAllL"); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1253 |
|
12 | 1254 |
aMenuPane.SetItemDimmed(EImageEditorMenuCmdApplyEffect, ETrue); |
1255 |
aMenuPane.SetItemDimmed(EImageEditorMenuCmdExit, ETrue); |
|
1256 |
aMenuPane.SetItemDimmed(EImageEditorMenuCmdUndo, ETrue); |
|
1257 |
#ifdef FULLSCREEN_AVAILABLE |
|
1258 |
aMenuPane.SetItemDimmed (EImageEditorMenuCmdFullScreen, ETrue); |
|
1259 |
aMenuPane.SetItemDimmed (EImageEditorMenuCmdNormalScreen, ETrue); |
|
1260 |
#endif // FULLSCREEN_AVAILABLE |
|
1261 |
aMenuPane.SetItemDimmed(EImageEditorMenuCmdZoomIn, ETrue); |
|
1262 |
aMenuPane.SetItemDimmed(EImageEditorMenuCmdZoomOut, ETrue); |
|
1263 |
aMenuPane.SetItemDimmed(EImageEditorMenuCmdSave, ETrue); |
|
1264 |
aMenuPane.SetItemDimmed(EImageEditorAiwCriteriaPrint, ETrue); |
|
1265 |
aMenuPane.SetItemDimmed(EImageEditorMenuCmdHelp, ETrue); |
|
1266 |
aMenuPane.SetItemDimmed(EImageEditorMenuCmdFitToScreen, ETrue); |
|
1267 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1268 |
|
12 | 1269 |
//============================================================================= |
1270 |
void CImageEditorUIView::UpdateSoftkeysL() |
|
1271 |
{ |
|
1272 |
__ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) ); |
|
1273 |
||
1274 |
// Get plug-in info |
|
1275 |
CPluginInfo * pgn_info = iArray[iIndex]; |
|
1276 |
||
1277 |
// Get soft key pair index |
|
1278 |
TInt sk_index = ((CImageEditorControlBase *) iControl)->GetSoftkeyIndexL(); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1279 |
|
12 | 1280 |
// Set soft key 1 |
1281 |
SetSoftKey1L(pgn_info->Sk1Texts()[sk_index], pgn_info->Sk1Cmds()[sk_index]); |
|
1282 |
||
1283 |
// Set soft key 2 |
|
1284 |
SetSoftKey2L(pgn_info->Sk2Texts()[sk_index], pgn_info->Sk2Cmds()[sk_index]); |
|
1285 |
||
1286 |
// Set middle soft key |
|
1287 |
SetMiddleSoftKeyL(pgn_info->MSKTexts()[sk_index], |
|
1288 |
pgn_info->MSKCmds()[sk_index]); |
|
1289 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1290 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1291 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1292 |
void CImageEditorUIView::UpdateNaviPaneL() |
12 | 1293 |
{ |
1294 |
__ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) ); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1295 |
|
12 | 1296 |
TBool leftNaviPaneScrollButtonVisibile; |
1297 |
TBool rightNaviPaneScrollButtonVisible; |
|
1298 |
TPtrC naviText = ((CImageEditorControlBase *) iControl)->GetNaviPaneTextL( |
|
1299 |
leftNaviPaneScrollButtonVisibile, rightNaviPaneScrollButtonVisible); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1300 |
|
12 | 1301 |
SetNaviPaneTextL(naviText, leftNaviPaneScrollButtonVisibile, |
1302 |
rightNaviPaneScrollButtonVisible); |
|
1303 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1304 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1305 |
//============================================================================= |
12 | 1306 |
void CImageEditorUIView::InsertPluginItemsL(CEikMenuPane & aMenuPane) |
1307 |
{ |
|
1308 |
__ASSERT_ALWAYS( iControl, User::Panic(KComponentName, EImageEditorPanicControlIsNull) ); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1309 |
|
12 | 1310 |
// Insert the plug-in commands |
1311 |
CMenuItemArray & menu_items = iArray[iIndex]->MenuItems(); |
|
1312 |
TBitField dimmed = |
|
1313 |
((CImageEditorControlBase *) iControl)->GetDimmedMenuItems(); |
|
1314 |
for (TInt i = 0; i < menu_items.Count(); ++i) |
|
1315 |
{ |
|
1316 |
// Check the visibility for each menu item. |
|
1317 |
if (!dimmed.GetBit(i)) |
|
1318 |
{ |
|
1319 |
aMenuPane.InsertMenuItemL(menu_items[i], i); |
|
1320 |
} |
|
1321 |
} |
|
1322 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1323 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1324 |
//============================================================================= |
12 | 1325 |
TBool CImageEditorUIView::MenuItemPressedL(TInt aCommand) |
1326 |
{ |
|
1327 |
CMenuItemArray & menu_items = iArray[iIndex]->MenuItems(); |
|
1328 |
for (TInt i = 0; i < menu_items.Count(); ++i) |
|
1329 |
{ |
|
1330 |
if (menu_items[i].iCommandId == aCommand) |
|
1331 |
{ |
|
1332 |
return ETrue; |
|
1333 |
} |
|
1334 |
} |
|
1335 |
return EFalse; |
|
1336 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1337 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1338 |
//============================================================================= |
12 | 1339 |
EXPORT_C void CImageEditorUIView::DoActivateL( |
1340 |
const TVwsViewId & /*aPrevViewId*/, TUid /*aCustomMessageId*/, |
|
1341 |
const TDesC8 & /*aCustomMessage*/ |
|
1342 |
) |
|
1343 |
{ |
|
1344 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Activating view"); |
|
1345 |
// Construct container |
|
1346 |
iContainer = new (ELeave) CImageEditorUIContainer; |
|
1347 |
iContainer->SetMopParent(this); |
|
1348 |
iContainer->ConstructL(ClientRect()); |
|
1349 |
iContainer->SetView(this); |
|
1350 |
HandleCommandL(EImageEditorCmdViewReady); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1351 |
|
12 | 1352 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1353 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1354 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1355 |
EXPORT_C void CImageEditorUIView::DoDeactivate() |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1356 |
{ |
12 | 1357 |
LOG(KImageEditorLogFile, "CImageEditorUIView: Deactivating view"); |
1358 |
||
1359 |
RemoveContainerFromStack(); |
|
1360 |
||
1361 |
if (iContainer) |
|
1362 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1363 |
delete iContainer; |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1364 |
iContainer = 0; |
12 | 1365 |
} |
1366 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1367 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1368 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1369 |
void CImageEditorUIView::AddContainerToStack() |
12 | 1370 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1371 |
if (!iContainerInStack && iContainer) |
12 | 1372 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1373 |
TRAPD(err, AppUi()->AddToViewStackL (*this, iContainer); ); |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1374 |
if (err == KErrNone) |
12 | 1375 |
{ |
1376 |
iContainerInStack = ETrue; |
|
1377 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1378 |
} |
12 | 1379 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1380 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1381 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1382 |
void CImageEditorUIView::RemoveContainerFromStack() |
12 | 1383 |
{ |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1384 |
if (iContainerInStack) |
12 | 1385 |
{ |
1386 |
AppUi()->RemoveFromViewStack(*this, iContainer); |
|
1387 |
iContainerInStack = EFalse; |
|
1388 |
} |
|
1389 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1390 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1391 |
//============================================================================= |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1392 |
EXPORT_C TBool CImageEditorUIView::InZoomingState() |
12 | 1393 |
{ |
1394 |
if (iZoomMode == EZoomIn1 || iZoomMode == EZoomIn2 || iZoomMode == EZoomIn3) |
|
1395 |
{ |
|
1396 |
return ETrue; |
|
1397 |
} |
|
1398 |
else |
|
1399 |
{ |
|
1400 |
return EFalse; |
|
1401 |
} |
|
1402 |
} |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1403 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1404 |
//============================================================================= |
12 | 1405 |
EXPORT_C TInt CImageEditorUIView::LaunchSaveImageQueryL() const |
1406 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1407 |
// Create dialog heading and options |
12 | 1408 |
HBufC * heading = CEikonEnv::Static()->AllocReadResourceLC( |
1409 |
R_SIE_LIST_QUERY_HEADING_SAVE); |
|
1410 |
HBufC * option1 = CEikonEnv::Static()->AllocReadResourceLC( |
|
1411 |
R_SIE_LIST_QUERY_SAVE_NEW); |
|
1412 |
HBufC * option2 = CEikonEnv::Static()->AllocReadResourceLC( |
|
1413 |
R_SIE_LIST_QUERY_SAVE_REPLACE); |
|
1414 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1415 |
// Query dialog texts |
12 | 1416 |
CDesCArray * options = new (ELeave) CDesCArraySeg(2); |
1417 |
CleanupStack::PushL(options); |
|
1418 |
options->AppendL(option1->Des()); |
|
1419 |
options->AppendL(option2->Des()); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1420 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1421 |
// Execute query dialog |
12 | 1422 |
TInt ret = SDrawUtils::LaunchListQueryDialogL(options, *heading); |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1423 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1424 |
options->Reset(); |
12 | 1425 |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1426 |
CleanupStack::PopAndDestroy(4); //options, option2, option1, heading |
12 | 1427 |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1428 |
return ret; |
12 | 1429 |
} |
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1430 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1431 |
//============================================================================= |
12 | 1432 |
EXPORT_C void CImageEditorUIView::GetTouchPanDirections(TInt& xMovement, |
1433 |
TInt& yMovement) |
|
1434 |
{ |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1435 |
|
12 | 1436 |
xMovement = 0; |
1437 |
yMovement = 0; |
|
1438 |
iContainer->GetDragDirections(xMovement, yMovement); |
|
1439 |
} |
|
1440 |
||
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1441 |
EXPORT_C TBool CImageEditorUIView::IsMemoryInCriticalLevel() |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1442 |
{ |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1443 |
TEntry entry; |
12 | 1444 |
RFs & fs = iEikonEnv->FsSession(); |
1445 |
fs.Entry(iImageFileName, entry); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1446 |
TFileName driveAndPath; |
12 | 1447 |
driveAndPath.Copy(PathInfo::PhoneMemoryRootPath()); |
1448 |
driveAndPath.Append(PathInfo::ImagesPath()); |
|
1449 |
return !ImageEditorUtils::ImageFitsToDriveL(fs, iImageFileName, |
|
1450 |
driveAndPath); |
|
1
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1451 |
} |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1452 |
|
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1453 |
// End of File |
edfc90759b9f
Committing the Image Editor package under the Eclipse Public License
Mikael Laine <mikael.laine@ixonos.com>
parents:
diff
changeset
|
1454 |