|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Implementation of CWsfDocument. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <featmgr.h> |
|
19 #include "wsfappui.h" |
|
20 #include "wsfdocument.h" |
|
21 #include "wsfwlaninfoarrayvisitor.h" |
|
22 |
|
23 #include "wsfmodel.h" |
|
24 |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 // CCWsfDocument::NewL |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 CWsfDocument* CWsfDocument::NewL( CEikApplication& aApp ) |
|
31 { |
|
32 CWsfDocument* self = NewLC( aApp ); |
|
33 CleanupStack::Pop( self ); |
|
34 return self; |
|
35 } |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // CCWsfDocument::NewLC |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 CWsfDocument* CWsfDocument::NewLC( CEikApplication& aApp ) |
|
42 { |
|
43 CWsfDocument* self = new ( ELeave ) CWsfDocument( aApp ); |
|
44 CleanupStack::PushL( self ); |
|
45 self->ConstructL(); |
|
46 return self; |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // CCWsfDocument::ConstructL |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 void CWsfDocument::ConstructL() |
|
54 { |
|
55 iModel = CWsfModel::NewL( iMainController, EFalse ); |
|
56 iModel->SetEngineObserver( &iMainController ); |
|
57 iWlanInfoBranding = CWsfWlanInfoArrayVisitor::NewL( EFalse ); |
|
58 iWlanInfoBranding->LoadFilterDefinitionsL(); |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // CCWsfDocument::CWsfDocument |
|
63 // --------------------------------------------------------------------------- |
|
64 // |
|
65 CWsfDocument::CWsfDocument( CEikApplication& aApp ) : CAknDocument( aApp ) |
|
66 { |
|
67 // no implementation required |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // CCWsfDocument::~CWsfDocument |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 CWsfDocument::~CWsfDocument() |
|
75 { |
|
76 delete iWlanInfoBranding; |
|
77 delete iModel; |
|
78 } |
|
79 |
|
80 // --------------------------------------------------------------------------- |
|
81 // CCWsfDocument::CreateAppUiL |
|
82 // --------------------------------------------------------------------------- |
|
83 // |
|
84 CEikAppUi* CWsfDocument::CreateAppUiL() |
|
85 { |
|
86 // Create the application user interface, and return a pointer to it, |
|
87 // the framework takes ownership of this object |
|
88 CWsfAppUi* appUi = new ( ELeave ) CWsfAppUi; |
|
89 appUi->SetUiObserver( &iMainController ); |
|
90 |
|
91 // Give references to main controller. |
|
92 iMainController.Initialize( *appUi, *iModel, *iWlanInfoBranding ); |
|
93 |
|
94 return appUi; |
|
95 } |
|
96 |