notes/notesui/notesappcontroller/src/notesappcontrollerifimpl.cpp
changeset 18 c198609911f9
child 23 fd30d51f876b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/notes/notesui/notesappcontroller/src/notesappcontrollerifimpl.cpp	Fri Apr 16 14:57:40 2010 +0300
@@ -0,0 +1,114 @@
+/*
+* 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 file contains the NotesAppControllerIfImpl class definition.
+*
+*/
+
+// System includes
+#include <QDebug>
+
+// User includes
+#include "notesappcontrollerifimpl.h"
+#include "notesmodelhandler.h"
+#include "notesappcontroller.h"
+#include "notesviewmanager.h"
+
+/*!
+	\class NotesAppControllerIfImpl
+
+	This class implements the NotesAppControllerIf interface which is used
+	by the views and other componets to access the services of
+	notesviewmanager and notesmodelhandler.
+ */
+
+/*!
+	Constructor.
+
+	\param controller Pointer to an object of NotesAppController.
+	\param parent QObject pointer.
+ */
+NotesAppControllerIfImpl::NotesAppControllerIfImpl(
+		NotesAppController *controller, QObject *parent)
+:QObject(parent),
+ mAppController(controller)
+{
+	qDebug() << "notes: NotesAppControllerIfImpl::NotesAppControllerIfImpl -->";
+
+	// Nothing yet.
+
+	qDebug() << "notes: NotesAppControllerIfImpl::NotesAppControllerIfImpl <--";
+}
+
+/*!
+	Destructor.
+ */
+NotesAppControllerIfImpl::~NotesAppControllerIfImpl()
+{
+	qDebug() << "notes: NotesAppControllerIfImpl::~NotesAppControllerIfImpl -->";
+
+	// Nothing yet.
+
+	qDebug() << "notes: NotesAppControllerIfImpl::~NotesAppControllerIfImpl <--";
+}
+
+/*!
+	From NotesAppControllerIf.
+	Returns a pointer to agendautil object.
+
+	\return AgendaUtil* Pointer to agendautil object.
+	\sa NotesAppControllerIf
+ */
+AgendaUtil *NotesAppControllerIfImpl::agendaUtil()
+{
+	qDebug() << "notes: NotesAppControllerIfImpl::agendaUtil -->";
+
+	qDebug() << "notes: NotesAppControllerIfImpl::agendaUtil <--";
+
+	return mAppController->mNotesModelHandler->agendaInterface();
+}
+
+/*!
+	From NotesAppControllerIf.
+	Returns a pointer to notesmodel object.
+
+	\return NotesModel* Pointer to notesmodel object.
+	\sa NotesAppControllerIf
+ */
+NotesModel *NotesAppControllerIfImpl::notesModel()
+{
+	qDebug() << "notes: NotesAppControllerIfImpl::notesModel -->";
+
+	qDebug() << "notes: NotesAppControllerIfImpl::notesModel <--";
+
+	return mAppController->mNotesModelHandler->notesModel();
+}
+
+/*!
+	From NotesAppControllerIf.
+	Issues a request to NotesViewManager to switch to a given view.
+
+	\param viewId The id of the view to be switched to.
+	\sa NotesAppControllerIf
+ */
+void NotesAppControllerIfImpl::switchToView(NotesNamespace::NotesViewIds viewId)
+{
+	qDebug() << "notes: NotesAppControllerIfImpl::switchToView -->";
+
+	mAppController->mViewManager->switchToView(viewId);
+
+	qDebug() << "notes: NotesAppControllerIfImpl::switchToView <--";
+}
+
+// End of file	--Don't remove this.