|
1 /* |
|
2 * Copyright (c) 2007 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: Stores STUN server related data for plug-in's internal use |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "cnatfwstunserversettings.h" |
|
22 |
|
23 |
|
24 // --------------------------------------------------------------------------- |
|
25 // CStunServerSettings::CStunServerSettings |
|
26 // --------------------------------------------------------------------------- |
|
27 // |
|
28 CStunServerSettings::CStunServerSettings() |
|
29 { |
|
30 } |
|
31 |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 // CStunServerSettings::NewL |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 CStunServerSettings* CStunServerSettings::NewL() |
|
38 { |
|
39 CStunServerSettings* self = CStunServerSettings::NewLC(); |
|
40 CleanupStack::Pop( self ); |
|
41 return self; |
|
42 } |
|
43 |
|
44 |
|
45 // --------------------------------------------------------------------------- |
|
46 // CStunServerSettings::NewLC |
|
47 // --------------------------------------------------------------------------- |
|
48 // |
|
49 CStunServerSettings* CStunServerSettings::NewLC() |
|
50 { |
|
51 CStunServerSettings* self=new ( ELeave ) CStunServerSettings(); |
|
52 CleanupStack::PushL( self ); |
|
53 return self; |
|
54 } |
|
55 |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // CStunServerSettings::CStunServerSettings |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 CStunServerSettings::~CStunServerSettings() |
|
62 { |
|
63 delete iAddress; |
|
64 delete iUsername; |
|
65 delete iPassword; |
|
66 } |
|
67 |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // CStunServerSettings::SetUsernameL |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 void CStunServerSettings::SetAddressL( const TDesC8& aAddress ) |
|
74 { |
|
75 delete iAddress; |
|
76 iAddress = NULL; |
|
77 iAddress = aAddress.AllocL(); |
|
78 } |
|
79 |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // CStunServerSettings::Address |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 const TDesC8& CStunServerSettings::Address() const |
|
86 { |
|
87 return *iAddress; |
|
88 } |
|
89 |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // CStunServerSettings::SetPort |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 void CStunServerSettings::SetPort( TUint aPort ) |
|
96 { |
|
97 iPort = aPort; |
|
98 } |
|
99 |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // CStunServerSettings::Port |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 TUint CStunServerSettings::Port() const |
|
106 { |
|
107 return iPort; |
|
108 } |
|
109 |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CStunServerSettings::SetUsernameL |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 void CStunServerSettings::SetUsernameL( const TDesC8& aUsername ) |
|
116 { |
|
117 delete iUsername; |
|
118 iUsername = NULL; |
|
119 iUsername = aUsername.AllocL(); |
|
120 } |
|
121 |
|
122 |
|
123 // --------------------------------------------------------------------------- |
|
124 // CStunServerSettings::Username |
|
125 // --------------------------------------------------------------------------- |
|
126 // |
|
127 const HBufC8* CStunServerSettings::Username() const |
|
128 { |
|
129 return iUsername; |
|
130 } |
|
131 |
|
132 |
|
133 // --------------------------------------------------------------------------- |
|
134 // CStunServerSettings::SetPasswordL |
|
135 // --------------------------------------------------------------------------- |
|
136 // |
|
137 void CStunServerSettings::SetPasswordL( const TDesC8& aPassword ) |
|
138 { |
|
139 delete iPassword; |
|
140 iPassword = NULL; |
|
141 iPassword = aPassword.AllocL(); |
|
142 } |
|
143 |
|
144 |
|
145 // --------------------------------------------------------------------------- |
|
146 // CStunServerSettings::Password |
|
147 // --------------------------------------------------------------------------- |
|
148 // |
|
149 const HBufC8* CStunServerSettings::Password() const |
|
150 { |
|
151 return iPassword; |
|
152 } |