|
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: Header file for class CalenEditorCustomItem. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CALENEDITORCUSTOMITEM_H |
|
19 #define CALENEDITORCUSTOMITEM_H |
|
20 |
|
21 // System includes |
|
22 #include <QObject> |
|
23 #include <QDateTime> |
|
24 #include <hbdataformviewitem.h> |
|
25 #include <hbextendedlocale.h> |
|
26 #include <hblineedit.h> |
|
27 |
|
28 class XQApplicationManager; |
|
29 class XQAiwRequest; |
|
30 |
|
31 class HbDateTimePicker; |
|
32 class HbPushButton; |
|
33 class HbDataFomViewer; |
|
34 class AgendaEntry; |
|
35 |
|
36 class CalenEditorCustomItem : public HbDataFormViewItem |
|
37 { |
|
38 Q_OBJECT |
|
39 |
|
40 public: |
|
41 CalenEditorCustomItem(QGraphicsItem *parent = 0); |
|
42 ~CalenEditorCustomItem(); |
|
43 virtual HbAbstractViewItem* createItem(); |
|
44 void enableFromTimeFieldAndSetTime(bool, QDateTime); |
|
45 void disableFromToDateField(); |
|
46 void enableToTimeFieldAndSetTime(bool, QDateTime); |
|
47 void populateDateTime(QDateTime defaultDateTime, bool isFromItem); |
|
48 void populateLocation( QString location); |
|
49 void setDateRange(QDate start, QDate end); |
|
50 void setTimeRange(QTime start, QTime end); |
|
51 void enableDateButton(bool value); |
|
52 bool canSetModelIndex(const QModelIndex &index) const; |
|
53 void restore(); |
|
54 QDateTime getDateTime(); |
|
55 |
|
56 protected: |
|
57 virtual HbWidget* createCustomWidget(); |
|
58 |
|
59 protected slots: |
|
60 void handleDate(); |
|
61 void handleTime(); |
|
62 void saveTime(); |
|
63 void saveDate(); |
|
64 void handleLocationTextChange(QString location); |
|
65 void launchLocationPicker(); |
|
66 void handleEditingFinished(); |
|
67 void setSelectedLocation( const QVariant &aValue ); |
|
68 |
|
69 Q_SIGNALS: |
|
70 void dateTimeUpdated(QDateTime& fromDateTime); |
|
71 void locationTextChanged(QString location); |
|
72 void locationTextChanged(QString location, double latitude, double longitude); |
|
73 void locationEditingFinished(); |
|
74 private: |
|
75 AgendaEntry *mEditedEntry; |
|
76 QDate mDate; |
|
77 QDate mMaxDate; |
|
78 QDate mMinDate; |
|
79 QTime mTime; |
|
80 QTime mMaxTime; |
|
81 QTime mMinTime; |
|
82 |
|
83 XQApplicationManager *mAppManager; |
|
84 XQAiwRequest* mRequest; |
|
85 |
|
86 HbPushButton* mPushButtonTime; |
|
87 HbPushButton* mPushButtonDate; |
|
88 HbPushButton *mRepeatUntilWidget; |
|
89 HbPushButton *mReminderTimeWidget; |
|
90 |
|
91 HbDateTimePicker *mDatePicker; |
|
92 HbDateTimePicker *mTimePicker; |
|
93 |
|
94 HbExtendedLocale mLocale; |
|
95 |
|
96 HbLineEdit *mLocationLineEdit; |
|
97 HbPushButton* mLocationPushButton; |
|
98 bool mIsFromItem; |
|
99 bool mRequestPending; |
|
100 |
|
101 }; |
|
102 |
|
103 #endif // CALENEDITORCUSTOMITEM_H |
|
104 |
|
105 // End of file --Don't remove this. |