clock/clockui/clockappcontroller/src/clockappcontroller.cpp
branchRCL_3
changeset 65 12af337248b1
equal deleted inserted replaced
60:96907930389d 65:12af337248b1
       
     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: This is the Definition file for ClockAppController class.
       
    15 *
       
    16 */
       
    17 
       
    18 // User includes
       
    19 #include "clockappcontroller.h"
       
    20 #include "clockappcontrollerifimpl.h"
       
    21 #include "clockviewmanager.h"
       
    22 #include "OstTraceDefinitions.h"
       
    23 #ifdef OST_TRACE_COMPILER_IN_USE
       
    24 #include "clockappcontrollerTraces.h"
       
    25 #endif
       
    26 
       
    27 
       
    28 /*!
       
    29 	\class ClockAppController
       
    30 
       
    31 	This is the heart of clock application. It constructs and owns the
       
    32 	ClockViewManager objects.
       
    33  */
       
    34 
       
    35 /*!
       
    36 	Default constructor.
       
    37  */
       
    38 ClockAppController::ClockAppController(QObject *parent)
       
    39 :QObject(parent),
       
    40  mViewManager(0),
       
    41  mIfImpl(0)
       
    42 {
       
    43 	OstTraceFunctionEntry0( CLOCKAPPCONTROLLER_CLOCKAPPCONTROLLER_ENTRY );
       
    44 	// Construct the interface implementation.
       
    45 	mIfImpl = new ClockAppControllerIfImpl(this, this);
       
    46 
       
    47 	// Construct the view manager.
       
    48 	mViewManager = new ClockViewManager(*mIfImpl, this);
       
    49 	Q_ASSERT_X(
       
    50 			mViewManager, "clockappcontroller.cpp",
       
    51 			"ClockViewManager is 0");
       
    52 	connect(mViewManager, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    53 	OstTraceFunctionExit0( CLOCKAPPCONTROLLER_CLOCKAPPCONTROLLER_EXIT );
       
    54 }
       
    55 
       
    56 /*!
       
    57 	Destructor.
       
    58  */
       
    59 ClockAppController::~ClockAppController()
       
    60 {
       
    61 	OstTraceFunctionEntry0( DUP1_CLOCKAPPCONTROLLER_CLOCKAPPCONTROLLER_ENTRY );
       
    62 	if (mViewManager) {
       
    63 		delete mViewManager;
       
    64 		mViewManager = 0;
       
    65 	}
       
    66 	if (mIfImpl) {
       
    67 		delete mIfImpl;
       
    68 		mIfImpl = 0;
       
    69 	}
       
    70 	OstTraceFunctionExit0( DUP1_CLOCKAPPCONTROLLER_CLOCKAPPCONTROLLER_EXIT );
       
    71 }
       
    72 
       
    73 /*!
       
    74 	Emits the appReday signal.
       
    75  */
       
    76 void ClockAppController::handleAppReady()
       
    77 {
       
    78 	OstTraceFunctionEntry0( CLOCKAPPCONTROLLER_HANDLEAPPREADY_ENTRY );
       
    79 	emit appReady();
       
    80 	disconnect(mViewManager, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    81 	OstTraceFunctionExit0( CLOCKAPPCONTROLLER_HANDLEAPPREADY_EXIT );
       
    82 }
       
    83 
       
    84 // End of file	--Don't remove this.