|
1 /* |
|
2 * Copyright (c) 2002-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: Handles the LANService table in CommsDat |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 6 % |
|
20 */ |
|
21 |
|
22 #ifndef LANSETTINGS_H |
|
23 #define LANSETTINGS_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <commsdattypesv1_1.h> |
|
27 #include <commsdat.h> |
|
28 |
|
29 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
30 #include <commsdat_partner.h> |
|
31 #endif |
|
32 |
|
33 |
|
34 using namespace CommsDat; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Struct for LAN table settings |
|
41 */ |
|
42 struct SLanSettings |
|
43 { |
|
44 TBuf<KMaxMedTextLength> Name; |
|
45 TUint32 Id; |
|
46 TBool AddrFromServer; |
|
47 TBuf<KMaxMedTextLength> Addr; |
|
48 }; |
|
49 |
|
50 /** |
|
51 * Class for handling LAN settings in commsdat |
|
52 * |
|
53 * @lib wlandbif.lib |
|
54 * @since |
|
55 */ |
|
56 NONSHARABLE_CLASS( CLanSettings ) : public CBase |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 /** |
|
60 * Constructor |
|
61 */ |
|
62 IMPORT_C CLanSettings(); |
|
63 |
|
64 /** |
|
65 * Destructor |
|
66 * Also Handles disconnection |
|
67 */ |
|
68 IMPORT_C virtual ~CLanSettings(); |
|
69 |
|
70 public: // New functions |
|
71 /** |
|
72 * Connects to commsdat |
|
73 * @param |
|
74 * @return KErrNone or other symbian error code |
|
75 * @remarks |
|
76 * @see |
|
77 */ |
|
78 IMPORT_C TInt Connect(); |
|
79 |
|
80 /** |
|
81 * Disconnects from commsdat. |
|
82 * @param |
|
83 * @return |
|
84 * @remarks |
|
85 * @see |
|
86 */ |
|
87 IMPORT_C void Disconnect(); |
|
88 |
|
89 /** |
|
90 * Gets LAN settings with specified ID |
|
91 * @param aId is the id of lan settings row that is fetched, aSettings contains the lan settings |
|
92 * @return KErrNone or other symbian error code |
|
93 * @remarks |
|
94 * @see |
|
95 */ |
|
96 IMPORT_C TInt GetLanSettings(TUint32 aId,SLanSettings &aSettings); |
|
97 |
|
98 /** |
|
99 * Writes LAN settings with specified ID, if ID is 0, new record is created |
|
100 * @param aSettings contains the lan settings. if id is 0, then new id is stored in settings.Id |
|
101 * @return KErrNone or other symbian error code |
|
102 * @remarks |
|
103 * @see |
|
104 */ |
|
105 IMPORT_C TInt WriteLanSettings(SLanSettings &aSettings); |
|
106 |
|
107 /** |
|
108 * deletes LAN settings with specified ID |
|
109 * @param aId is the id of lan settings row that is deleted |
|
110 * @return KErrNone or other symbian error code |
|
111 * @remarks |
|
112 * @see |
|
113 */ |
|
114 IMPORT_C TInt DeleteLanSettings(TUint32 aId); |
|
115 |
|
116 private: |
|
117 |
|
118 void DoConnectL(); |
|
119 |
|
120 private: // Data |
|
121 |
|
122 CCDLANServiceRecord* iLANServiceRecord; |
|
123 CMDBSession* iDBSession; |
|
124 }; |
|
125 |
|
126 #endif // LANSETTINGS_H |
|
127 |
|
128 // end of file |