clock/clockui/clockapplication/src/clockapplication.cpp
author hgs
Mon, 09 Aug 2010 18:30:52 +0530
changeset 57 bb2d3e476f29
parent 55 2c54b51f39c4
permissions -rw-r--r--
201031
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description: Definition file for class ClockApplication.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
// User includes
hgs
parents:
diff changeset
    20
#include "clockapplication.h"
hgs
parents:
diff changeset
    21
#include "clockappcontroller.h"
57
hgs
parents: 55
diff changeset
    22
#include "OstTraceDefinitions.h"
hgs
parents: 55
diff changeset
    23
#ifdef OST_TRACE_COMPILER_IN_USE
hgs
parents: 55
diff changeset
    24
#include "clockapplicationTraces.h"
hgs
parents: 55
diff changeset
    25
#endif
hgs
parents: 55
diff changeset
    26
55
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
/*!
hgs
parents:
diff changeset
    29
	\class ClockApplication
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
	This class creates the ClockAppController object.
hgs
parents:
diff changeset
    32
 */
hgs
parents:
diff changeset
    33
/*!
hgs
parents:
diff changeset
    34
	Constructor.
hgs
parents:
diff changeset
    35
 */
hgs
parents:
diff changeset
    36
ClockApplication::ClockApplication(int &argc, char *argv[]):
hgs
parents:
diff changeset
    37
 HbApplication(argc, argv)
hgs
parents:
diff changeset
    38
{
57
hgs
parents: 55
diff changeset
    39
OstTraceFunctionEntry0( CLOCKAPPLICATION_CLOCKAPPLICATION_ENTRY );
hgs
parents: 55
diff changeset
    40
OstTraceFunctionExit0( CLOCKAPPLICATION_CLOCKAPPLICATION_EXIT );
55
hgs
parents:
diff changeset
    41
}
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
/*!
hgs
parents:
diff changeset
    44
	Destructor.
hgs
parents:
diff changeset
    45
 */
hgs
parents:
diff changeset
    46
ClockApplication::~ClockApplication()
hgs
parents:
diff changeset
    47
{
57
hgs
parents: 55
diff changeset
    48
	OstTraceFunctionEntry0( DUP1_CLOCKAPPLICATION_CLOCKAPPLICATION_ENTRY );
55
hgs
parents:
diff changeset
    49
	if (mController) {
hgs
parents:
diff changeset
    50
		delete mController;
hgs
parents:
diff changeset
    51
		mController = 0;
hgs
parents:
diff changeset
    52
	}
57
hgs
parents: 55
diff changeset
    53
OstTraceFunctionExit0( DUP1_CLOCKAPPLICATION_CLOCKAPPLICATION_EXIT );
55
hgs
parents:
diff changeset
    54
}
hgs
parents:
diff changeset
    55
hgs
parents:
diff changeset
    56
/*!
hgs
parents:
diff changeset
    57
	creates the ClockAppController object.
hgs
parents:
diff changeset
    58
*/
hgs
parents:
diff changeset
    59
void ClockApplication::createController()
hgs
parents:
diff changeset
    60
{
57
hgs
parents: 55
diff changeset
    61
	OstTraceFunctionEntry0( CLOCKAPPLICATION_CREATECONTROLLER_ENTRY );
55
hgs
parents:
diff changeset
    62
	mController = new ClockAppController;
hgs
parents:
diff changeset
    63
	connect(mController, SIGNAL(appReady()), this, SLOT(handleAppReady()));
57
hgs
parents: 55
diff changeset
    64
OstTraceFunctionExit0( CLOCKAPPLICATION_CREATECONTROLLER_EXIT );
55
hgs
parents:
diff changeset
    65
}
hgs
parents:
diff changeset
    66
hgs
parents:
diff changeset
    67
/*!
hgs
parents:
diff changeset
    68
	Start the event loop for the application.
hgs
parents:
diff changeset
    69
*/
hgs
parents:
diff changeset
    70
bool ClockApplication::execution()
hgs
parents:
diff changeset
    71
{
57
hgs
parents: 55
diff changeset
    72
	OstTraceFunctionEntry0( CLOCKAPPLICATION_EXECUTION_ENTRY );
55
hgs
parents:
diff changeset
    73
	int ret = 0;
hgs
parents:
diff changeset
    74
	ret = exec();
57
hgs
parents: 55
diff changeset
    75
	OstTraceFunctionExit0( CLOCKAPPLICATION_EXECUTION_EXIT );
55
hgs
parents:
diff changeset
    76
	return ret;
hgs
parents:
diff changeset
    77
}
hgs
parents:
diff changeset
    78
hgs
parents:
diff changeset
    79
/*!
hgs
parents:
diff changeset
    80
	Emits the applicationReady signal.
hgs
parents:
diff changeset
    81
 */
hgs
parents:
diff changeset
    82
void ClockApplication::handleAppReady()
hgs
parents:
diff changeset
    83
{
57
hgs
parents: 55
diff changeset
    84
	OstTraceFunctionEntry0( CLOCKAPPLICATION_HANDLEAPPREADY_ENTRY );
55
hgs
parents:
diff changeset
    85
	emit applicationReady();
hgs
parents:
diff changeset
    86
	disconnect(mController, SIGNAL(appReady()), this, SLOT(handleAppReady()));
57
hgs
parents: 55
diff changeset
    87
OstTraceFunctionExit0( CLOCKAPPLICATION_HANDLEAPPREADY_EXIT );
55
hgs
parents:
diff changeset
    88
}
hgs
parents:
diff changeset
    89
hgs
parents:
diff changeset
    90
// End of file	--Don't remove this.