45
|
1 |
/*
|
70
|
2 |
* Copyright (c) 2010 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: Day view control of calendar
|
|
15 |
*
|
|
16 |
*/
|
45
|
17 |
|
|
18 |
#ifndef CALENDAYITEMVIEW_H
|
|
19 |
#define CALENDAYITEMVIEW_H
|
|
20 |
|
|
21 |
//System includes
|
|
22 |
#include <hbabstractitemview.h>
|
|
23 |
#include <hbmenu.h>
|
|
24 |
|
|
25 |
//User includes
|
|
26 |
|
|
27 |
//Forward declarations
|
|
28 |
class CalenDayInfo;
|
|
29 |
class CalenDayContainer;
|
|
30 |
class MCalenServices;
|
|
31 |
|
|
32 |
class CalenDayItemView : public HbAbstractItemView
|
|
33 |
{
|
70
|
34 |
Q_OBJECT
|
45
|
35 |
|
|
36 |
public:
|
|
37 |
enum CalendarPanDirection {
|
|
38 |
CalendarPanNotSet,
|
|
39 |
CalendarPanVertical,
|
|
40 |
CalendarPanHorizontal
|
|
41 |
};
|
|
42 |
|
|
43 |
enum CalendaRecycleDays {
|
|
44 |
CalendarNoRecycle,
|
|
45 |
CalendarBackwardRecycle,
|
|
46 |
CalendarForwardRecycle
|
|
47 |
};
|
|
48 |
|
70
|
49 |
CalenDayItemView(
|
|
50 |
MCalenServices &services,
|
|
51 |
HbModelIterator* iterator,
|
|
52 |
QGraphicsItem *parent);
|
45
|
53 |
~CalenDayItemView();
|
|
54 |
|
70
|
55 |
void scrollTo(
|
|
56 |
const QModelIndex &index,
|
|
57 |
HbAbstractItemView::ScrollHint hint = EnsureVisible);
|
45
|
58 |
|
|
59 |
public slots:
|
|
60 |
|
|
61 |
virtual void reset();
|
|
62 |
void modelAboutToBeReset();
|
|
63 |
void modelReset();
|
|
64 |
|
|
65 |
void scrollVertically(const QPointF &newPosition);
|
70
|
66 |
|
45
|
67 |
private slots:
|
70
|
68 |
|
|
69 |
void itemPressed(const QModelIndex &index);
|
|
70 |
void itemReleased(const QModelIndex &index);
|
|
71 |
void itemActivated(const QModelIndex &index);
|
45
|
72 |
void itemLongPressed(HbAbstractViewItem*, QPointF);
|
70
|
73 |
|
45
|
74 |
void orientationChanged(Qt::Orientation orientation);
|
70
|
75 |
|
45
|
76 |
void openSelectedItem();
|
|
77 |
void editSelectedItem();
|
70
|
78 |
void deleteSelectedItem();
|
45
|
79 |
|
|
80 |
private:
|
70
|
81 |
|
45
|
82 |
void setupSlots();
|
|
83 |
void setupContextMenu();
|
70
|
84 |
bool issueCommandOnSelectedItem(int command);
|
45
|
85 |
void clearSelectionInModel();
|
|
86 |
|
|
87 |
private:
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Calendar services. Not owned.
|
|
91 |
*/
|
70
|
92 |
MCalenServices &mServices;
|
|
93 |
|
45
|
94 |
/**
|
|
95 |
* Item container.
|
|
96 |
*/
|
|
97 |
CalenDayContainer* mContainer;
|
70
|
98 |
|
45
|
99 |
/**
|
|
100 |
* Day event info.
|
|
101 |
* Own.
|
|
102 |
*/
|
|
103 |
CalenDayInfo* mInfo;
|
70
|
104 |
|
45
|
105 |
/**
|
|
106 |
* context menu
|
|
107 |
*/
|
|
108 |
HbMenu* mContextMenu;
|
|
109 |
};
|
|
110 |
|
|
111 |
#endif // CALENDAYITEMVIEW_H
|
|
112 |
|
|
113 |
// End of File
|