|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Uikon application architecture's application class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "CCAApp.h" |
|
21 #include "CCADocument.h" |
|
22 #include "CAExternalInterface.h" |
|
23 |
|
24 #include "CCAVariantFactory.h" // for variation |
|
25 #include "MCAOpBrandVariant.h" |
|
26 #include "CAlternator.h" |
|
27 #include "ChatDebugPrint.h" |
|
28 #include <eikstart.h> |
|
29 |
|
30 #include <ErrorUI.h> |
|
31 |
|
32 // ================= MEMBER FUNCTIONS ======================= |
|
33 |
|
34 // --------------------------------------------------------- |
|
35 // CCAApp::AppDllUid() |
|
36 // Returns application UID |
|
37 // --------------------------------------------------------- |
|
38 // |
|
39 TUid CCAApp::AppDllUid() const |
|
40 { |
|
41 CHAT_DP_FUNC_ENTER( "AppDllUid" ); |
|
42 return KUidChatClient; |
|
43 } |
|
44 |
|
45 // destructor |
|
46 CCAApp::~CCAApp() |
|
47 { |
|
48 delete iVariantFactory; |
|
49 |
|
50 //Release alternator instance because not needed anymore. |
|
51 CAlternator::Release(); |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------- |
|
55 // CCAApp::VariantFactory |
|
56 // Variant factory accessor |
|
57 // --------------------------------------------------------- |
|
58 // |
|
59 CCAVariantFactory* CCAApp::VariantFactory() const |
|
60 { |
|
61 return iVariantFactory; |
|
62 } |
|
63 |
|
64 // --------------------------------------------------------- |
|
65 // CCAApp::CreateDocumentL() |
|
66 // Creates CChatClientDocument object |
|
67 // --------------------------------------------------------- |
|
68 // |
|
69 CApaDocument* CCAApp::CreateDocumentL() |
|
70 { |
|
71 CHAT_DP_FUNC_ENTER( "CreateDocumentL" ); |
|
72 iVariantFactory = CCAVariantFactory::NewL(); |
|
73 |
|
74 // CR : 101-39724:: Error note needed when application cannot be opened because of the lack of the memory |
|
75 MCAOpBrandVariant* opBrand = NULL ; |
|
76 TRAPD ( err, opBrand = iVariantFactory->OpBrandVariantL() ); |
|
77 if ( err ) |
|
78 { |
|
79 // Framework is not capable of showing the errornote if user leaves. |
|
80 // Using CErrorUI, which matches the errorcode passed with coreesponding error string |
|
81 // and displays the note. |
|
82 CErrorUI* errorUI = CErrorUI::NewLC( ); |
|
83 errorUI->ShowGlobalErrorNoteL( err ); |
|
84 CleanupStack::PopAndDestroy( errorUI ); |
|
85 User::Leave( err ); |
|
86 } |
|
87 |
|
88 opBrand->RemoveAppResourceL( iCoeEnv, iResourceFileOffset ); |
|
89 |
|
90 CHAT_DP_TXT( "CreateDocumentL before return" ); |
|
91 return CCADocument::NewL( *this ); |
|
92 } |
|
93 |
|
94 |
|
95 // ================= OTHER EXPORTED FUNCTIONS ============== |
|
96 // |
|
97 // --------------------------------------------------------- |
|
98 // NewApplication() |
|
99 // Constructs CCAApp |
|
100 // Returns: CApaDocument*: created application object |
|
101 // --------------------------------------------------------- |
|
102 // |
|
103 LOCAL_C CApaApplication* NewApplication() |
|
104 { |
|
105 CHAT_DP_FUNC_ENTER( "NewApplication" ); |
|
106 return new CCAApp; |
|
107 } |
|
108 |
|
109 GLDEF_C TInt E32Main() |
|
110 { |
|
111 return EikStart::RunApplication( NewApplication ); |
|
112 } |
|
113 |
|
114 // End of File |