|
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 * Wrapper for CM Manager Symbian interface. |
|
16 */ |
|
17 |
|
18 #ifndef CMDESTINATION_SHIM_H |
|
19 #define CMDESTINATION_SHIM_H |
|
20 |
|
21 // System includes |
|
22 |
|
23 #include <QString> |
|
24 #include <cmdestination.h> |
|
25 #include <cmmanagerdefines_shim.h> |
|
26 |
|
27 // User includes |
|
28 |
|
29 // Forward declarations |
|
30 |
|
31 class CmDestinationShim; |
|
32 class CmDestinationShimPrivate; |
|
33 class CmConnectionMethodShim; |
|
34 |
|
35 // External data types |
|
36 |
|
37 // Constants |
|
38 |
|
39 // Class declaration |
|
40 |
|
41 /*! |
|
42 \class CmDestinationShim |
|
43 \brief Implementation class for CM Manager Destination Shim. |
|
44 |
|
45 Wrapper for CM Manager Symbian interface. |
|
46 |
|
47 NOTE! This shim is supposed to be used only in middleware code. Usage |
|
48 must be agreed with ipconnmgmt package owner. Applications should use |
|
49 the Qt Bearer Management API instead. |
|
50 */ |
|
51 |
|
52 class CONNECTIONSETTINGSSHIMDLL_EXPORT CmDestinationShim |
|
53 { |
|
54 |
|
55 public: |
|
56 |
|
57 // Data types |
|
58 |
|
59 /*! |
|
60 * Constructor. |
|
61 * |
|
62 * @param[in] destination CM Manager destination object. |
|
63 */ |
|
64 CmDestinationShim(RCmDestination &destination); |
|
65 |
|
66 /*! |
|
67 * Destructor. |
|
68 */ |
|
69 ~CmDestinationShim(); |
|
70 |
|
71 /*! |
|
72 * Return the number of connection methods in the destination. |
|
73 * |
|
74 * @return Number of the connection methods in this destination. |
|
75 */ |
|
76 int connectionMethodCount() const; |
|
77 |
|
78 /*! |
|
79 * Return a reference to the connection method. The index must be less |
|
80 * than the return value of connectionMethodCount(). |
|
81 * |
|
82 * @param[in] index Index of the connection method to be returned. |
|
83 * @return Connection method. |
|
84 */ |
|
85 CmConnectionMethodShim *connectionMethod(int index) const; |
|
86 |
|
87 /*! |
|
88 * Returns the connection method with the given ID. |
|
89 * |
|
90 * @param cmId Unique id of the requested connection method. |
|
91 * @return Connection method. |
|
92 */ |
|
93 CmConnectionMethodShim *connectionMethodByID(uint cmId) const; |
|
94 |
|
95 // Getting attributes |
|
96 |
|
97 /*! |
|
98 * Return the priority of the passed connection method. |
|
99 * |
|
100 * @param cmItem Connection method. |
|
101 * @return Priority of the queried connection method. |
|
102 */ |
|
103 uint priority(CmConnectionMethodShim *cmItem) const; |
|
104 |
|
105 /*! |
|
106 * Return the name of the destination. |
|
107 * |
|
108 * @return Name of the destination, empty string in error cases. |
|
109 */ |
|
110 QString name() const; |
|
111 |
|
112 /*! |
|
113 * Return the destination's Id attribute. |
|
114 * |
|
115 * @return Id of the destination. |
|
116 */ |
|
117 uint id() const; |
|
118 |
|
119 /*! |
|
120 * Returns the Metadata. |
|
121 * |
|
122 * @param metadataField The meta data field to query. |
|
123 * @return The value of the requested field. |
|
124 */ |
|
125 uint metadata(CMManagerShim::SnapMetadataField metadataField) const; |
|
126 |
|
127 /*! |
|
128 * Return the protection level of the destination. |
|
129 * |
|
130 * @return Protection level. |
|
131 */ |
|
132 CMManagerShim::CmmProtectionLevel protectionLevel() const; |
|
133 |
|
134 /*! |
|
135 * Return whether the destination is hidden or not. |
|
136 * |
|
137 * @return True if the destination is hidden. |
|
138 */ |
|
139 bool isHidden() const; |
|
140 |
|
141 /*! |
|
142 * Adds an existing connection method to a destination. |
|
143 * |
|
144 * @param cm Connection method to be added. |
|
145 * @return Index in the Connection Method list. |
|
146 */ |
|
147 int addConnectionMethod(CmConnectionMethodShim *cm); |
|
148 |
|
149 /*! |
|
150 * Remove a connection method from a destination and delete it |
|
151 * on update. |
|
152 * Exception: connection method is not deleted, if it's referenced |
|
153 * from any other destination. |
|
154 * |
|
155 * @param cm The connection method to be deleted. |
|
156 */ |
|
157 void deleteConnectionMethod(CmConnectionMethodShim *cm); |
|
158 |
|
159 /*! |
|
160 * Remove connection method from the destination. |
|
161 * |
|
162 * @param cm Connection method to be removed. |
|
163 */ |
|
164 void removeConnectionMethod(CmConnectionMethodShim *cm); |
|
165 |
|
166 /*! |
|
167 * Set the connection method's priority based on the passed |
|
168 * index. Indexing starts from zero(the highest priority). |
|
169 * |
|
170 * @param cm The connection method item |
|
171 * @param index The new priority of the connection method in the |
|
172 * destination. |
|
173 */ |
|
174 void modifyPriority(CmConnectionMethodShim *cm, int index); |
|
175 |
|
176 /*! |
|
177 * Set the destination's name. |
|
178 * |
|
179 * @param name New name of the destination. |
|
180 */ |
|
181 void setName(QString name); |
|
182 |
|
183 /*! |
|
184 * Update all values of the destination and its connection methods to |
|
185 * CommsDat. Nothing is stored, if update leaves due to any reason. |
|
186 */ |
|
187 void update(); |
|
188 |
|
189 /*! |
|
190 * Reload the contents of the destination from database. |
|
191 * Any current changes made to the destination are lost. |
|
192 */ |
|
193 void refresh(); |
|
194 |
|
195 /*! |
|
196 * Delete destination and its connection methods from CommsDat. |
|
197 * Connection methods that belong also to some other destination are |
|
198 * not deleted. |
|
199 */ |
|
200 void deleteDestination(); |
|
201 |
|
202 protected: |
|
203 |
|
204 private: |
|
205 |
|
206 private: // data |
|
207 |
|
208 CmDestinationShimPrivate *d_ptr; //!< Private implementation |
|
209 |
|
210 // Friend classes |
|
211 |
|
212 }; |
|
213 |
|
214 #endif /* CMDESTINATION_SHIM_H */ |