clock/clockui/clockappcontroller/src/clockappcontroller.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:30:32 +0300
changeset 23 fd30d51f876b
parent 18 c198609911f9
child 26 a949c2543c15
permissions -rw-r--r--
Revision: 201015 Kit: 201018

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: This is the Definition file for ClockAppController class.
*
*/

// System includes
#include <QDebug>

// User includes
#include "clockappcontroller.h"
#include "clockappcontrollerifimpl.h"
#include "clockviewmanager.h"

/*!
	\class ClockAppController

	This is the heart of clock application. It constructs and owns the
	ClockViewManager objects.
 */

/*!
	Default constructor.
 */
ClockAppController::ClockAppController(QObject *parent)
:QObject(parent),
 mViewManager(0),
 mIfImpl(0)
{
	qDebug() << "clock: ClockAppController::ClockAppController -->";

	// Construct the interface implementation.
	mIfImpl = new ClockAppControllerIfImpl(this, this);

	// Construct the view manager.
	mViewManager = new ClockViewManager(*mIfImpl, this);
	Q_ASSERT_X(
			mViewManager, "clockappcontroller.cpp",
			"ClockViewManager is 0");

	qDebug() << "clock: ClockAppController::ClockAppController <--";
}

/*!
	Destructor.
 */
ClockAppController::~ClockAppController()
{
	qDebug() << "clock: ClockAppController::~ClockAppController -->";

	if (mViewManager) {
		delete mViewManager;
		mViewManager = 0;
	}
	if (mIfImpl) {
		delete mIfImpl;
		mIfImpl = 0;
	}

	qDebug() << "clock: ClockAppController::~ClockAppController <--";
}

// End of file	--Don't remove this.