|
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 CNTFAVORITESMEMBERVIEW_H |
|
19 #define CNTFAVORITESMEMBERVIEW_H |
|
20 |
|
21 #include <hbdocumentloader.h> |
|
22 #include <cntabstractview.h> |
|
23 #include <QSet> |
|
24 |
|
25 class CntListModel; |
|
26 class HbView; |
|
27 class HbAction; |
|
28 class HbListView; |
|
29 class HbAbstractViewItem; |
|
30 class QModelIndex; |
|
31 |
|
32 QTM_BEGIN_NAMESPACE |
|
33 class QContact; |
|
34 QTM_END_NAMESPACE |
|
35 |
|
36 class CntFavoritesMemberView : public QObject, public CntAbstractView |
|
37 { |
|
38 Q_OBJECT |
|
39 |
|
40 public: // From CntAbstractView |
|
41 void activate( const CntViewParameters aArgs ); |
|
42 void deactivate(); |
|
43 bool isDefault() const { return false; } |
|
44 HbView* view() const { return mView; } |
|
45 int viewId() const { return favoritesMemberView; } |
|
46 inline void setEngine( CntAbstractEngine& aEngine ){ mEngine = &aEngine; } |
|
47 |
|
48 void createModel(); |
|
49 |
|
50 public: |
|
51 CntFavoritesMemberView(); |
|
52 ~CntFavoritesMemberView(); |
|
53 |
|
54 #ifdef PBK_UNIT_TEST |
|
55 public slots: |
|
56 #else |
|
57 private slots: |
|
58 #endif |
|
59 |
|
60 void manageFavorites(); |
|
61 void handleManageFavorites(QSet<QContactLocalId> aIds); |
|
62 |
|
63 void onLongPressed (HbAbstractViewItem *item, const QPointF &coords); |
|
64 void handleMenu(HbAction* action); |
|
65 |
|
66 void openContact(const QModelIndex &index); |
|
67 void editContact(const QModelIndex &index); |
|
68 void removeFromFavorites(const QModelIndex &index); |
|
69 void sendToHs(const QModelIndex &index); |
|
70 void showPreviousView(); |
|
71 |
|
72 private: |
|
73 QContactManager* getContactManager(); |
|
74 |
|
75 #ifdef PBK_UNIT_TEST |
|
76 public: |
|
77 #else |
|
78 private: |
|
79 #endif |
|
80 |
|
81 QContact* mContact; |
|
82 HbAction* mManageFavoritesAction; |
|
83 CntListModel* mModel; // own |
|
84 HbListView* mFavoriteListView; |
|
85 CntAbstractViewManager* mViewManager; |
|
86 HbDocumentLoader mDocumentLoader; |
|
87 HbView* mView; // own |
|
88 QSet<QContactLocalId> mOriginalGroupMembers; |
|
89 HbAction* mSoftkey; // owned by view |
|
90 CntAbstractEngine* mEngine; |
|
91 }; |
|
92 |
|
93 #endif /* CNTFAVORITESMEMBERVIEW_H */ |