notes/notesui/notesapplication/src/notesApplication.cpp
changeset 55 2c54b51f39c4
equal deleted inserted replaced
51:0b38fc5b94c6 55:2c54b51f39c4
       
     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: Definition file for class NotesApplication.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // User includes
       
    20 #include "notesapplication.h"
       
    21 #include "notesappcontroller.h"
       
    22 #include "OstTraceDefinitions.h"
       
    23 #ifdef OST_TRACE_COMPILER_IN_USE
       
    24 #include "notesApplicationTraces.h"
       
    25 #endif
       
    26 
       
    27 
       
    28 /*!
       
    29 	\class NotesApplication
       
    30 
       
    31 	This class creates the NotesController object.
       
    32  */
       
    33 /*!
       
    34 	Constructor.
       
    35  */
       
    36 NotesApplication::NotesApplication(int &argc, char *argv[]):
       
    37  HbApplication(argc, argv)
       
    38 {
       
    39 	OstTraceFunctionEntry0( NOTESAPPLICATION_NOTESAPPLICATION_ENTRY );
       
    40 	OstTraceFunctionExit0( NOTESAPPLICATION_NOTESAPPLICATION_EXIT );
       
    41 }
       
    42 
       
    43 /*!
       
    44 	Destructor.
       
    45  */
       
    46 NotesApplication::~NotesApplication()
       
    47 {
       
    48 	OstTraceFunctionEntry0( DUP1_NOTESAPPLICATION_NOTESAPPLICATION_ENTRY );
       
    49 	if (mController) {
       
    50 		delete mController;
       
    51 		mController = 0;
       
    52 	}
       
    53 	OstTraceFunctionExit0( DUP1_NOTESAPPLICATION_NOTESAPPLICATION_EXIT );
       
    54 }
       
    55 
       
    56 /*!
       
    57 	creates the NotesController object.
       
    58 */
       
    59 void NotesApplication::createController()
       
    60 {
       
    61 	OstTraceFunctionEntry0( NOTESAPPLICATION_CREATECONTROLLER_ENTRY );
       
    62 	mController = new NotesAppController;
       
    63 	connect(mController, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    64 	OstTraceFunctionExit0( NOTESAPPLICATION_CREATECONTROLLER_EXIT );
       
    65 }
       
    66 
       
    67 /*!
       
    68 	Start the event loop for the application.
       
    69 */
       
    70 bool NotesApplication::execution()
       
    71 {
       
    72 	OstTraceFunctionEntry0( NOTESAPPLICATION_EXECUTION_ENTRY );
       
    73 	int ret = 0;
       
    74 	ret = exec();
       
    75 	OstTraceFunctionExit0( NOTESAPPLICATION_EXECUTION_EXIT );
       
    76 	return ret;
       
    77 }
       
    78 
       
    79 /*!
       
    80 	Emits the applicationReady signal.
       
    81  */
       
    82 void NotesApplication::handleAppReady()
       
    83 {
       
    84 	OstTraceFunctionEntry0( NOTESAPPLICATION_HANDLEAPPREADY_ENTRY );
       
    85 	emit applicationReady();
       
    86 	disconnect(mController, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    87 	OstTraceFunctionExit0( NOTESAPPLICATION_HANDLEAPPREADY_EXIT );
       
    88 }
       
    89 
       
    90 // End of file	--Don't remove this.