|
1 /* |
|
2 * Copyright (c) 2010 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 * Data item for representing access points in UI. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CPIAPITEM_H |
|
20 #define CPIAPITEM_H |
|
21 |
|
22 // System includes |
|
23 #include <QObject> |
|
24 #include <QPoint> |
|
25 #include <QModelIndex> |
|
26 #include <cpsettingformentryitemdata.h> |
|
27 #include <cmmanagerdefines_shim.h> |
|
28 |
|
29 // User includes |
|
30 |
|
31 // Forward declarations |
|
32 class HbDialog; |
|
33 class HbRadioButtonList; |
|
34 class HbAction; |
|
35 class HbMenu; |
|
36 class CmManagerShim; |
|
37 class CpBearerApPluginInterface; |
|
38 |
|
39 // External data types |
|
40 |
|
41 // Constants |
|
42 |
|
43 // Class declaration |
|
44 class CpIapItem : public CpSettingFormEntryItemData |
|
45 { |
|
46 Q_OBJECT |
|
47 |
|
48 public: |
|
49 CpIapItem( |
|
50 CpItemDataHelper &itemDataHelper, |
|
51 int iapId, |
|
52 const QString &iapName, |
|
53 int destId, |
|
54 bool apProtected, |
|
55 CpBearerApPluginInterface *bearerPlugin); |
|
56 |
|
57 ~CpIapItem(); |
|
58 |
|
59 int getIapId() const; |
|
60 |
|
61 signals: |
|
62 void iapChanged(); |
|
63 |
|
64 public slots: |
|
65 void showItemMenu(QPointF position); |
|
66 void moveIap(); |
|
67 void showDeleteConfirmation(); |
|
68 void shareIap(); |
|
69 void queryDialogClosed(); |
|
70 void deleteConfirmed(); |
|
71 void updateIap(const QModelIndex index); |
|
72 |
|
73 protected: |
|
74 |
|
75 protected slots: |
|
76 |
|
77 private: |
|
78 virtual CpBaseSettingView *createSettingView() const; |
|
79 void queryDestination(); |
|
80 void saveMove(int id); |
|
81 void saveShare(int id); |
|
82 bool isCmManagerAvailable(); |
|
83 HbMenu *createItemMenu( |
|
84 CMManagerShim::CmmProtectionLevel protLvl, |
|
85 const QPointF &position); |
|
86 void showErrorNote(const QString &info); |
|
87 |
|
88 private slots: |
|
89 |
|
90 private: // data |
|
91 //! Unique ID for access point |
|
92 int mIapId; |
|
93 //! Access point name |
|
94 QString mIapName; |
|
95 //! ID of the destination referencing this access point |
|
96 int mDestId; |
|
97 //! Boolean showing if access point is protected. |
|
98 bool mProtected; |
|
99 //! Helper for connecting signals to underlying widgets |
|
100 CpItemDataHelper *mItemDataHelper; |
|
101 //! Pointer to CmManager for commsdat operations |
|
102 CmManagerShim *mCmm; |
|
103 //! Plugin that implements settings view for this access point |
|
104 CpBearerApPluginInterface *mBearerPlugin; |
|
105 |
|
106 //! Variable showing if access point move transaction is ongoing |
|
107 bool mMoveOngoing; |
|
108 //! Target destination query dialog. Used for move and share |
|
109 HbDialog *mDialog; |
|
110 //! Dialog's OK action |
|
111 HbAction *mOk; |
|
112 //! List of available destinations' IDs |
|
113 QList<uint> mDestinationList; |
|
114 //! List of available destinations |
|
115 HbRadioButtonList *mList; |
|
116 }; |
|
117 |
|
118 #endif // CPIAPITEM_H |