calendarui/views/inc/calenpreviewpane.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 09:47:38 +0300
changeset 58 ef813d54df51
parent 32 ea672fcb0ea0
child 68 a5a1242fd2e8
permissions -rw-r--r--
Revision: 201031 Kit: 201033

/*
* 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:  CalenPreviewPane class definition.
*
*/



#ifndef CALENPREVIEWPANE_H_
#define CALENPREVIEWPANE_H_

// System includes
#include <qdatetime.h>
#include <hbscrollarea.h>

// Forward declarations
class HbLabel;
class MCalenServices;
class AgendaEntry;
class CalenMonthView;

#ifdef  CALENVIEWS_DLL
#define CALENPREVIEW_EXPORT Q_DECL_EXPORT
#else
#define CALENPREVIEW_EXPORT Q_DECL_IMPORT
#endif

class CALENPREVIEW_EXPORT CalenPreviewPane : public HbScrollArea
{
	Q_OBJECT
	
public:
	CalenPreviewPane(MCalenServices& services, QGraphicsItem *parent=0);
	~CalenPreviewPane();
	
public:
	void setNoEntriesLabel(HbLabel* label);
	void populateLabel( QDateTime date);
	QDateTime Date();
	void startAutoScroll();
	void setView(CalenMonthView* view);
	void stopScrolling();
	void effectStarted();
	void effectFinished();
	
protected:
	void gestureEvent(QGestureEvent *event);
	
private:
	void GetInstanceListL();
	void checkStartTimeOfEvent(QDateTime &dateTime);

public slots:
	void onTwoSecondsTimeout();
	void scrollingFinished();
    
private:
	enum scrollDirection{
		up,
		down,
		invalid
	};
	
	CalenMonthView* mView;
	MCalenServices &mServices;
	QDateTime mDate;
	QList<AgendaEntry> mInstanceArray;
	QPointF mPressedPos;
	QList<HbLabel *> mLabelList;
	QTimer* mTwoSecTimer;
	scrollDirection mScrollDirection;
	int mNumOfScrolls;
	HbLabel* mNoEntriesLabel;
	bool mIsNoEntriesAdded;
	bool mIsGestureHandled;
	qreal mHtDiff;
	int mScrollDuration;
};

#endif /* CALENPREVIEWPANE_H_ */

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