calendarui/views/inc/calenpreviewpane.h
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:  CalenPreviewPane class definition.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CALENPREVIEWPANE_H_
       
    21 #define CALENPREVIEWPANE_H_
       
    22 
       
    23 // System includes
       
    24 #include <qdatetime.h>
       
    25 #include <hbscrollarea.h>
       
    26 
       
    27 // Forward declarations
       
    28 class HbLabel;
       
    29 class MCalenServices;
       
    30 class AgendaEntry;
       
    31 class CalenMonthView;
       
    32 
       
    33 #ifdef  CALENVIEWS_DLL
       
    34 #define CALENPREVIEW_EXPORT Q_DECL_EXPORT
       
    35 #else
       
    36 #define CALENPREVIEW_EXPORT Q_DECL_IMPORT
       
    37 #endif
       
    38 
       
    39 class CALENPREVIEW_EXPORT CalenPreviewPane : public HbScrollArea
       
    40 {
       
    41 	Q_OBJECT
       
    42 	
       
    43 public:
       
    44 	CalenPreviewPane(MCalenServices& services, QGraphicsItem *parent=0);
       
    45 	~CalenPreviewPane();
       
    46 	
       
    47 public:
       
    48 	void setNoEntriesLabel(HbLabel* label);
       
    49 	void populateLabel( QDateTime date);
       
    50 	QDateTime Date();
       
    51 	void startAutoScroll();
       
    52 	void setView(CalenMonthView* view);
       
    53 	void stopScrolling();
       
    54 	void effectStarted();
       
    55 	void effectFinished();
       
    56 	
       
    57 protected:
       
    58 	void gestureEvent(QGestureEvent *event);
       
    59 	
       
    60 private:
       
    61 	void GetInstanceListL();
       
    62 	void checkStartTimeOfEvent(QDateTime &dateTime);
       
    63 
       
    64 public slots:
       
    65 	void onTwoSecondsTimeout();
       
    66 	void scrollingFinished();
       
    67 	void handleThemeChange();
       
    68     
       
    69 private:
       
    70 	enum scrollDirection{
       
    71 		up,
       
    72 		down,
       
    73 		invalid
       
    74 	};
       
    75 	
       
    76 	CalenMonthView* mView;
       
    77 	MCalenServices &mServices;
       
    78 	QDateTime mDate;
       
    79 	QList<AgendaEntry> mInstanceArray;
       
    80 	QPointF mPressedPos;
       
    81 	QList<HbLabel *> mLabelList;
       
    82 	QTimer* mTwoSecTimer;
       
    83 	scrollDirection mScrollDirection;
       
    84 	int mNumOfScrolls;
       
    85 	HbLabel* mNoEntriesLabel;
       
    86 	bool mIsNoEntriesAdded;
       
    87 	bool mIsGestureHandled;
       
    88 	qreal mHtDiff;
       
    89 	int mScrollDuration;
       
    90 	QColor mPreviewTextColor;
       
    91 };
       
    92 
       
    93 #endif /* CALENPREVIEWPANE_H_ */
       
    94 
       
    95 // End of file  --Don't remove this.