|
1 /* |
|
2 * Copyright (c) 2007-2008 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: SUPL Settings extension parameter class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __EPOS_CSUPLSETTINGEXTENSIONPARAMS_H__ |
|
20 #define __EPOS_CSUPLSETTINGEXTENSIONPARAMS_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * This class is used to specify/retrieve the desired extended server properties. The required memory for |
|
33 * the parameters will be allocated during construction of this class and this class owns |
|
34 * the memory allocated. And same will be released when this class is destroyed. The |
|
35 * server property includes |
|
36 * - AGPS server ID. |
|
37 * - Internet Access point 1. |
|
38 * - Internet Access point 2. |
|
39 * - Server address type. |
|
40 */ |
|
41 class CServerExtensionParams : public CBase |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * |
|
49 * @since S60 5.1 |
|
50 * @returns A new instance of this class. |
|
51 */ |
|
52 IMPORT_C static CServerExtensionParams* NewL(); |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * |
|
57 * @since S60 5.1 |
|
58 * @returns A new instance of this class. |
|
59 */ |
|
60 IMPORT_C static CServerExtensionParams* NewLC(); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 * |
|
65 * @since S60 5.1 |
|
66 * |
|
67 */ |
|
68 IMPORT_C ~CServerExtensionParams(); |
|
69 |
|
70 private: |
|
71 |
|
72 /** |
|
73 * C++ default constructor. |
|
74 * |
|
75 * @since S60 5.1 |
|
76 * |
|
77 */ |
|
78 CServerExtensionParams(); |
|
79 |
|
80 /** |
|
81 * By default EPOC constructor is private. |
|
82 * |
|
83 * @since S60 5.1 |
|
84 * |
|
85 */ |
|
86 void ConstructL(); |
|
87 public: |
|
88 |
|
89 /** |
|
90 * Sets server parameters. |
|
91 * |
|
92 * @param [IN] aServerId Server identifier.Max length can be KMaxServerIdLen. |
|
93 * @param [IN] aIap1 The Internet Access Point Name refers to the access point which is |
|
94 * used to access the HSLP over the internet. This can have maximum size of 100 characters. |
|
95 * @param [IN] aIap2 The Internet Access Point Name refers to the access point which is |
|
96 * used to access the HSLP over the internet. This can have maximum size of 100 characters.More than one Iap are used for fallback |
|
97 * in case of failures. |
|
98 * @param [IN] aServerAddr Server address type.Max. length can be KMaxServerAddLen. |
|
99 * @param [IN] aServerAddType Inidcates server address type.Max. length can be KMaxServerAddTypeLen. |
|
100 * |
|
101 * @return following error codes |
|
102 * - KErrNone if successful |
|
103 * - KErrArgument if any of the argument is not in the specified range |
|
104 */ |
|
105 IMPORT_C TInt Set( |
|
106 const TDesC& aServerId, |
|
107 const TDesC& aIap1, |
|
108 const TDesC& aIap2, |
|
109 const TDesC& aServerAddr, |
|
110 const TDesC& aServerAddType |
|
111 ); |
|
112 |
|
113 |
|
114 /** |
|
115 * Returns server parameters. |
|
116 * |
|
117 * @param [OUT] aServerId Server identifier |
|
118 * @param [OUT] aIap1 The Internet Access Point Name refers to the access point which is |
|
119 * used to access the HSLP over the internet. |
|
120 * @param [OUT] aIap2 The Internet Access Point Name refers to the access point which is |
|
121 * used to access the HSLP over the internet.More than one Iap are used for fallback |
|
122 * in case of failures. |
|
123 * @param [OUT] aServerAddr Inidcates server address. |
|
124 * @param [OUT] aServerAddType Inidcates server address type.If not set before,default value is "FQDN". |
|
125 * |
|
126 * @return following error codes |
|
127 * - KErrNone if successful |
|
128 * - KErrNotFound if all parameters has reset value |
|
129 * - KErrOverflow if the input descriptors are too small to hold the values |
|
130 * - KErrArgument if client has not allocated buffer for any parameter i.e. if its NULL. |
|
131 */ |
|
132 IMPORT_C TInt Get( |
|
133 TPtr aServerId, |
|
134 TPtr aIap1, |
|
135 TPtr aIap2, |
|
136 TPtr aServerAddr, |
|
137 TPtr aServerAddType |
|
138 ) const; |
|
139 |
|
140 private: |
|
141 HBufC* iServerId; |
|
142 HBufC* iIap1; |
|
143 HBufC* iIap2; |
|
144 HBufC* iServerAddr; |
|
145 HBufC* iServerAddType; |
|
146 |
|
147 |
|
148 //To indicate if the values were set using the Set method |
|
149 TBool iIsValueSet; |
|
150 }; |
|
151 |
|
152 #endif /* __EPOS_CSUPLSETTINGEXTENSIONPARAMS_H__ */ |