64
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: CEmailWidgetSettingsAppUi implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include <bacline.h>
|
|
20 |
#include <eikstart.h>
|
|
21 |
|
|
22 |
#include "emailtrace.h"
|
|
23 |
#include "emailwidgetsettingsappui.h"
|
|
24 |
#include "emailwidgetsettingslistview.h"
|
|
25 |
|
|
26 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
27 |
|
|
28 |
//
|
|
29 |
// CEmailWidgetSettingsAppUi
|
|
30 |
//
|
|
31 |
|
|
32 |
// -----------------------------------------------------------------------------
|
|
33 |
// CEmailWidgetSettingsAppUi::~CEmailWidgetSettingsAppUi()
|
|
34 |
// Destructor.
|
|
35 |
// -----------------------------------------------------------------------------
|
|
36 |
//
|
|
37 |
CEmailWidgetSettingsAppUi::~CEmailWidgetSettingsAppUi()
|
|
38 |
{
|
|
39 |
FUNC_LOG;
|
|
40 |
}
|
|
41 |
|
|
42 |
// -----------------------------------------------------------------------------
|
|
43 |
// CEmailWidgetSettingsAppUi::ConstructL()
|
|
44 |
// Symbian 2nd phase constructor can leave.
|
|
45 |
// -----------------------------------------------------------------------------
|
|
46 |
//
|
|
47 |
void CEmailWidgetSettingsAppUi::ConstructL()
|
|
48 |
{
|
|
49 |
FUNC_LOG;
|
|
50 |
BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible );
|
|
51 |
CreateListViewL();
|
|
52 |
}
|
|
53 |
|
|
54 |
// -----------------------------------------------------------------------------
|
|
55 |
//
|
|
56 |
// -----------------------------------------------------------------------------
|
|
57 |
//
|
|
58 |
void CEmailWidgetSettingsAppUi::CreateListViewL()
|
|
59 |
{
|
|
60 |
FUNC_LOG;
|
|
61 |
CCommandLineArguments* args = CCommandLineArguments::NewLC();
|
|
62 |
const TInt count = args->Count();
|
|
63 |
if (count!=2)
|
|
64 |
{
|
|
65 |
CleanupStack::PopAndDestroy(args);
|
|
66 |
Exit();
|
|
67 |
}
|
|
68 |
|
|
69 |
CEmailWidgetSettingsListView* view = new(ELeave) CEmailWidgetSettingsListView;
|
|
70 |
CleanupStack::PushL(view);
|
|
71 |
|
|
72 |
AddViewL(view); // transfer ownership to CAknViewAppUi
|
|
73 |
CleanupStack::Pop(view); //view
|
|
74 |
|
|
75 |
view->ConstructL();
|
|
76 |
SetDefaultViewL(*view);
|
|
77 |
CleanupStack::PopAndDestroy(args);
|
|
78 |
}
|
|
79 |
|
|
80 |
// -----------------------------------------------------------------------------
|
|
81 |
// CEmailWidgetSettingsAppUi::HandleCommandL()
|
|
82 |
// Takes care of command handling.
|
|
83 |
// -----------------------------------------------------------------------------
|
|
84 |
//
|
|
85 |
void CEmailWidgetSettingsAppUi::HandleCommandL(TInt aCommand)
|
|
86 |
{
|
|
87 |
FUNC_LOG;
|
|
88 |
switch (aCommand)
|
|
89 |
{
|
|
90 |
case EAknSoftkeyCancel:
|
|
91 |
case EEikCmdExit:
|
|
92 |
Exit();
|
|
93 |
break;
|
|
94 |
default:
|
|
95 |
break;
|
|
96 |
}
|
|
97 |
}
|
|
98 |
|
|
99 |
// --------- emailwidgetsettingsdocument.cpp
|
|
100 |
|
|
101 |
// -----------------------------------------------------------------------------
|
|
102 |
//
|
|
103 |
// -----------------------------------------------------------------------------
|
|
104 |
//
|
|
105 |
CEikAppUi* CEmailWidgetSettingsDocument::CreateAppUiL()
|
|
106 |
{
|
|
107 |
FUNC_LOG;
|
|
108 |
return(new(ELeave) CEmailWidgetSettingsAppUi);
|
|
109 |
}
|
|
110 |
|
|
111 |
// -----------------------------------------------------------------------------
|
|
112 |
//
|
|
113 |
// -----------------------------------------------------------------------------
|
|
114 |
//
|
|
115 |
void CEmailWidgetSettingsDocument::ConstructL()
|
|
116 |
{
|
|
117 |
FUNC_LOG;
|
|
118 |
}
|
|
119 |
|
|
120 |
// --------- emailwidgetsettingsapplication.cpp
|
|
121 |
|
|
122 |
// -----------------------------------------------------------------------------
|
|
123 |
//
|
|
124 |
// -----------------------------------------------------------------------------
|
|
125 |
//
|
|
126 |
TUid CEmailWidgetSettingsApplication::AppDllUid() const
|
|
127 |
{
|
|
128 |
FUNC_LOG;
|
|
129 |
return KUidWidgetSettApp;
|
|
130 |
}
|
|
131 |
|
|
132 |
// -----------------------------------------------------------------------------
|
|
133 |
//
|
|
134 |
// -----------------------------------------------------------------------------
|
|
135 |
//
|
|
136 |
CApaDocument* CEmailWidgetSettingsApplication::CreateDocumentL()
|
|
137 |
{
|
|
138 |
FUNC_LOG;
|
|
139 |
CEmailWidgetSettingsDocument* document=new(ELeave) CEmailWidgetSettingsDocument(*this);
|
|
140 |
CleanupStack::PushL(document);
|
|
141 |
document->ConstructL();
|
|
142 |
CleanupStack::Pop();
|
|
143 |
return(document);
|
|
144 |
}
|
|
145 |
|
|
146 |
// --------- emailwidgetsettings.cpp
|
|
147 |
|
|
148 |
// -----------------------------------------------------------------------------
|
|
149 |
//
|
|
150 |
// -----------------------------------------------------------------------------
|
|
151 |
//
|
|
152 |
LOCAL_C CApaApplication* NewApplication()
|
|
153 |
{
|
|
154 |
FUNC_LOG;
|
|
155 |
return new CEmailWidgetSettingsApplication;
|
|
156 |
}
|
|
157 |
|
|
158 |
// -----------------------------------------------------------------------------
|
|
159 |
//
|
|
160 |
// -----------------------------------------------------------------------------
|
|
161 |
//
|
|
162 |
GLDEF_C TInt E32Main()
|
|
163 |
{
|
|
164 |
FUNC_LOG;
|
|
165 |
return EikStart::RunApplication(NewApplication);
|
|
166 |
}
|
|
167 |
|
|
168 |
// End of File
|