memspyui/ui/avkon/src/MemSpyDocument.cpp
branchRCL_3
changeset 22 fad26422216a
parent 21 b3cee849fa46
child 23 f8280f3bfeb7
equal deleted inserted replaced
21:b3cee849fa46 22:fad26422216a
     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     //delete iEngine;
       
    41     if( iMemSpySession )
       
    42     	{
       
    43     	iMemSpySession->Close();
       
    44     	}
       
    45     
       
    46     }
       
    47 
       
    48 
       
    49 void CMemSpyDocument::ConstructL()
       
    50     {
       
    51     RFs& fsSession = CCoeEnv::Static()->FsSession();
       
    52     //cigasto
       
    53     //iEngine = CMemSpyEngine::NewL( fsSession );
       
    54     
       
    55     iMemSpySession = new (ELeave) RMemSpySession();
       
    56     //RMemSpySession iMemSpySession;
       
    57 	TInt error = iMemSpySession->Connect();	
       
    58 	if(error != KErrNotFound)
       
    59 		{
       
    60 		User::LeaveIfError( error );
       
    61 		}		
       
    62     
       
    63     //iSettings = CMemSpySettings::NewL( fsSession, *iEngine );
       
    64 	iSettings = CMemSpySettings::NewL( fsSession, *iMemSpySession );
       
    65     }
       
    66 
       
    67 
       
    68 CMemSpyDocument* CMemSpyDocument::NewL(CEikApplication& aApp)
       
    69     {
       
    70     CMemSpyDocument* self = new (ELeave) CMemSpyDocument( aApp );
       
    71     CleanupStack::PushL( self );
       
    72     self->ConstructL();
       
    73     CleanupStack::Pop();
       
    74 
       
    75     return self;
       
    76     }
       
    77 
       
    78 /*
       
    79 CMemSpyEngine& CMemSpyDocument::Engine()
       
    80     {
       
    81     return *iEngine;
       
    82     }
       
    83 
       
    84 
       
    85 const CMemSpyEngine& CMemSpyDocument::Engine() const
       
    86     {
       
    87     return *iEngine;
       
    88     }
       
    89 */
       
    90 
       
    91 CMemSpySettings& CMemSpyDocument::Settings()
       
    92     {
       
    93     return *iSettings;
       
    94     }
       
    95 
       
    96 
       
    97 const CMemSpySettings& CMemSpyDocument::Settings() const
       
    98     {
       
    99     return *iSettings;
       
   100     }
       
   101 
       
   102 
       
   103 CEikAppUi* CMemSpyDocument::CreateAppUiL()
       
   104     {
       
   105     //return new (ELeave) CMemSpyAppUi( *iEngine );
       
   106 	return new (ELeave) CMemSpyAppUi( *iMemSpySession );
       
   107     }
       
   108