|
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 handling encapsulation for CM Application Settings UI. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CMSETTINGDATA_H |
|
20 #define CMSETTINGDATA_H |
|
21 |
|
22 // System includes |
|
23 #include <QString> |
|
24 #include <QFlags> |
|
25 #include <QSet> |
|
26 #include <QList> |
|
27 #include <QSharedPointer> |
|
28 #include <cmmanager_shim.h> |
|
29 #include <cmconnectionmethod_shim.h> |
|
30 #include <cmdestination_shim.h> |
|
31 |
|
32 // User includes |
|
33 |
|
34 // Forward declarations |
|
35 |
|
36 // External data types |
|
37 |
|
38 // Constants |
|
39 |
|
40 // Class declaration |
|
41 |
|
42 class CmSettingData |
|
43 { |
|
44 |
|
45 public: |
|
46 |
|
47 // Data types |
|
48 |
|
49 // Data class for Destination |
|
50 class Destination |
|
51 { |
|
52 public: |
|
53 int id; //!< Destination ID. |
|
54 QString name; //!< Destination name. |
|
55 }; |
|
56 |
|
57 // Data class for Connection Method |
|
58 class ConnMethod |
|
59 { |
|
60 public: |
|
61 int id; //!< Connection Method ID. |
|
62 QString name; //!< Connection Method name. |
|
63 }; |
|
64 |
|
65 explicit CmSettingData(); |
|
66 |
|
67 ~CmSettingData(); |
|
68 |
|
69 void setBearerFilter(const QSet<uint> &bearers); |
|
70 |
|
71 bool fetchDestinations(QList< QSharedPointer<Destination> > &destinations); |
|
72 |
|
73 bool fetchConnMethods(QList< QSharedPointer<ConnMethod> > &connMethods); |
|
74 |
|
75 signals: |
|
76 |
|
77 public slots: |
|
78 |
|
79 protected: |
|
80 |
|
81 protected slots: |
|
82 |
|
83 private: |
|
84 |
|
85 void getCmManager(); |
|
86 |
|
87 bool validateDestination(CmDestinationShim *destination) const; |
|
88 |
|
89 bool validateConnMethod(CmConnectionMethodShim *connMethod) const; |
|
90 |
|
91 static bool connMethodLessThan( |
|
92 const QSharedPointer<ConnMethod> connMethod1, |
|
93 const QSharedPointer<ConnMethod> connMethod2); |
|
94 |
|
95 private slots: |
|
96 |
|
97 private: // data |
|
98 |
|
99 QSet<uint> mBearers; //!< Bearer filter. |
|
100 QSharedPointer<CmManagerShim> mCmManager; //!< CM Manager client instance |
|
101 |
|
102 // Friend classes |
|
103 }; |
|
104 |
|
105 #endif // CMSETTINGDATA_H |