calendarui/views/inc/calenpreviewpane.h
changeset 18 c198609911f9
child 23 fd30d51f876b
equal deleted inserted replaced
0:f979ecb2b13e 18:c198609911f9
       
     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 #include <hbgridviewitem.h>
       
    27 
       
    28 // Forward declarations
       
    29 class HbLabel;
       
    30 class MCalenServices;
       
    31 class AgendaEntry;
       
    32 class CalenMonthView;
       
    33 
       
    34 #ifdef  CALENVIEWS_DLL
       
    35 #define CALENPREVIEW_EXPORT Q_DECL_EXPORT
       
    36 #else
       
    37 #define CALENPREVIEW_EXPORT Q_DECL_IMPORT
       
    38 #endif
       
    39 
       
    40 class CALENPREVIEW_EXPORT CalenPreviewPane : public HbScrollArea
       
    41 {
       
    42 	Q_OBJECT
       
    43 	
       
    44 public:
       
    45 	CalenPreviewPane(MCalenServices& services, QGraphicsItem *parent=0);
       
    46 	~CalenPreviewPane();
       
    47 	
       
    48 public:
       
    49 	void setNoEntriesLabel(HbLabel* label);
       
    50 	void populateLabel( QDateTime date);
       
    51 	QDateTime Date();
       
    52 	void startAutoScroll();
       
    53 	void mousePressEvent(QGraphicsSceneMouseEvent* event);
       
    54 	void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
       
    55 	void setView(CalenMonthView* view);
       
    56 	void stopScrolling();
       
    57 	
       
    58 private:
       
    59 	void GetInstanceListL();
       
    60 
       
    61 public slots:
       
    62 	void onTwoSecondsTimeout();
       
    63 	void scrollingFinished();
       
    64     
       
    65 private:
       
    66 	enum scrollDirection{
       
    67 		up,
       
    68 		down,
       
    69 		invalid
       
    70 	};
       
    71 	
       
    72 	CalenMonthView* mView;
       
    73 	MCalenServices &mServices;
       
    74 	QDateTime mDate;
       
    75 	QList<AgendaEntry> mInstanceArray;
       
    76 	QPointF mPressedPos;
       
    77 	QList<HbLabel *> mLabelList;
       
    78 	QTimer* mTwoSecTimer;
       
    79 	scrollDirection mScrollDirection;
       
    80 	int mNumOfScrolls;
       
    81 	HbLabel* mNoEntriesLabel;
       
    82 	bool mIsNoEntriesAdded;
       
    83 };
       
    84 
       
    85 #endif /* CALENPREVIEWPANE_H_ */
       
    86 
       
    87 // End of file  --Don't remove this.