13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #ifndef CNTABSTRACTLISTVIEW_H_ |
18 #ifndef CNTNAMESVIEWPRIVATE_H |
19 #define CNTABSTRACTLISTVIEW_H_ |
19 #define CNTNAMESVIEWPRIVATE_H |
|
20 |
|
21 #include <QObject> |
20 |
22 |
21 #include "cntnamesview.h" |
23 #include "cntnamesview.h" |
22 #include "cntactionlauncher.h" |
24 #include "cntactionlauncher.h" |
23 #include "cntactionmenubuilder.h" |
25 #include "cntactionmenubuilder.h" |
24 |
26 |
25 #include <hbaction.h> |
27 #include <hbaction.h> |
26 #include <hbabstractviewitem.h> |
28 #include <hbabstractviewitem.h> |
27 #include <QObject> |
29 #include <qtcontacts.h> |
28 |
|
29 #include <qcontact.h> |
|
30 #include <cntlistmodel.h> |
30 #include <cntlistmodel.h> |
31 |
31 |
32 class HbView; |
32 class HbView; |
33 class HbListView; |
33 class HbListView; |
34 class HbLabel; |
|
35 class HbDocumentLoader; |
34 class HbDocumentLoader; |
36 class HbSearchPanel; |
35 class HbSearchPanel; |
37 class HbShrinkingVkbHost; |
36 class HbShrinkingVkbHost; |
|
37 class HbMenu; |
38 class CntExtensionManager; |
38 class CntExtensionManager; |
39 class CntFetchContacts; |
39 class CntFetchContacts; |
40 class HbMenu; |
40 |
|
41 QTM_USE_NAMESPACE |
41 |
42 |
42 class CntNamesViewPrivate : public QObject |
43 class CntNamesViewPrivate : public QObject |
43 { |
44 { |
44 Q_OBJECT |
45 Q_OBJECT |
45 Q_DECLARE_PUBLIC(CntNamesView) |
46 Q_DECLARE_PUBLIC(CntNamesView) |
|
47 friend class TestCntNamesView; |
46 |
48 |
47 public: |
49 public: |
48 CntNamesViewPrivate(); |
50 CntNamesViewPrivate(); |
49 virtual ~CntNamesViewPrivate(); |
51 virtual ~CntNamesViewPrivate(); |
|
52 |
|
53 public: |
|
54 void activate( const CntViewParameters aArgs ); |
|
55 void deactivate(); |
|
56 void setEngine( CntAbstractEngine& aEngine ){ mEngine = &aEngine; } |
|
57 QString externalize(QDataStream &stream); |
|
58 bool internalize(QDataStream &stream, CntViewParameters &viewParameters); |
50 |
59 |
51 public slots: |
60 public slots: |
|
61 // Search functions |
52 void showFinder(); |
62 void showFinder(); |
53 void hideFinder(); |
63 void hideFinder(); |
54 void setFilter(const QString &filterString); |
64 void setFilter(const QString &filterString); |
55 |
65 |
|
66 // Extension action (activity stream toolbar button) |
56 void handleExtensionAction(); |
67 void handleExtensionAction(); |
57 |
68 |
|
69 // New contact creation |
58 void createNewContact(); |
70 void createNewContact(); |
|
71 |
|
72 // Single and multiple contact deletion |
59 void deleteContact( QContact& aContact ); |
73 void deleteContact( QContact& aContact ); |
|
74 void handleDeleteContact( int aAction ); |
60 void deleteMultipleContacts(); |
75 void deleteMultipleContacts(); |
61 |
|
62 void handleDeleteMultipleContacts( QSet<QContactLocalId> aIds ); |
76 void handleDeleteMultipleContacts( QSet<QContactLocalId> aIds ); |
63 |
77 |
|
78 // View switches |
64 void showPreviousView(); |
79 void showPreviousView(); |
65 void showCollectionView(); |
80 void showCollectionView(); |
|
81 void showContactView( const QModelIndex& aIndex ); |
66 void showContactView( QContact& aContact ); |
82 void showContactView( QContact& aContact ); |
67 void showContactView( const QModelIndex& ); |
|
68 void showContactEditorView( QContact& aContact ); |
83 void showContactEditorView( QContact& aContact ); |
69 void showContextMenu(HbAbstractViewItem* aItem, QPointF aPoint); |
84 void showSettingsView(); |
70 void showSettings(); |
85 void showImportsView(); |
71 |
86 |
|
87 // FTU import dialog |
|
88 void handleImportContacts( HbAction *aAction ); |
|
89 |
|
90 // Context menu actions |
|
91 void setShowContextMenu( const QModelIndex& aIndex ); |
|
92 void showContextMenu(HbAbstractViewItem* aItem, QPointF aPoint); |
72 void executeAction( QContact& aContact, QContactDetail aDetail, QString aAction ); |
93 void executeAction( QContact& aContact, QContactDetail aDetail, QString aAction ); |
73 void actionExecuted( CntActionLauncher* aAction ); |
94 void actionExecuted( CntActionLauncher* aAction ); |
74 void handleDeleteContact( int aAction ); |
|
75 void importSim(); |
|
76 |
95 |
|
96 // Contact database notifications |
77 void handleContactAddition(const QList<QContactLocalId> & aAddedList); |
97 void handleContactAddition(const QList<QContactLocalId> & aAddedList); |
78 void handleContactRemoval(const QList<QContactLocalId> & aRemovedList); |
98 void handleContactRemoval(const QList<QContactLocalId> & aRemovedList); |
79 void handleSelfContactIdChange(const QContactLocalId & aOldId, const QContactLocalId & aNewId); |
99 void handleSelfContactIdChange(const QContactLocalId & aOldId, const QContactLocalId & aNewId); |
80 |
100 |
81 private slots: |
|
82 void switchOrientation(); |
|
83 void handleImportContacts( HbAction *aAction ); |
|
84 |
|
85 public: |
101 public: |
86 bool isFinderVisible(); |
102 bool isFinderVisible(); |
87 void activate( const CntViewParameters aArgs ); |
103 |
88 void deactivate(); |
|
89 void setEngine( CntAbstractEngine& aEngine ){ mEngine = &aEngine; } |
|
90 private: |
104 private: |
91 void changeDeleteActionStatus(); |
105 void changeDeleteActionStatus(); |
92 void focusLineEdit(); |
106 void focusLineEdit(); |
93 void setScrollPosition(int focusedContact); |
107 void setScrollPosition(int focusedContact); |
94 |
108 |
95 public: |
109 public: |
96 CntNamesView *q_ptr; |
110 CntNamesView *q_ptr; |
97 |
111 |
98 public: // lazy initializations |
112 public: // lazy initializations |
99 HbListView *list(); |
113 HbListView *list(); |
100 HbDocumentLoader *document(); |
114 HbDocumentLoader *document(); |
101 |
115 |
|
116 |
102 private: |
117 private: |
103 CntAbstractViewManager* mViewManager; |
118 friend class T_NameListTest; |
104 CntListModel* mListModel; |
119 CntAbstractViewManager *mViewManager; |
105 HbView* mView; |
120 CntListModel *mListModel; |
106 HbListView* mListView; |
121 HbView *mView; |
107 HbLabel* mEmptyList; |
122 HbListView *mListView; |
108 HbSearchPanel* mSearchPanel; |
123 HbSearchPanel *mSearchPanel; |
109 HbDocumentLoader* mLoader; |
124 HbDocumentLoader *mLoader; |
110 HbShrinkingVkbHost* mVirtualKeyboard; |
125 HbShrinkingVkbHost *mVirtualKeyboard; |
111 HbAction* mSoftkey; |
126 HbAction *mSoftkey; |
112 HbAction* mNamesAction; |
127 HbAction *mNamesAction; |
113 CntActionMenuBuilder* mMenuBuilder; |
128 HbAction *mMultipleDeleter; |
114 HbAction* mImportSim; |
129 CntActionMenuBuilder *mMenuBuilder; |
115 HbAction* mNewContact; |
130 QActionGroup *mActionGroup; |
116 QContactLocalId mHandledContactId; |
131 HbMenu *mMenu; |
117 HbAction* mMultipleDeleter; |
132 HbMenu *mViewMenu; |
118 QActionGroup* mActionGroup; |
133 CntAbstractEngine *mEngine; |
119 HbMenu* mMenu; |
134 QContactLocalId mHandledContactId; |
120 bool mFilterChanged; |
135 bool mFilterChanged; |
121 CntAbstractEngine* mEngine; |
136 |
122 static bool mIsFirstTimeUse; // FTU flag |
137 static bool mIsFirstTimeUse; // FTU flag |
123 }; |
138 }; |
124 |
139 |
125 #endif /* CNTABSTRACTLISTVIEW_H_ */ |
140 #endif /* CNTNAMESVIEWPRIVATE_H */ |