|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CNTABSTRACTLISTVIEW_H_ |
|
19 #define CNTABSTRACTLISTVIEW_H_ |
|
20 |
|
21 #include "cntnamesview.h" |
|
22 #include "cntactionlauncher.h" |
|
23 #include "cntactionmenubuilder.h" |
|
24 |
|
25 #include <hbaction.h> |
|
26 #include <hbabstractviewitem.h> |
|
27 #include <QObject> |
|
28 |
|
29 #include <qcontact.h> |
|
30 #include <cntlistmodel.h> |
|
31 |
|
32 class HbView; |
|
33 class HbListView; |
|
34 class HbLabel; |
|
35 class HbDocumentLoader; |
|
36 class HbSearchPanel; |
|
37 class HbShrinkingVkbHost; |
|
38 class CntExtensionManager; |
|
39 class CntFetchContacts; |
|
40 class HbMenu; |
|
41 |
|
42 class CntNamesViewPrivate : public QObject |
|
43 { |
|
44 Q_OBJECT |
|
45 Q_DECLARE_PUBLIC(CntNamesView) |
|
46 |
|
47 public: |
|
48 CntNamesViewPrivate(); |
|
49 virtual ~CntNamesViewPrivate(); |
|
50 |
|
51 public slots: |
|
52 void showFinder(); |
|
53 void hideFinder(); |
|
54 void setFilter(const QString &filterString); |
|
55 |
|
56 void handleExtensionAction(); |
|
57 |
|
58 void createNewContact(); |
|
59 void deleteContact( QContact& aContact ); |
|
60 void deleteMultipleContacts(); |
|
61 |
|
62 void handleDeleteMultipleContacts( QSet<QContactLocalId> aIds ); |
|
63 |
|
64 void showPreviousView(); |
|
65 void showCollectionView(); |
|
66 void showContactView( QContact& aContact ); |
|
67 void showContactView( const QModelIndex& ); |
|
68 void showContactEditorView( QContact& aContact ); |
|
69 void showContextMenu(HbAbstractViewItem* aItem, QPointF aPoint); |
|
70 void showSettings(); |
|
71 |
|
72 void executeAction( QContact& aContact, QContactDetail aDetail, QString aAction ); |
|
73 void actionExecuted( CntActionLauncher* aAction ); |
|
74 void handleDeleteContact( int aAction ); |
|
75 void importSim(); |
|
76 |
|
77 void handleContactAddition(const QList<QContactLocalId> & aAddedList); |
|
78 void handleContactRemoval(const QList<QContactLocalId> & aRemovedList); |
|
79 void handleSelfContactIdChange(const QContactLocalId & aOldId, const QContactLocalId & aNewId); |
|
80 |
|
81 private slots: |
|
82 void switchOrientation(); |
|
83 |
|
84 public: |
|
85 bool isFinderVisible(); |
|
86 void activate( const CntViewParameters aArgs ); |
|
87 void deactivate(); |
|
88 void setEngine( CntAbstractEngine& aEngine ){ mEngine = &aEngine; } |
|
89 private: |
|
90 void changeDeleteActionStatus(); |
|
91 void focusLineEdit(); |
|
92 void setScrollPosition(int focusedContact); |
|
93 |
|
94 public: |
|
95 CntNamesView *q_ptr; |
|
96 |
|
97 public: // lazy initializations |
|
98 HbListView *list(); |
|
99 HbDocumentLoader *document(); |
|
100 |
|
101 private: |
|
102 CntAbstractViewManager* mViewManager; |
|
103 CntListModel* mListModel; |
|
104 HbView* mView; |
|
105 HbListView* mListView; |
|
106 HbLabel* mEmptyList; |
|
107 HbSearchPanel* mSearchPanel; |
|
108 HbDocumentLoader* mLoader; |
|
109 HbShrinkingVkbHost* mVirtualKeyboard; |
|
110 HbAction* mSoftkey; |
|
111 HbAction* mNamesAction; |
|
112 CntActionMenuBuilder* mMenuBuilder; |
|
113 HbAction* mImportSim; |
|
114 HbAction* mNewContact; |
|
115 QContactLocalId mHandledContactId; |
|
116 HbAction* mMultipleDeleter; |
|
117 bool mIsDefault; |
|
118 int mId; |
|
119 QActionGroup* mActionGroup; |
|
120 HbMenu* mMenu; |
|
121 bool mFilterChanged; |
|
122 CntAbstractEngine* mEngine; |
|
123 }; |
|
124 |
|
125 #endif /* CNTABSTRACTLISTVIEW_H_ */ |