calendarui/application/src/calenserviceprovider.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 00:15:49 +0300
changeset 80 fa7c359294fa
parent 58 ef813d54df51
permissions -rw-r--r--
Revision: 201037 Kit: 201039

/*
* Copyright (c) 2010 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: 
*
*/
//#include <qdatetime.h>
#include <hbmainwindow.h>

#include <CalenLauncher>
#include <CalenEditor>

#include "calencontroller.h"
#include "calenserviceprovider.h"

CalenServiceProvider::CalenServiceProvider(CCalenController *controller, QObject* parent) :
 XQServiceProvider(QLatin1String("com.nokia.services.calendar.Launch"), parent)
{
	publishAll();
	mController = controller;
	//Q_IMPLEMENT_USER_METATYPE_ENUM(CalenView);
}

CalenServiceProvider::~CalenServiceProvider()
{
}

void CalenServiceProvider::launchCalendarApp(const QDateTime& date, int viewId)
{	
	
	// Check the view ID and launch the corresponding view
	switch(viewId) {
		case CalenLauncher::MonthView:
			// Launch the month view
			mController->handleServiceManagerSlot(ECalenMonthView, date);
			break;
		case CalenLauncher::AgendaView:
			// Launch the agenda view
			mController->handleServiceManagerSlot(ECalenAgendaView, date);
			break;
		case CalenLauncher::DayView:
	    // Launch the day view
	    mController->handleServiceManagerSlot(ECalenDayView, date);
	    break;
		default:
			// Keep Quiet
			break;
	}
}

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