51
|
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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "MemSpyDocument.h"
|
|
19 |
|
|
20 |
// Engine includes
|
|
21 |
#include <memspy/engine/memspyengine.h>
|
|
22 |
|
|
23 |
// User includes
|
|
24 |
#include "MemSpyAppUi.h"
|
|
25 |
#include "MemSpySettings.h"
|
|
26 |
|
|
27 |
//cigasto
|
|
28 |
#include <memspysession.h>
|
|
29 |
|
|
30 |
|
|
31 |
CMemSpyDocument::CMemSpyDocument(CEikApplication& aApp)
|
|
32 |
: CAknDocument(aApp)
|
|
33 |
{
|
|
34 |
}
|
|
35 |
|
|
36 |
|
|
37 |
CMemSpyDocument::~CMemSpyDocument()
|
|
38 |
{
|
|
39 |
delete iSettings;
|
|
40 |
iMemSpySession->Close();
|
|
41 |
}
|
|
42 |
|
|
43 |
|
|
44 |
void CMemSpyDocument::ConstructL()
|
|
45 |
{
|
|
46 |
RFs& fsSession = CCoeEnv::Static()->FsSession();
|
|
47 |
//cigasto
|
|
48 |
//iEngine = CMemSpyEngine::NewL( fsSession );
|
|
49 |
|
|
50 |
iMemSpySession = new (ELeave) RMemSpySession();
|
|
51 |
//RMemSpySession iMemSpySession;
|
|
52 |
TInt error = iMemSpySession->Connect();
|
|
53 |
if(error != KErrNotFound)
|
|
54 |
{
|
|
55 |
User::LeaveIfError( error );
|
|
56 |
}
|
|
57 |
|
|
58 |
//iSettings = CMemSpySettings::NewL( fsSession, *iEngine );
|
|
59 |
iSettings = CMemSpySettings::NewL( fsSession, *iMemSpySession );
|
|
60 |
}
|
|
61 |
|
|
62 |
|
|
63 |
CMemSpyDocument* CMemSpyDocument::NewL(CEikApplication& aApp)
|
|
64 |
{
|
|
65 |
CMemSpyDocument* self = new (ELeave) CMemSpyDocument( aApp );
|
|
66 |
CleanupStack::PushL( self );
|
|
67 |
self->ConstructL();
|
|
68 |
CleanupStack::Pop();
|
|
69 |
|
|
70 |
return self;
|
|
71 |
}
|
|
72 |
|
|
73 |
/*
|
|
74 |
CMemSpyEngine& CMemSpyDocument::Engine()
|
|
75 |
{
|
|
76 |
return *iEngine;
|
|
77 |
}
|
|
78 |
|
|
79 |
|
|
80 |
const CMemSpyEngine& CMemSpyDocument::Engine() const
|
|
81 |
{
|
|
82 |
return *iEngine;
|
|
83 |
}
|
|
84 |
*/
|
|
85 |
|
|
86 |
CMemSpySettings& CMemSpyDocument::Settings()
|
|
87 |
{
|
|
88 |
return *iSettings;
|
|
89 |
}
|
|
90 |
|
|
91 |
|
|
92 |
const CMemSpySettings& CMemSpyDocument::Settings() const
|
|
93 |
{
|
|
94 |
return *iSettings;
|
|
95 |
}
|
|
96 |
|
|
97 |
|
|
98 |
CEikAppUi* CMemSpyDocument::CreateAppUiL()
|
|
99 |
{
|
|
100 |
//return new (ELeave) CMemSpyAppUi( *iEngine );
|
|
101 |
return new (ELeave) CMemSpyAppUi( *iMemSpySession );
|
|
102 |
}
|
|
103 |
|