72
|
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 CNTCOLLECTIONVIEW_H
|
|
19 |
#define CNTCOLLECTIONVIEW_H
|
|
20 |
|
|
21 |
#include <QObject>
|
|
22 |
#include <QSet>
|
|
23 |
#include <hbdocumentloader.h>
|
|
24 |
|
|
25 |
#include <cntabstractview.h>
|
|
26 |
#include <cntextensiongroupcallback.h>
|
|
27 |
|
|
28 |
class HbAction;
|
|
29 |
class HbView;
|
|
30 |
class HbListView;
|
|
31 |
class CntCollectionListModel;
|
|
32 |
class QModelIndex;
|
|
33 |
class QActionGroup;
|
|
34 |
class HbAbstractViewItem;
|
|
35 |
|
|
36 |
QTM_USE_NAMESPACE
|
|
37 |
|
|
38 |
class CntCollectionView : public QObject, public CntAbstractView, public CntExtensionGroupCallback
|
|
39 |
{
|
|
40 |
Q_OBJECT
|
|
41 |
friend class TestCntCollectionView;
|
|
42 |
|
|
43 |
public:
|
|
44 |
CntCollectionView();
|
|
45 |
~CntCollectionView();
|
|
46 |
|
|
47 |
public: // From CntAbstractView
|
|
48 |
void activate( const CntViewParameters aArgs );
|
|
49 |
void deactivate();
|
|
50 |
bool isDefault() const { return false; }
|
|
51 |
HbView* view() const { return mView; }
|
|
52 |
int viewId() const { return collectionView; }
|
|
53 |
inline void setEngine( CntAbstractEngine& aEngine ){mEngine = &aEngine;}
|
|
54 |
|
|
55 |
public: // From CntExtensionGroupCallback
|
|
56 |
void openView(CntViewParameters& viewParams);
|
|
57 |
|
|
58 |
private slots:
|
|
59 |
void showPreviousView();
|
|
60 |
void showNamesViewWithFinder();
|
|
61 |
void openGroup(const QModelIndex &index);
|
|
62 |
|
|
63 |
void showContextMenu(HbAbstractViewItem *item, const QPointF &coords);
|
|
64 |
void handleMenu(HbAction* action);
|
|
65 |
|
|
66 |
void handleExtensionAction();
|
|
67 |
|
|
68 |
void newGroup();
|
|
69 |
void handleNewGroup(HbAction* action);
|
|
70 |
void handleNewGroupMembers( QSet<QContactLocalId> aMembers );
|
|
71 |
void handleCancelGroupMembers();
|
|
72 |
void notifyNewGroup();
|
|
73 |
|
|
74 |
void refreshDataModel();
|
|
75 |
|
|
76 |
void deleteGroup(QContact group);
|
|
77 |
void handleDeleteGroup(int action);
|
|
78 |
|
|
79 |
void deleteGroups();
|
|
80 |
void handleDeleteGroups(HbAction* action);
|
|
81 |
|
|
82 |
void groupCountChanged();
|
|
83 |
|
|
84 |
private:
|
|
85 |
QContactManager* getContactManager();
|
|
86 |
void saveNewGroup(QContact* aContact);
|
|
87 |
|
|
88 |
|
|
89 |
private:
|
|
90 |
CntExtensionManager* mExtensionManager;
|
|
91 |
HbView* mView; // own
|
|
92 |
HbAction* mSoftkey; // owned by view
|
|
93 |
CntAbstractViewManager* mViewManager;
|
|
94 |
HbDocumentLoader mDocumentLoader;
|
|
95 |
CntCollectionListModel* mModel; // own
|
|
96 |
HbListView* mListView; // owned by layout
|
|
97 |
HbAction* mNamesAction; // owned by view
|
|
98 |
HbAction* mFindAction; // owned by view
|
|
99 |
HbAction* mExtensionAction; // owned by view
|
|
100 |
HbAction* mNewGroupAction; // owned by view
|
|
101 |
HbAction* mDeleteGroupsAction; // owned by view
|
|
102 |
|
|
103 |
QContact* mHandledContact; // own, needed for asynchronous popups
|
|
104 |
QSet<QContactLocalId> mSelectedContactsSet;
|
|
105 |
|
|
106 |
QActionGroup* mActionGroup;
|
|
107 |
CntAbstractEngine* mEngine;
|
|
108 |
};
|
|
109 |
|
|
110 |
#endif // CNTCOLLECTIONVIEW_H
|
|
111 |
|
|
112 |
// EOF
|