|
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); |
|
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 Exit(); |
|
66 } |
|
67 |
|
68 CEmailWidgetSettingsListView* view = new(ELeave) CEmailWidgetSettingsListView; |
|
69 CleanupStack::PushL(view); |
|
70 |
|
71 AddViewL(view); // transfer ownership to CAknViewAppUi |
|
72 CleanupStack::Pop(); //view |
|
73 |
|
74 view->ConstructL(); |
|
75 SetDefaultViewL(*view); |
|
76 CleanupStack::PopAndDestroy(args); |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CEmailWidgetSettingsAppUi::HandleCommandL() |
|
81 // Takes care of command handling. |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 void CEmailWidgetSettingsAppUi::HandleCommandL(TInt aCommand) |
|
85 { |
|
86 FUNC_LOG; |
|
87 switch (aCommand) |
|
88 { |
|
89 case EAknSoftkeyCancel: |
|
90 case EEikCmdExit: |
|
91 Exit(); |
|
92 break; |
|
93 default: |
|
94 break; |
|
95 } |
|
96 } |
|
97 |
|
98 // --------- emailwidgetsettingsdocument.cpp |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 CEikAppUi* CEmailWidgetSettingsDocument::CreateAppUiL() |
|
105 { |
|
106 FUNC_LOG; |
|
107 return(new(ELeave) CEmailWidgetSettingsAppUi); |
|
108 } |
|
109 |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 void CEmailWidgetSettingsDocument::ConstructL() |
|
115 { |
|
116 FUNC_LOG; |
|
117 } |
|
118 |
|
119 // --------- emailwidgetsettingsapplication.cpp |
|
120 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 // ----------------------------------------------------------------------------- |
|
124 // |
|
125 TUid CEmailWidgetSettingsApplication::AppDllUid() const |
|
126 { |
|
127 FUNC_LOG; |
|
128 return KUidWidgetSettApp; |
|
129 } |
|
130 |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 // ----------------------------------------------------------------------------- |
|
134 // |
|
135 CApaDocument* CEmailWidgetSettingsApplication::CreateDocumentL() |
|
136 { |
|
137 FUNC_LOG; |
|
138 CEmailWidgetSettingsDocument* document=new(ELeave) CEmailWidgetSettingsDocument(*this); |
|
139 CleanupStack::PushL(document); |
|
140 document->ConstructL(); |
|
141 CleanupStack::Pop(); |
|
142 return(document); |
|
143 } |
|
144 |
|
145 // --------- emailwidgetsettings.cpp |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 LOCAL_C CApaApplication* NewApplication() |
|
152 { |
|
153 FUNC_LOG; |
|
154 return new CEmailWidgetSettingsApplication; |
|
155 } |
|
156 |
|
157 // ----------------------------------------------------------------------------- |
|
158 // |
|
159 // ----------------------------------------------------------------------------- |
|
160 // |
|
161 GLDEF_C TInt E32Main() |
|
162 { |
|
163 FUNC_LOG; |
|
164 return EikStart::RunApplication(NewApplication); |
|
165 } |
|
166 |
|
167 // End of File |