systemhealthmanagement/systemhealthmgr/test/testapprverror/testapprverror.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code
       
    20 */
       
    21 
       
    22 #include <eikstart.h> 
       
    23 #include <eikapp.h>
       
    24 #include "testapprverror.h"
       
    25 #include "testapps.h"
       
    26 
       
    27 /**
       
    28 Standard DLL entry point function.
       
    29 Creates and returns an instance of the CApaApplication-derived class.
       
    30 @return an instance of the CApaApplication-derived class
       
    31 */
       
    32 TInt E32Main()
       
    33 	{
       
    34 	return EikStart::RunApplication( CTestApplication::NewApplication );
       
    35 	} //lint -e714 Suppress 'not referenced'
       
    36 
       
    37 CTestApplication::CTestApplication()
       
    38 	{
       
    39 	}
       
    40 
       
    41 CTestApplication::~CTestApplication()
       
    42 	{
       
    43 	}
       
    44 		
       
    45 /**
       
    46 @return The application's UID 
       
    47 */
       
    48 TUid CTestApplication::AppDllUid() const
       
    49 	{
       
    50 	const TUid dll = {KTestAppRvErrorUid};
       
    51 	return dll;
       
    52 	}
       
    53 
       
    54 /**
       
    55 @return CTestApplication or NULL if KErrNoMemory
       
    56 */
       
    57 CApaApplication* CTestApplication::NewApplication()
       
    58 	{
       
    59 	// As the framework has at this point not started up enough, and therefore the TRAP-harness and 
       
    60 	// exception handlers aren’t available yet, this factory function is a non-leaving function and 
       
    61 	// can't use the new(Eleave) operator.
       
    62 	return new CTestApplication();
       
    63 	}
       
    64 	
       
    65 /**
       
    66 Called by the UI framework at application start-up to create an instance of the document class.
       
    67 @leave	KErrNoMemory
       
    68 @return A CTestDocument
       
    69 */
       
    70 CApaDocument* CTestApplication::CreateDocumentL()
       
    71 	{
       
    72 	return CTestDocument::NewL(*this);
       
    73 	}
       
    74 
       
    75 CTestDocument::CTestDocument(CEikApplication& aApp) : CEikDocument(aApp)
       
    76 	{
       
    77 	}
       
    78 
       
    79 CTestDocument::~CTestDocument()
       
    80 	{
       
    81 	}
       
    82 
       
    83 /**
       
    84 Factory function for this class
       
    85 @return a new CTestDocument instance.
       
    86 */
       
    87 CTestDocument* CTestDocument::NewL(CEikApplication& aApp)
       
    88 	{
       
    89 	return new(ELeave) CTestDocument(aApp);
       
    90 	}
       
    91 
       
    92 
       
    93 /**
       
    94 Called by the UI framework to construct the application UI class. 
       
    95 Note that the app UI's ConstructL() is called by the UI framework.
       
    96 */
       
    97 CEikAppUi* CTestDocument::CreateAppUiL()
       
    98 	{
       
    99 	return new(ELeave) CTestAppUi();
       
   100 	}
       
   101 
       
   102 
       
   103 
       
   104 TBool CTestAppUi::FrameworkCallsRendezvous() const
       
   105 	{
       
   106 	return EFalse;	
       
   107 	}
       
   108 	
       
   109 	
       
   110 	
       
   111 CTestAppUi::CTestAppUi()
       
   112 	{
       
   113 	}
       
   114 
       
   115 
       
   116 
       
   117 CTestAppUi::~CTestAppUi()
       
   118 	{
       
   119 	}
       
   120 
       
   121 
       
   122 
       
   123 void CTestAppUi::ConstructL()
       
   124 	{
       
   125 	// Complete the UI framework's construction of the App UI.
       
   126 	BaseConstructL(CEikAppUi::ENoAppResourceFile);
       
   127 	
       
   128 	// Supply an error code to imply that there is an error condition upon startup.
       
   129 	RProcess::Rendezvous( KErrGeneral );
       
   130 	}