001 package com.skype.api;
002
003 import com.skype.ipc.SidRoot;
004 import com.skype.ipc.SidObject;
005 import com.skype.ipc.EnumConverting;
006 import com.skype.ipc.PropertyEnumConverting;
007 import com.skype.ipc.Decoding;
008 import com.skype.ipc.Encoding;
009 import com.skype.ipc.Encoding;
010 import java.io.IOException;
011 import com.skype.ipc.PropertyEnumConverting;
012 import com.skype.api.Contact;
013 import com.skype.ipc.SidGetResponding;
014
015 /**
016 * Represents a local account. Encapsulates methods for Skype account creation, login and logout as well as account profile setting properties. NB! Unlike all the other SkypeKit classes, most of the Account class properties are actually read-write. In fact, there are two sorts of Account's read-write properties: server-side properties and local properties. Different setter methods need to be used for those two kinds.
017 *
018 * The subset of server-side properties consists of all the policy properties (everything with _POLICY suffix) that are all of type int and can be set with SetServersideIntProperty method. There is currently only one server-side string property - OFFLINE_CALLFORWARD which can be set with SetServersideStrProperty setter.
019 *
020 * The set of writeable account profile properties (local profile) is as follows;
021 * - P_FULLNAME,
022 * - P_BIRTHDAY,
023 * - P_GENDER,
024 * - P_LANGUAGES,
025 * - P_COUNTRY,
026 * - P_PROVINCE,
027 * - P_CITY,
028 * - P_PHONE_HOME,
029 * - P_PHONE_OFFICE,
030 * - P_PHONE_MOBILE,
031 * - P_EMAILS,
032 * - P_HOMEPAGE,
033 * - P_ABOUT,
034 * - P_MOOD_TEXT,
035 * - P_TIMEZONE,
036 * - P_AVATAR_IMAGE,
037 * - P_RICH_MOOD_TEXT
038 *
039 * These can be set with SetIntProperty, SetStrProperty and SetBinProperty setter methods. Note that there are special methods for changing account online status (availability) and enabling/disabling auto-login - SetAvailability and SetSavePwd.
040 *
041 * Note that to set Account properties, you that Account needs to be logged in. Generally, assumption is that the first thing you do with an Account object after you retrieve it with Skype.GetAccount is login, with exception of creating a new account.
042 *
043 * The Account class has no default constructor and creating an Account instance is not the same as creating a Skype account. To create a Skype account:
044 *
045 * - obtain an Account instance by invoking Skype.GetAccount. This automatically sets P_SKYPENAME.
046 * - set any additional profile-related properties. Skype recommends that you minimally set the following:
047 * - their email address so that they can retrieve a lost password (P_EMAILS)
048 * - the user's full name (P_FULLNAME)
049 * - at least one phone number (P_PHONE_HOME, P_PHONE_HOME, P_PHONE_OFFICE)
050 * - invoke Account.Register to actually create the account
051 */
052 public final class Account extends SidObject {
053 public enum Status implements EnumConverting {
054 LOGGED_OUT (1),
055 /** the account is logged out, but password is not needed for re-login */
056 LOGGED_OUT_AND_PWD_SAVED(2),
057 /** connecting to P2P network */
058 CONNECTING_TO_P2P (3),
059 /** connecting to login server */
060 CONNECTING_TO_SERVER (4),
061 /** waiting for response from server */
062 LOGGING_IN (5),
063 /** response OK. initialising account-specific lib structures */
064 INITIALIZING (6),
065 /** alright, we're good to go! */
066 LOGGED_IN (7),
067 /** Logout() has been called but not processed yet */
068 LOGGING_OUT (8);
069 private final int key;
070 Status(int key) {
071 this.key = key;
072 };
073 public int getId() { return key; }
074 public EnumConverting getDefault() { return LOGGED_OUT; }
075 public EnumConverting convert(int from) { return Status.get(from); }
076 public EnumConverting[] getArray(final int size) { return new Status[size]; }
077 public static Status get(int from) {
078 switch (from) {
079 case 1: return LOGGED_OUT;
080 case 2: return LOGGED_OUT_AND_PWD_SAVED;
081 case 3: return CONNECTING_TO_P2P;
082 case 4: return CONNECTING_TO_SERVER;
083 case 5: return LOGGING_IN;
084 case 6: return INITIALIZING;
085 case 7: return LOGGED_IN;
086 case 8: return LOGGING_OUT;
087 }
088 return LOGGED_OUT;
089 }
090 public static final int LOGGED_OUT_VALUE = 1;
091 public static final int LOGGED_OUT_AND_PWD_SAVED_VALUE = 2;
092 public static final int CONNECTING_TO_P2P_VALUE = 3;
093 public static final int CONNECTING_TO_SERVER_VALUE = 4;
094 public static final int LOGGING_IN_VALUE = 5;
095 public static final int INITIALIZING_VALUE = 6;
096 public static final int LOGGED_IN_VALUE = 7;
097 public static final int LOGGING_OUT_VALUE = 8;
098 }
099 /**
100 * Recognized values for the P_CBLSYNCSTATUS property. CBL stands for Central Buddy List. In principle, this property and its states can be ignored by most UI developers. However, it can help to optimize UI buildup and behaviour, particularly in case of limited resources (such as mobile devices).
101 *
102 * CBL is used to backup your contact list, contact groups, and profile information, and also used to synchronize this information with other Skype instances of your account (i.e. on another device). CBL sync can occur both during login and during normal operation. Note that CBL synchronization does not take place immediately after an Account property is changed. A delay between the first property change and CBL sync initiation enables the client to accumulate changes and do the synchronization in bulk.
103 *
104 * Clients with limited resources might want to wait for CBL_IN_SYNC status before generating their UI's contact list representation. Otherwise it might be forced to redraw the contact list multiple times, as new updates get retrieved from the server-side. Similarly, applications that modify an account's mood message might want to know when the P_MOOD_TEXT or P_RICH_MOOD_TEXT property is synchronized to the server. Note that this sync is only for CBL and other logged in instances of the same account - other contacts will receive the mood message update directly.
105 */
106 public enum CblSyncStatus implements EnumConverting {
107 /** status is not clear (yet) */
108 CBL_INITIALIZING (0),
109 /** first sync with empty profile */
110 CBL_INITIAL_SYNC_PENDING(1),
111 /** Account properties are considered to be out of sync with CBL - attempt at synchronization is imminent. You might wish to wait with updating UI components that display the data that is about to change anyway. */
112 CBL_SYNC_PENDING (2),
113 /** CBL synchronization is currently taking place. */
114 CBL_SYNC_IN_PROGRESS (3),
115 /** Account properties are up-to-date. */
116 CBL_IN_SYNC (4),
117 /** CBL sync has. Another attempt will be made after several minutes. If a second attempt also fails, subsequent attempts at synchronization will be made at ever increasing intervals. */
118 CBL_SYNC_FAILED (5),
119 /** we have received a hint that there is a remote data change in CBL */
120 CBL_REMOTE_SYNC_PENDING (6);
121 private final int key;
122 CblSyncStatus(int key) {
123 this.key = key;
124 };
125 public int getId() { return key; }
126 public EnumConverting getDefault() { return CBL_INITIALIZING; }
127 public EnumConverting convert(int from) { return CblSyncStatus.get(from); }
128 public EnumConverting[] getArray(final int size) { return new CblSyncStatus[size]; }
129 public static CblSyncStatus get(int from) {
130 switch (from) {
131 case 0: return CBL_INITIALIZING;
132 case 1: return CBL_INITIAL_SYNC_PENDING;
133 case 2: return CBL_SYNC_PENDING;
134 case 3: return CBL_SYNC_IN_PROGRESS;
135 case 4: return CBL_IN_SYNC;
136 case 5: return CBL_SYNC_FAILED;
137 case 6: return CBL_REMOTE_SYNC_PENDING;
138 }
139 return CBL_INITIALIZING;
140 }
141 public static final int CBL_INITIALIZING_VALUE = 0;
142 public static final int CBL_INITIAL_SYNC_PENDING_VALUE = 1;
143 public static final int CBL_SYNC_PENDING_VALUE = 2;
144 public static final int CBL_SYNC_IN_PROGRESS_VALUE = 3;
145 public static final int CBL_IN_SYNC_VALUE = 4;
146 public static final int CBL_SYNC_FAILED_VALUE = 5;
147 public static final int CBL_REMOTE_SYNC_PENDING_VALUE = 6;
148 }
149 /** Recognized values for the Account.P_LOGOUTREASON. Note that this property should only be examined when Account.P_STATUS is LOGGED_OUT or LOGGED_OUT_AND_PWD_SAVED. That is, you should not monitor changes to this property in Account.OnChange callback, other than after already having checked that P_STATUS property has appropriate value. The reason for this is that the LOGOUTREASON does not get reset before the next login attempt. For example: if a user tried to log in with a wrong password, the LOGOUTREASON gets set to INCORRECT_PASSWORD. Now, if the user tries to log in again, and yet again submits an incorrect password, the value of the LOGOUTREASON does not change anymore, because it already is set to INCORRECT_PASSWORD. Consequently, Account.OnChange will not fire in this case. */ public enum LogoutReason implements EnumConverting {
150 /** manual logout (or unknown reason from previous session) */
151 LOGOUT_CALLED (1),
152 /** sync errors at login/registration */
153 HTTPS_PROXY_AUTH_FAILED (2),
154 /** sync errors at login/registration */
155 SOCKS_PROXY_AUTH_FAILED (3),
156 /** sync errors at login/registration */
157 P2P_CONNECT_FAILED (4),
158 /** sync errors at login/registration */
159 SERVER_CONNECT_FAILED (5),
160 /** sync errors at login/registration */
161 SERVER_OVERLOADED (6),
162 /** sync errors at login/registration */
163 DB_IN_USE (7),
164 /** sync errors at registration */
165 INVALID_SKYPENAME (8),
166 /** sync errors at registration */
167 INVALID_EMAIL (9),
168 /** sync errors at registration */
169 UNACCEPTABLE_PASSWORD (10),
170 /** sync errors at registration */
171 SKYPENAME_TAKEN (11),
172 /** sync errors at registration */
173 REJECTED_AS_UNDERAGE (12),
174 /** sync errors at login */
175 NO_SUCH_IDENTITY (13),
176 /** sync errors at login */
177 INCORRECT_PASSWORD (14),
178 /** sync errors at login */
179 TOO_MANY_LOGIN_ATTEMPTS (15),
180 /** async errors (can happen anytime while logged in) */
181 PASSWORD_HAS_CHANGED (16),
182 /** async errors (can happen anytime while logged in) */
183 PERIODIC_UIC_UPDATE_FAILED(17),
184 /** async errors (can happen anytime while logged in) */
185 DB_DISK_FULL (18),
186 /** async errors (can happen anytime while logged in) */
187 DB_IO_ERROR (19),
188 /** async errors (can happen anytime while logged in) */
189 DB_CORRUPT (20),
190 /** deprecated (superceded by more detailed DB_* errors) */
191 DB_FAILURE (21),
192 /** platform sdk */
193 INVALID_APP_ID (22),
194 /** platform sdk */
195 APP_ID_FAILURE (23),
196 /** forced upgrade/discontinuation */
197 UNSUPPORTED_VERSION (24);
198 private final int key;
199 LogoutReason(int key) {
200 this.key = key;
201 };
202 public int getId() { return key; }
203 public EnumConverting getDefault() { return LOGOUT_CALLED; }
204 public EnumConverting convert(int from) { return LogoutReason.get(from); }
205 public EnumConverting[] getArray(final int size) { return new LogoutReason[size]; }
206 public static LogoutReason get(int from) {
207 switch (from) {
208 case 1: return LOGOUT_CALLED;
209 case 2: return HTTPS_PROXY_AUTH_FAILED;
210 case 3: return SOCKS_PROXY_AUTH_FAILED;
211 case 4: return P2P_CONNECT_FAILED;
212 case 5: return SERVER_CONNECT_FAILED;
213 case 6: return SERVER_OVERLOADED;
214 case 7: return DB_IN_USE;
215 case 8: return INVALID_SKYPENAME;
216 case 9: return INVALID_EMAIL;
217 case 10: return UNACCEPTABLE_PASSWORD;
218 case 11: return SKYPENAME_TAKEN;
219 case 12: return REJECTED_AS_UNDERAGE;
220 case 13: return NO_SUCH_IDENTITY;
221 case 14: return INCORRECT_PASSWORD;
222 case 15: return TOO_MANY_LOGIN_ATTEMPTS;
223 case 16: return PASSWORD_HAS_CHANGED;
224 case 17: return PERIODIC_UIC_UPDATE_FAILED;
225 case 18: return DB_DISK_FULL;
226 case 19: return DB_IO_ERROR;
227 case 20: return DB_CORRUPT;
228 case 21: return DB_FAILURE;
229 case 22: return INVALID_APP_ID;
230 case 23: return APP_ID_FAILURE;
231 case 24: return UNSUPPORTED_VERSION;
232 }
233 return LOGOUT_CALLED;
234 }
235 public static final int LOGOUT_CALLED_VALUE = 1;
236 public static final int HTTPS_PROXY_AUTH_FAILED_VALUE = 2;
237 public static final int SOCKS_PROXY_AUTH_FAILED_VALUE = 3;
238 public static final int P2P_CONNECT_FAILED_VALUE = 4;
239 public static final int SERVER_CONNECT_FAILED_VALUE = 5;
240 public static final int SERVER_OVERLOADED_VALUE = 6;
241 public static final int DB_IN_USE_VALUE = 7;
242 public static final int INVALID_SKYPENAME_VALUE = 8;
243 public static final int INVALID_EMAIL_VALUE = 9;
244 public static final int UNACCEPTABLE_PASSWORD_VALUE = 10;
245 public static final int SKYPENAME_TAKEN_VALUE = 11;
246 public static final int REJECTED_AS_UNDERAGE_VALUE = 12;
247 public static final int NO_SUCH_IDENTITY_VALUE = 13;
248 public static final int INCORRECT_PASSWORD_VALUE = 14;
249 public static final int TOO_MANY_LOGIN_ATTEMPTS_VALUE = 15;
250 public static final int PASSWORD_HAS_CHANGED_VALUE = 16;
251 public static final int PERIODIC_UIC_UPDATE_FAILED_VALUE = 17;
252 public static final int DB_DISK_FULL_VALUE = 18;
253 public static final int DB_IO_ERROR_VALUE = 19;
254 public static final int DB_CORRUPT_VALUE = 20;
255 public static final int DB_FAILURE_VALUE = 21;
256 public static final int INVALID_APP_ID_VALUE = 22;
257 public static final int APP_ID_FAILURE_VALUE = 23;
258 public static final int UNSUPPORTED_VERSION_VALUE = 24;
259 }
260 /**
261 * Recognized values for the P_PWDCHANGESTATUS property that provides information on whether a password change succeeded or failed, giving detailed failure reason. After successful return from the Change Password method, clients should monitor the P_PWDCHANGESTATUS property changes.
262 * - PWD_CHANGING - consider displaying an "in progress" indicator and continue polling
263 * - PWD_OK - consider displaying an updated indicator and stop polling
264 * - PWD_OK_BUT_CHANGE_SUGGESTED - consider displaying an updated indicator, along with a recommendation to change again to a stronger password.
265 */
266 public enum PwdChangeStatus implements EnumConverting {
267 /** Password change succeeded. */
268 PWD_OK (0),
269 /** Password change is in progress. */
270 PWD_CHANGING (1),
271 /** Old password was incorrect. */
272 PWD_INVALID_OLD_PASSWORD (2),
273 /** Failed to verify password because of no connection to server. */
274 PWD_SERVER_CONNECT_FAILED (3),
275 /** Password was set but server didn't like it much. */
276 PWD_OK_BUT_CHANGE_SUGGESTED(4),
277 /** New password was exactly the same as old one. */
278 PWD_MUST_DIFFER_FROM_OLD (5),
279 /** The new password was unacceptable. (too short, too simple, etc.) */
280 PWD_INVALID_NEW_PWD (6),
281 /** Account was currently not logged in. */
282 PWD_MUST_LOG_IN_TO_CHANGE (7);
283 private final int key;
284 PwdChangeStatus(int key) {
285 this.key = key;
286 };
287 public int getId() { return key; }
288 public EnumConverting getDefault() { return PWD_OK; }
289 public EnumConverting convert(int from) { return PwdChangeStatus.get(from); }
290 public EnumConverting[] getArray(final int size) { return new PwdChangeStatus[size]; }
291 public static PwdChangeStatus get(int from) {
292 switch (from) {
293 case 0: return PWD_OK;
294 case 1: return PWD_CHANGING;
295 case 2: return PWD_INVALID_OLD_PASSWORD;
296 case 3: return PWD_SERVER_CONNECT_FAILED;
297 case 4: return PWD_OK_BUT_CHANGE_SUGGESTED;
298 case 5: return PWD_MUST_DIFFER_FROM_OLD;
299 case 6: return PWD_INVALID_NEW_PWD;
300 case 7: return PWD_MUST_LOG_IN_TO_CHANGE;
301 }
302 return PWD_OK;
303 }
304 public static final int PWD_OK_VALUE = 0;
305 public static final int PWD_CHANGING_VALUE = 1;
306 public static final int PWD_INVALID_OLD_PASSWORD_VALUE = 2;
307 public static final int PWD_SERVER_CONNECT_FAILED_VALUE = 3;
308 public static final int PWD_OK_BUT_CHANGE_SUGGESTED_VALUE = 4;
309 public static final int PWD_MUST_DIFFER_FROM_OLD_VALUE = 5;
310 public static final int PWD_INVALID_NEW_PWD_VALUE = 6;
311 public static final int PWD_MUST_LOG_IN_TO_CHANGE_VALUE = 7;
312 }
313 /** The list of possible values of Account class COMMITSTATUS property. Note that this property and its values have nothing to do with (automatic) CBL synchronization. Rather, the COMMITSTATUS reflects commit status to account's server side properties initiated with calls to Account class SetServersideIntProperty and Account class SetServersideStrProperty methods. After those methods, your client UI may want to wait until the COMMITSTATUS becomes COMMITTING_TO_SERVER followed by COMMITTED and inform the user if the value becomes COMMIT_FAILED. SetServerside<type>Property methods are used for writing privacy policy related and call forwarding related Account properties to the server. Unlike CBL synchronization, those updates are executed immediately. */ public enum CommitStatus implements EnumConverting {
314 /** No pending updates to the server. */
315 COMMITTED (1),
316 /** Update to the server in progress. */
317 COMMITTING_TO_SERVER(2),
318 /** Server update has failed. */
319 COMMIT_FAILED (3);
320 private final int key;
321 CommitStatus(int key) {
322 this.key = key;
323 };
324 public int getId() { return key; }
325 public EnumConverting getDefault() { return COMMITTED; }
326 public EnumConverting convert(int from) { return CommitStatus.get(from); }
327 public EnumConverting[] getArray(final int size) { return new CommitStatus[size]; }
328 public static CommitStatus get(int from) {
329 switch (from) {
330 case 1: return COMMITTED;
331 case 2: return COMMITTING_TO_SERVER;
332 case 3: return COMMIT_FAILED;
333 }
334 return COMMITTED;
335 }
336 public static final int COMMITTED_VALUE = 1;
337 public static final int COMMITTING_TO_SERVER_VALUE = 2;
338 public static final int COMMIT_FAILED_VALUE = 3;
339 }
340 /** Recognized values for the P_CHAT_POLICY property that controls whether non-authorized users can initiate text chat with the currently logged in account. Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntProperty */
341 public enum ChatPolicy implements EnumConverting {
342 /** Unauthorized contacts can initiate text chat. */
343 EVERYONE_CAN_ADD (0),
344 /** Only authorized contacts can initiate chat (default policy). */
345 BUDDIES_OR_AUTHORIZED_CAN_ADD(2);
346 private final int key;
347 ChatPolicy(int key) {
348 this.key = key;
349 };
350 public int getId() { return key; }
351 public EnumConverting getDefault() { return EVERYONE_CAN_ADD; }
352 public EnumConverting convert(int from) { return ChatPolicy.get(from); }
353 public EnumConverting[] getArray(final int size) { return new ChatPolicy[size]; }
354 public static ChatPolicy get(int from) {
355 switch (from) {
356 case 0: return EVERYONE_CAN_ADD;
357 case 2: return BUDDIES_OR_AUTHORIZED_CAN_ADD;
358 }
359 return EVERYONE_CAN_ADD;
360 }
361 public static final int EVERYONE_CAN_ADD_VALUE = 0;
362 public static final int BUDDIES_OR_AUTHORIZED_CAN_ADD_VALUE = 2;
363 }
364 /** Recognized values for the P_SKYPECALLPOLICY property that controls acceptance of incoming Skype calls. Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntPropertyserver-side. */
365 public enum SkypeCallPolicy implements EnumConverting {
366 /** Skype calls accepted from unauthorized contacts. */
367 EVERYONE_CAN_CALL (0),
368 /** Skype calls not accepted from unauthorized contacts. */
369 BUDDIES_OR_AUTHORIZED_CAN_CALL(2);
370 private final int key;
371 SkypeCallPolicy(int key) {
372 this.key = key;
373 };
374 public int getId() { return key; }
375 public EnumConverting getDefault() { return EVERYONE_CAN_CALL; }
376 public EnumConverting convert(int from) { return SkypeCallPolicy.get(from); }
377 public EnumConverting[] getArray(final int size) { return new SkypeCallPolicy[size]; }
378 public static SkypeCallPolicy get(int from) {
379 switch (from) {
380 case 0: return EVERYONE_CAN_CALL;
381 case 2: return BUDDIES_OR_AUTHORIZED_CAN_CALL;
382 }
383 return EVERYONE_CAN_CALL;
384 }
385 public static final int EVERYONE_CAN_CALL_VALUE = 0;
386 public static final int BUDDIES_OR_AUTHORIZED_CAN_CALL_VALUE = 2;
387 }
388 /** Recognized values for the P_PSTNCALLPOLICY property that controls whether (and from whom) this account accepts incoming PSTN calls. Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntProperty */
389 public enum PstnCallPolicy implements EnumConverting {
390 /** All incoming PSTN calls are accepted. */
391 ALL_NUMBERS_CAN_CALL (0),
392 /** Only PSTN calls that report caller ID are accepted. */
393 DISCLOSED_NUMBERS_CAN_CALL(1),
394 /** Only calls from PSTN numbers found in local contact list are accepted. */
395 BUDDY_NUMBERS_CAN_CALL (2);
396 private final int key;
397 PstnCallPolicy(int key) {
398 this.key = key;
399 };
400 public int getId() { return key; }
401 public EnumConverting getDefault() { return ALL_NUMBERS_CAN_CALL; }
402 public EnumConverting convert(int from) { return PstnCallPolicy.get(from); }
403 public EnumConverting[] getArray(final int size) { return new PstnCallPolicy[size]; }
404 public static PstnCallPolicy get(int from) {
405 switch (from) {
406 case 0: return ALL_NUMBERS_CAN_CALL;
407 case 1: return DISCLOSED_NUMBERS_CAN_CALL;
408 case 2: return BUDDY_NUMBERS_CAN_CALL;
409 }
410 return ALL_NUMBERS_CAN_CALL;
411 }
412 public static final int ALL_NUMBERS_CAN_CALL_VALUE = 0;
413 public static final int DISCLOSED_NUMBERS_CAN_CALL_VALUE = 1;
414 public static final int BUDDY_NUMBERS_CAN_CALL_VALUE = 2;
415 }
416 /**
417 * Recognized values for the P_AVATAR_POLICY property that controls whether remote contacts can view local account's avatar image. Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntPropertyserver-side.
418 * Note that setting account's AVATAR_POLICY to BUDDIES_OR_AUTHORIZED_CAN_SEE does not guarantee that remote users will be able to immediately retrieve the avatar picture via corresponding Contact object. Avatar changes propagate between clients only when direct sessions between clients are established. Direct sessions are established during live sessions or whilst online contacts are engaged in chat.
419 */
420 public enum AvatarPolicy implements EnumConverting {
421 /** Only authorized remote users can see this user's avatar image */
422 BUDDIES_OR_AUTHORIZED_CAN_SEE(0),
423 /** Everyone can see this user's avatar image, once the contact/account avatar property has been synchronized during a direct session. The avatar image may also become viewable on some Skype Web-based services. */
424 EVERYONE_CAN_SEE (2);
425 private final int key;
426 AvatarPolicy(int key) {
427 this.key = key;
428 };
429 public int getId() { return key; }
430 public EnumConverting getDefault() { return BUDDIES_OR_AUTHORIZED_CAN_SEE; }
431 public EnumConverting convert(int from) { return AvatarPolicy.get(from); }
432 public EnumConverting[] getArray(final int size) { return new AvatarPolicy[size]; }
433 public static AvatarPolicy get(int from) {
434 switch (from) {
435 case 0: return BUDDIES_OR_AUTHORIZED_CAN_SEE;
436 case 2: return EVERYONE_CAN_SEE;
437 }
438 return BUDDIES_OR_AUTHORIZED_CAN_SEE;
439 }
440 public static final int BUDDIES_OR_AUTHORIZED_CAN_SEE_VALUE = 0;
441 public static final int EVERYONE_CAN_SEE_VALUE = 2;
442 }
443 /**
444 * Recognized values for the P_BUDDYCOUNT_POLICY property that controls whether the number of this user's authorized contacts is visible to other users, either through Account.GetPropNrofAuthedBuddies or Contact.GetPropNrofAuthedBuddies when those instances reference this user. Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntProperty, like this:
445 * account->SetServersideIntProperty(Account.P_BUDDYCOUNT_POLICY, Account.DISCLOSE_TO_AUTHORIZED);
446 * account->SetServersideIntProperty(Account.P_BUDDYCOUNT_POLICY, Account.DISCLOSE_TO_NOONE );
447 */
448 public enum BuddyCountPolicy implements EnumConverting {
449 /** Authorized remote users can retrieve the number of this user's authorized contacts (Contact.P_NROF_AUTHED_BUDDIES) */
450 DISCLOSE_TO_AUTHORIZED(0),
451 /** No remote user - regardless their authorization status - can retrieve the number of this user's authorized contacts. Account.GetPropNrofAuthedBuddies and Contact.GetPropNrofAuthedBuddies will always return 0 */
452 DISCLOSE_TO_NOONE (1);
453 private final int key;
454 BuddyCountPolicy(int key) {
455 this.key = key;
456 };
457 public int getId() { return key; }
458 public EnumConverting getDefault() { return DISCLOSE_TO_AUTHORIZED; }
459 public EnumConverting convert(int from) { return BuddyCountPolicy.get(from); }
460 public EnumConverting[] getArray(final int size) { return new BuddyCountPolicy[size]; }
461 public static BuddyCountPolicy get(int from) {
462 switch (from) {
463 case 0: return DISCLOSE_TO_AUTHORIZED;
464 case 1: return DISCLOSE_TO_NOONE; }
465 return DISCLOSE_TO_AUTHORIZED;
466 }
467 public static final int DISCLOSE_TO_AUTHORIZED_VALUE = 0;
468 public static final int DISCLOSE_TO_NOONE_VALUE = 1;
469 }
470 /** Recognized values for the P_TIMEZONEPOLICY property that sets the rules for timezone offset so remote clients can determine your local time. Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntPropertyserver-side. */
471 public enum TimezonePolicy implements EnumConverting {
472 /** Account's timezone setting is determined automatically. */
473 TZ_AUTOMATIC (0),
474 /** Account's timezone setting is set manually. */
475 TZ_MANUAL (1),
476 /** Remote users will have no idea what your local time is. */
477 TZ_UNDISCLOSED(2);
478 private final int key;
479 TimezonePolicy(int key) {
480 this.key = key;
481 };
482 public int getId() { return key; }
483 public EnumConverting getDefault() { return TZ_AUTOMATIC; }
484 public EnumConverting convert(int from) { return TimezonePolicy.get(from); }
485 public EnumConverting[] getArray(final int size) { return new TimezonePolicy[size]; }
486 public static TimezonePolicy get(int from) {
487 switch (from) {
488 case 0: return TZ_AUTOMATIC;
489 case 1: return TZ_MANUAL;
490 case 2: return TZ_UNDISCLOSED;
491 }
492 return TZ_AUTOMATIC;
493 }
494 public static final int TZ_AUTOMATIC_VALUE = 0;
495 public static final int TZ_MANUAL_VALUE = 1;
496 public static final int TZ_UNDISCLOSED_VALUE = 2;
497 }
498 /** Recognized values for the P_WEBPRESENCEPOLICY property that controls whether your online status (presence) can be seen using the "Skype buttons" ( http://www.skype.com/share/buttons/ ) embedded in web pages. Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntPropertyserver-side. */
499 public enum WebPresencePolicy implements EnumConverting {
500 /** Disable displaying online status on web for this account. */
501 WEBPRESENCE_DISABLED(0),
502 /** Enable displaying online status on web for this account. */
503 WEBPRESENCE_ENABLED (1);
504 private final int key;
505 WebPresencePolicy(int key) {
506 this.key = key;
507 };
508 public int getId() { return key; }
509 public EnumConverting getDefault() { return WEBPRESENCE_DISABLED; }
510 public EnumConverting convert(int from) { return WebPresencePolicy.get(from); }
511 public EnumConverting[] getArray(final int size) { return new WebPresencePolicy[size]; }
512 public static WebPresencePolicy get(int from) {
513 switch (from) {
514 case 0: return WEBPRESENCE_DISABLED;
515 case 1: return WEBPRESENCE_ENABLED;
516 }
517 return WEBPRESENCE_DISABLED;
518 }
519 public static final int WEBPRESENCE_DISABLED_VALUE = 0;
520 public static final int WEBPRESENCE_ENABLED_VALUE = 1;
521 }
522 /** Recognized values for the P_PHONENUMBERSPOLICY property that controls whether unauthorized remote users can see associated phone numbers in their UI (for reference, see the different phone number tabs in Windows desktop Client contact view). Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntProperty */
523 public enum PhoneNumbersPolicy implements EnumConverting {
524 /** Only authorized contacts can see the phone numbers. */
525 PHONENUMBERS_VISIBLE_FOR_BUDDIES (0),
526 /** Everyone can see the phone numbers. */
527 PHONENUMBERS_VISIBLE_FOR_EVERYONE(1);
528 private final int key;
529 PhoneNumbersPolicy(int key) {
530 this.key = key;
531 };
532 public int getId() { return key; }
533 public EnumConverting getDefault() { return PHONENUMBERS_VISIBLE_FOR_BUDDIES; }
534 public EnumConverting convert(int from) { return PhoneNumbersPolicy.get(from); }
535 public EnumConverting[] getArray(final int size) { return new PhoneNumbersPolicy[size]; }
536 public static PhoneNumbersPolicy get(int from) {
537 switch (from) {
538 case 0: return PHONENUMBERS_VISIBLE_FOR_BUDDIES;
539 case 1: return PHONENUMBERS_VISIBLE_FOR_EVERYONE;
540 }
541 return PHONENUMBERS_VISIBLE_FOR_BUDDIES;
542 }
543 public static final int PHONENUMBERS_VISIBLE_FOR_BUDDIES_VALUE = 0;
544 public static final int PHONENUMBERS_VISIBLE_FOR_EVERYONE_VALUE = 1;
545 }
546 /** Recognized values for the P_VOICEMAILPOLICY property that controls acceptance of incoming voicemail messages. Note that since this set of values is associated with a server-side property, you must set that property using Account.SetServersideIntPropertyserver-side. */
547 public enum VoicemailPolicy implements EnumConverting {
548 /** Incoming voicemails enabled. */
549 VOICEMAIL_ENABLED (0),
550 /** Incoming voicemails disabled. */
551 VOICEMAIL_DISABLED(1);
552 private final int key;
553 VoicemailPolicy(int key) {
554 this.key = key;
555 };
556 public int getId() { return key; }
557 public EnumConverting getDefault() { return VOICEMAIL_ENABLED; }
558 public EnumConverting convert(int from) { return VoicemailPolicy.get(from); }
559 public EnumConverting[] getArray(final int size) { return new VoicemailPolicy[size]; }
560 public static VoicemailPolicy get(int from) {
561 switch (from) {
562 case 0: return VOICEMAIL_ENABLED;
563 case 1: return VOICEMAIL_DISABLED;
564 }
565 return VOICEMAIL_ENABLED;
566 }
567 public static final int VOICEMAIL_ENABLED_VALUE = 0;
568 public static final int VOICEMAIL_DISABLED_VALUE = 1;
569 }
570 /** Account capabability statuses are possible values of Contact class CAPABILITY enumerator, when that enumerator is used in context of account. Compared to Contact class CAPABILITYSTATUS enums, Account class CAPABILITYSTATUS has additional items for subscription expiration warnings. */
571 public enum CapabilityStatus implements EnumConverting {
572 /** Capability is not supported by the currently logged in SkypeKit client. */
573 NO_CAPABILITY (0),
574 /** Capability is supported by the currently logged in SkypeKit client. */
575 CAPABILITY_EXISTS (1),
576 /** Support for this capability ends this month (within 30 days) */
577 FIRST_EXPIRY_WARNING (2),
578 /** Support for this capability ends this week (within 7 days) */
579 SECOND_EXPIRY_WARNING(3),
580 /** Support for this capability ends today */
581 FINAL_EXPIRY_WARNING (4);
582 private final int key;
583 CapabilityStatus(int key) {
584 this.key = key;
585 };
586 public int getId() { return key; }
587 public EnumConverting getDefault() { return NO_CAPABILITY; }
588 public EnumConverting convert(int from) { return CapabilityStatus.get(from); }
589 public EnumConverting[] getArray(final int size) { return new CapabilityStatus[size]; }
590 public static CapabilityStatus get(int from) {
591 switch (from) {
592 case 0: return NO_CAPABILITY;
593 case 1: return CAPABILITY_EXISTS;
594 case 2: return FIRST_EXPIRY_WARNING;
595 case 3: return SECOND_EXPIRY_WARNING;
596 case 4: return FINAL_EXPIRY_WARNING;
597 }
598 return NO_CAPABILITY;
599 }
600 public static final int NO_CAPABILITY_VALUE = 0;
601 public static final int CAPABILITY_EXISTS_VALUE = 1;
602 public static final int FIRST_EXPIRY_WARNING_VALUE = 2;
603 public static final int SECOND_EXPIRY_WARNING_VALUE = 3;
604 public static final int FINAL_EXPIRY_WARNING_VALUE = 4;
605 }
606 private final static byte[] P_STATUS_req = {(byte) 90,(byte) 71,(byte) 70,(byte) 93,(byte) 5};
607 private final static byte[] P_PWD_CHANGE_STATUS_req = {(byte) 90,(byte) 71,(byte) 71,(byte) 93,(byte) 5};
608 private final static byte[] P_LOGOUT_REASON_req = {(byte) 90,(byte) 71,(byte) 73,(byte) 93,(byte) 5};
609 private final static byte[] P_COMMIT_STATUS_req = {(byte) 90,(byte) 71,(byte) 78,(byte) 93,(byte) 5};
610 private final static byte[] P_SUGGESTED_SKYPE_NAME_req = {(byte) 90,(byte) 71,(byte) 72,(byte) 93,(byte) 5};
611 private final static byte[] P_SKYPEOUT_BALANCE_CURRENCY_req = {(byte) 90,(byte) 71,(byte) 74,(byte) 93,(byte) 5};
612 private final static byte[] P_SKYPEOUT_BALANCE_req = {(byte) 90,(byte) 71,(byte) 75,(byte) 93,(byte) 5};
613 private final static byte[] P_SKYPEOUT_PRECISION_req = {(byte) 90,(byte) 71,(byte) 164,(byte) 6,(byte) 93,(byte) 5};
614 private final static byte[] P_SKYPEIN_NUMBERS_req = {(byte) 90,(byte) 71,(byte) 76,(byte) 93,(byte) 5};
615 private final static byte[] P_CBL_SYNC_STATUS_req = {(byte) 90,(byte) 71,(byte) 79,(byte) 93,(byte) 5};
616 private final static byte[] P_OFFLINE_CALL_FORWARD_req = {(byte) 90,(byte) 71,(byte) 77,(byte) 93,(byte) 5}; private final static byte[] P_CHAT_POLICY_req = {(byte) 90,(byte) 71,(byte) 160,(byte) 1,(byte) 93,(byte) 5};
617 private final static byte[] P_SKYPE_CALL_POLICY_req = {(byte) 90,(byte) 71,(byte) 161,(byte) 1,(byte) 93,(byte) 5};
618 private final static byte[] P_PSTN_CALL_POLICY_req = {(byte) 90,(byte) 71,(byte) 162,(byte) 1,(byte) 93,(byte) 5};
619 private final static byte[] P_AVATAR_POLICY_req = {(byte) 90,(byte) 71,(byte) 163,(byte) 1,(byte) 93,(byte) 5};
620 private final static byte[] P_BUDDY_COUNT_POLICY_req = {(byte) 90,(byte) 71,(byte) 164,(byte) 1,(byte) 93,(byte) 5};
621 private final static byte[] P_TIMEZONE_POLICY_req = {(byte) 90,(byte) 71,(byte) 165,(byte) 1,(byte) 93,(byte) 5};
622 private final static byte[] P_WEB_PRESENCE_POLICY_req = {(byte) 90,(byte) 71,(byte) 166,(byte) 1,(byte) 93,(byte) 5};
623 private final static byte[] P_PHONE_NUMBERS_POLICY_req = {(byte) 90,(byte) 71,(byte) 168,(byte) 1,(byte) 93,(byte) 5};
624 private final static byte[] P_VOICEMAIL_POLICY_req = {(byte) 90,(byte) 71,(byte) 169,(byte) 1,(byte) 93,(byte) 5};
625 private final static byte[] P_PARTNER_OPTED_OUT_req = {(byte) 90,(byte) 71,(byte) 133,(byte) 6,(byte) 93,(byte) 5};
626 private final static byte[] P_SERVICE_PROVIDER_INFO_req = {(byte) 90,(byte) 71,(byte) 160,(byte) 6,(byte) 93,(byte) 5};
627 private final static byte[] P_REGISTRATION_TIMESTAMP_req = {(byte) 90,(byte) 71,(byte) 161,(byte) 6,(byte) 93,(byte) 5};
628 private final static byte[] P_OTHER_INSTANCES_COUNT_req = {(byte) 90,(byte) 71,(byte) 162,(byte) 6,(byte) 93,(byte) 5};
629 private final static byte[] P_SKYPE_NAME_req = {(byte) 90,(byte) 71,(byte) 4,(byte) 93,(byte) 5};
630 private final static byte[] P_FULL_NAME_req = {(byte) 90,(byte) 71,(byte) 5,(byte) 93,(byte) 5};
631 private final static byte[] P_BIRTHDAY_req = {(byte) 90,(byte) 71,(byte) 7,(byte) 93,(byte) 5};
632 private final static byte[] P_GENDER_req = {(byte) 90,(byte) 71,(byte) 8,(byte) 93,(byte) 5};
633 private final static byte[] P_LANGUAGES_req = {(byte) 90,(byte) 71,(byte) 9,(byte) 93,(byte) 5};
634 private final static byte[] P_COUNTRY_req = {(byte) 90,(byte) 71,(byte) 10,(byte) 93,(byte) 5};
635 private final static byte[] P_PROVINCE_req = {(byte) 90,(byte) 71,(byte) 11,(byte) 93,(byte) 5};
636 private final static byte[] P_CITY_req = {(byte) 90,(byte) 71,(byte) 12,(byte) 93,(byte) 5};
637 private final static byte[] P_PHONE_HOME_req = {(byte) 90,(byte) 71,(byte) 13,(byte) 93,(byte) 5};
638 private final static byte[] P_PHONE_OFFICE_req = {(byte) 90,(byte) 71,(byte) 14,(byte) 93,(byte) 5};
639 private final static byte[] P_PHONE_MOBILE_req = {(byte) 90,(byte) 71,(byte) 15,(byte) 93,(byte) 5};
640 private final static byte[] P_EMAILS_req = {(byte) 90,(byte) 71,(byte) 16,(byte) 93,(byte) 5};
641 private final static byte[] P_HOMEPAGE_req = {(byte) 90,(byte) 71,(byte) 17,(byte) 93,(byte) 5};
642 private final static byte[] P_ABOUT_req = {(byte) 90,(byte) 71,(byte) 18,(byte) 93,(byte) 5};
643 private final static byte[] P_PROFILE_TIMESTAMP_req = {(byte) 90,(byte) 71,(byte) 19,(byte) 93,(byte) 5};
644 private final static byte[] P_MOOD_TEXT_req = {(byte) 90,(byte) 71,(byte) 26,(byte) 93,(byte) 5};
645 private final static byte[] P_TIMEZONE_req = {(byte) 90,(byte) 71,(byte) 27,(byte) 93,(byte) 5};
646 private final static byte[] P_NROF_AUTHED_BUDDIES_req = {(byte) 90,(byte) 71,(byte) 28,(byte) 93,(byte) 5};
647 private final static byte[] P_AVAILABILITY_req = {(byte) 90,(byte) 71,(byte) 34,(byte) 93,(byte) 5};
648 private final static byte[] P_AVATAR_IMAGE_req = {(byte) 90,(byte) 71,(byte) 37,(byte) 93,(byte) 5};
649 private final static byte[] P_AVATAR_TIMESTAMP_req = {(byte) 90,(byte) 71,(byte) 182,(byte) 1,(byte) 93,(byte) 5};
650 private final static byte[] P_MOOD_TIMESTAMP_req = {(byte) 90,(byte) 71,(byte) 183,(byte) 1,(byte) 93,(byte) 5};
651 private final static byte[] P_RICH_MOOD_TEXT_req = {(byte) 90,(byte) 71,(byte) 205,(byte) 1,(byte) 93,(byte) 5};
652 /** Properties of the Account class */
653 public enum Property implements PropertyEnumConverting {
654 P_UNKNOWN (0,0,null,0,null),
655 P_STATUS (70, 1, P_STATUS_req, 0, Status.get(0)),
656 P_PWD_CHANGE_STATUS (71, 2, P_PWD_CHANGE_STATUS_req, 0, PwdChangeStatus.get(0)),
657 P_LOGOUT_REASON (73, 3, P_LOGOUT_REASON_req, 0, LogoutReason.get(0)),
658 P_COMMIT_STATUS (78, 4, P_COMMIT_STATUS_req, 0, CommitStatus.get(0)),
659 P_SUGGESTED_SKYPE_NAME (72, 5, P_SUGGESTED_SKYPE_NAME_req, 0, null),
660 P_SKYPEOUT_BALANCE_CURRENCY(74, 6, P_SKYPEOUT_BALANCE_CURRENCY_req, 0, null),
661 P_SKYPEOUT_BALANCE (75, 7, P_SKYPEOUT_BALANCE_req, 0, null),
662 P_SKYPEOUT_PRECISION (804, 8, P_SKYPEOUT_PRECISION_req, 0, null),
663 P_SKYPEIN_NUMBERS (76, 9, P_SKYPEIN_NUMBERS_req, 0, null),
664 P_CBL_SYNC_STATUS (79, 10, P_CBL_SYNC_STATUS_req, 0, CblSyncStatus.get(0)),
665 P_OFFLINE_CALL_FORWARD (77, 11, P_OFFLINE_CALL_FORWARD_req, 0, null),
666 P_CHAT_POLICY (160, 12, P_CHAT_POLICY_req, 0, ChatPolicy.get(0)),
667 P_SKYPE_CALL_POLICY (161, 13, P_SKYPE_CALL_POLICY_req, 0, SkypeCallPolicy.get(0)),
668 P_PSTN_CALL_POLICY (162, 14, P_PSTN_CALL_POLICY_req, 0, PstnCallPolicy.get(0)),
669 P_AVATAR_POLICY (163, 15, P_AVATAR_POLICY_req, 0, AvatarPolicy.get(0)),
670 P_BUDDY_COUNT_POLICY (164, 16, P_BUDDY_COUNT_POLICY_req, 0, BuddyCountPolicy.get(0)),
671 P_TIMEZONE_POLICY (165, 17, P_TIMEZONE_POLICY_req, 0, TimezonePolicy.get(0)),
672 P_WEB_PRESENCE_POLICY (166, 18, P_WEB_PRESENCE_POLICY_req, 0, WebPresencePolicy.get(0)),
673 P_PHONE_NUMBERS_POLICY (168, 19, P_PHONE_NUMBERS_POLICY_req, 0, PhoneNumbersPolicy.get(0)),
674 P_VOICEMAIL_POLICY (169, 20, P_VOICEMAIL_POLICY_req, 0, VoicemailPolicy.get(0)),
675 P_PARTNER_OPTED_OUT (773, 21, P_PARTNER_OPTED_OUT_req, 0, null),
676 P_SERVICE_PROVIDER_INFO (800, 22, P_SERVICE_PROVIDER_INFO_req, 0, null),
677 P_REGISTRATION_TIMESTAMP (801, 23, P_REGISTRATION_TIMESTAMP_req, 0, null),
678 P_OTHER_INSTANCES_COUNT (802, 24, P_OTHER_INSTANCES_COUNT_req, 0, null),
679 P_SKYPE_NAME (4, 25, P_SKYPE_NAME_req, 0, null),
680 P_FULL_NAME (5, 26, P_FULL_NAME_req, 0, null),
681 P_BIRTHDAY (7, 27, P_BIRTHDAY_req, 0, null),
682 P_GENDER (8, 28, P_GENDER_req, 0, null),
683 P_LANGUAGES (9, 29, P_LANGUAGES_req, 0, null),
684 P_COUNTRY (10, 30, P_COUNTRY_req, 0, null),
685 P_PROVINCE (11, 31, P_PROVINCE_req, 0, null),
686 P_CITY (12, 32, P_CITY_req, 0, null),
687 P_PHONE_HOME (13, 33, P_PHONE_HOME_req, 0, null),
688 P_PHONE_OFFICE (14, 34, P_PHONE_OFFICE_req, 0, null),
689 P_PHONE_MOBILE (15, 35, P_PHONE_MOBILE_req, 0, null),
690 P_EMAILS (16, 36, P_EMAILS_req, 0, null),
691 P_HOMEPAGE (17, 37, P_HOMEPAGE_req, 0, null),
692 P_ABOUT (18, 38, P_ABOUT_req, 0, null),
693 P_PROFILE_TIMESTAMP (19, 39, P_PROFILE_TIMESTAMP_req, 0, null),
694 P_MOOD_TEXT (26, 40, P_MOOD_TEXT_req, 0, null),
695 P_TIMEZONE (27, 41, P_TIMEZONE_req, 0, null),
696 P_NROF_AUTHED_BUDDIES (28, 42, P_NROF_AUTHED_BUDDIES_req, 0, null),
697 P_AVAILABILITY (34, 43, P_AVAILABILITY_req, 0, Contact.Availability.get(0)),
698 P_AVATAR_IMAGE (37, 44, P_AVATAR_IMAGE_req, 0, null),
699 P_AVATAR_TIMESTAMP (182, 45, P_AVATAR_TIMESTAMP_req, 0, null),
700 P_MOOD_TIMESTAMP (183, 46, P_MOOD_TIMESTAMP_req, 0, null),
701 P_RICH_MOOD_TEXT (205, 47, P_RICH_MOOD_TEXT_req, 0, null);
702 private final int key;
703 private final int idx;
704 private final byte[] req;
705 private final int mod;
706 private final EnumConverting enumConverter;
707 Property(int key, int idx, byte[] req, int mod, EnumConverting converter) {
708 this.key = key;
709 this.idx = idx;
710 this.req = req;
711 this.mod = mod;
712 this.enumConverter = converter;
713 };
714 public boolean isCached() { return idx > 0; }
715 public int getIdx() { return idx; }
716 public int getId() { return key; }
717 public byte[] getRequest() { return req; }
718 public EnumConverting getDefault() { return P_UNKNOWN; }
719 public int getModuleId() { return mod; } public EnumConverting getEnumConverter() { return enumConverter; }
720 public EnumConverting convert(final int from) { return Property.get(from); }
721 public EnumConverting[] getArray(final int size) { return new Property[size]; }
722 public static Property get(final int from) {
723 switch (from) {
724 case 70: return P_STATUS;
725 case 71: return P_PWD_CHANGE_STATUS;
726 case 73: return P_LOGOUT_REASON;
727 case 78: return P_COMMIT_STATUS;
728 case 72: return P_SUGGESTED_SKYPE_NAME;
729 case 74: return P_SKYPEOUT_BALANCE_CURRENCY;
730 case 75: return P_SKYPEOUT_BALANCE;
731 case 804: return P_SKYPEOUT_PRECISION;
732 case 76: return P_SKYPEIN_NUMBERS;
733 case 79: return P_CBL_SYNC_STATUS;
734 case 77: return P_OFFLINE_CALL_FORWARD;
735 case 160: return P_CHAT_POLICY;
736 case 161: return P_SKYPE_CALL_POLICY;
737 case 162: return P_PSTN_CALL_POLICY;
738 case 163: return P_AVATAR_POLICY;
739 case 164: return P_BUDDY_COUNT_POLICY;
740 case 165: return P_TIMEZONE_POLICY;
741 case 166: return P_WEB_PRESENCE_POLICY;
742 case 168: return P_PHONE_NUMBERS_POLICY;
743 case 169: return P_VOICEMAIL_POLICY;
744 case 773: return P_PARTNER_OPTED_OUT;
745 case 800: return P_SERVICE_PROVIDER_INFO;
746 case 801: return P_REGISTRATION_TIMESTAMP;
747 case 802: return P_OTHER_INSTANCES_COUNT;
748 case 4: return P_SKYPE_NAME;
749 case 5: return P_FULL_NAME;
750 case 7: return P_BIRTHDAY;
751 case 8: return P_GENDER;
752 case 9: return P_LANGUAGES;
753 case 10: return P_COUNTRY;
754 case 11: return P_PROVINCE;
755 case 12: return P_CITY;
756 case 13: return P_PHONE_HOME;
757 case 14: return P_PHONE_OFFICE;
758 case 15: return P_PHONE_MOBILE;
759 case 16: return P_EMAILS;
760 case 17: return P_HOMEPAGE;
761 case 18: return P_ABOUT;
762 case 19: return P_PROFILE_TIMESTAMP;
763 case 26: return P_MOOD_TEXT;
764 case 27: return P_TIMEZONE;
765 case 28: return P_NROF_AUTHED_BUDDIES;
766 case 34: return P_AVAILABILITY;
767 case 37: return P_AVATAR_IMAGE;
768 case 182: return P_AVATAR_TIMESTAMP;
769 case 183: return P_MOOD_TIMESTAMP;
770 case 205: return P_RICH_MOOD_TEXT;
771 }
772 return P_UNKNOWN;
773 }
774 public static final int P_STATUS_VALUE = 70;
775 public static final int P_PWD_CHANGE_STATUS_VALUE = 71;
776 public static final int P_LOGOUT_REASON_VALUE = 73;
777 public static final int P_COMMIT_STATUS_VALUE = 78;
778 public static final int P_SUGGESTED_SKYPE_NAME_VALUE = 72;
779 public static final int P_SKYPEOUT_BALANCE_CURRENCY_VALUE = 74;
780 public static final int P_SKYPEOUT_BALANCE_VALUE = 75;
781 public static final int P_SKYPEOUT_PRECISION_VALUE = 804;
782 public static final int P_SKYPEIN_NUMBERS_VALUE = 76;
783 public static final int P_CBL_SYNC_STATUS_VALUE = 79;
784 public static final int P_OFFLINE_CALL_FORWARD_VALUE = 77;
785 public static final int P_CHAT_POLICY_VALUE = 160;
786 public static final int P_SKYPE_CALL_POLICY_VALUE = 161;
787 public static final int P_PSTN_CALL_POLICY_VALUE = 162;
788 public static final int P_AVATAR_POLICY_VALUE = 163;
789 public static final int P_BUDDY_COUNT_POLICY_VALUE = 164;
790 public static final int P_TIMEZONE_POLICY_VALUE = 165;
791 public static final int P_WEB_PRESENCE_POLICY_VALUE = 166;
792 public static final int P_PHONE_NUMBERS_POLICY_VALUE = 168;
793 public static final int P_VOICEMAIL_POLICY_VALUE = 169;
794 public static final int P_PARTNER_OPTED_OUT_VALUE = 773;
795 public static final int P_SERVICE_PROVIDER_INFO_VALUE = 800;
796 public static final int P_REGISTRATION_TIMESTAMP_VALUE = 801;
797 public static final int P_OTHER_INSTANCES_COUNT_VALUE = 802;
798 public static final int P_SKYPE_NAME_VALUE = 4;
799 public static final int P_FULL_NAME_VALUE = 5;
800 public static final int P_BIRTHDAY_VALUE = 7;
801 public static final int P_GENDER_VALUE = 8;
802 public static final int P_LANGUAGES_VALUE = 9;
803 public static final int P_COUNTRY_VALUE = 10;
804 public static final int P_PROVINCE_VALUE = 11;
805 public static final int P_CITY_VALUE = 12;
806 public static final int P_PHONE_HOME_VALUE = 13;
807 public static final int P_PHONE_OFFICE_VALUE = 14;
808 public static final int P_PHONE_MOBILE_VALUE = 15;
809 public static final int P_EMAILS_VALUE = 16;
810 public static final int P_HOMEPAGE_VALUE = 17;
811 public static final int P_ABOUT_VALUE = 18;
812 public static final int P_PROFILE_TIMESTAMP_VALUE = 19;
813 public static final int P_MOOD_TEXT_VALUE = 26;
814 public static final int P_TIMEZONE_VALUE = 27;
815 public static final int P_NROF_AUTHED_BUDDIES_VALUE = 28;
816 public static final int P_AVAILABILITY_VALUE = 34;
817 public static final int P_AVATAR_IMAGE_VALUE = 37;
818 public static final int P_AVATAR_TIMESTAMP_VALUE = 182;
819 public static final int P_MOOD_TIMESTAMP_VALUE = 183;
820 public static final int P_RICH_MOOD_TEXT_VALUE = 205;
821 public static final Property[] mget_profile_mreq = { P_SKYPE_NAME, P_FULL_NAME, P_MOOD_TEXT, P_EMAILS, P_PHONE_HOME, P_PHONE_OFFICE, P_PHONE_MOBILE, P_BIRTHDAY, P_GENDER, P_LANGUAGES, P_COUNTRY, P_PROVINCE, P_CITY, P_HOMEPAGE, P_ABOUT, P_TIMEZONE };
822 }
823 private final static byte[] getStatusWithProgress_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 1};
824 public class GetStatusWithProgressResponse {
825 public Status status;
826 public int progress;
827 };
828
829 /**
830 * getStatusWithProgress
831 * @return GetStatusWithProgressResponse
832 * <br> - status Current value of this account's P_STATUS property
833 * <br> - progress This argument returns 0.
834 */
835 public GetStatusWithProgressResponse getStatusWithProgress() {
836 try {
837 Decoding decoder = sidDoRequest(getStatusWithProgress_req)
838 .endRequest();
839 GetStatusWithProgressResponse result = new GetStatusWithProgressResponse();
840 result.status = (Status) decoder.getEnumParm(1, Status.get(0), false);
841 result.progress = decoder.getUintParm(2, true);
842 return result;
843 } catch(IOException e) {
844 mSidRoot.sidOnFatalError(e);
845 return null
846 ;}
847 }
848 private final static byte[] login_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 5};
849 /**
850 * Login an auto-login enabled account (P_STATUS is LOGGED_OUT_AND_PWD_SAVED) and optionally set the availability, for example login in as Contact.DO_NOT_DISTURB. To find out whether there is an auto-login enabled account available, you can use Skype.GetDefaultAccountName to retrieve the skypename of that account. You can then get an Account instance for login by invoking Skype.GetAccount.
851 *
852 * If no accounts with stored login credentials are available (GetDefaultAccountName returns an empty string), then you will have to prompt the user for account name and password and then use LoginWithPassword. Account name field in the UI can be pre-populated with strings retrieved with Skype.GetExistingAccounts
853 * @param setAvailabilityTo force this account's initial online status to the specified Contact.AVAILABILITY value.
854 */
855 public void login(Contact.Availability setAvailabilityTo) {
856 try {
857 sidDoRequest(login_req)
858 .addEnumParm(1, setAvailabilityTo)
859 .endOneWay();
860 } catch(IOException e) {
861 mSidRoot.sidOnFatalError(e);
862 }
863 }
864 private final static byte[] loginWithPassword_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 6};
865 /**
866 *
867 * Login in an account by specifying its password. To retrieve an account instance for login, invoke Skype.GetAccount.
868 * @param password Password string (plaintext) for this account, which should be pre-validated (Skype.ValidatePassword)
869 * @param savePwd
870 * - true: Saves the password, ensuring that auto-login is enabled.
871 * - false (default): Does not save the password, and so the user might not be able to effect auto-login until they explicitly invoke Account.SetPasswordSaved(true).
872
873 * @param saveDataLocally For internal use only.
874 */
875 public void loginWithPassword(String password, boolean savePwd, boolean saveDataLocally) { try {
876 sidDoRequest(loginWithPassword_req)
877 .addStringParm(1, password)
878 .addBoolParm(2, savePwd)
879 .addBoolParm(3, saveDataLocally, true)
880 .endOneWay();
881 } catch(IOException e) {
882 mSidRoot.sidOnFatalError(e);
883 }
884 }
885 private final static byte[] register_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 7};
886 /**
887 * This command can be used to create a new Skype account, based on the Account object. When successful, this command will also log in with the newly created account. If the new account registration was not successful, Account status property will change to LOGGED_OUT. A common reason for registration failures is that the an account with that name already exists. In that case, Account LOGOUT_REASON will be set to SKYPENAME_TAKEN. Also, Account SUGGESTED_SKYPENAME property will be set to a list of similar but still available skypenames that could be used instead. The property will contain up to 5 semicolon-separated alternative skypenames. In if no suggested skypenames were available, then this property will contain an empty string.
888 * NB! You should pre-validate your P_SKYPENAME value and any email string (Skype.ValidateProfileString) prior to invoking this method.
889 * @param password Password string (plaintext) for this account, which should be pre-validated (Skype.ValidatePassword)
890 * @param savePwd
891 * - true: Saves the password and enables auto-login.
892 * - false (default): Does not save the password, and the user needs to be prompted for password on the next login attempt.
893
894 * @param saveDataLocally For internal use only.
895 * @param email An email address for retrieving lost passwords and receiving news and information from Skype.
896 * @param allowSpam enable/disable news and information from Skype being sent to account's e-mail.
897 */
898 public void register(String password, boolean savePwd, boolean saveDataLocally, String email, boolean allowSpam) {
899 try {
900 sidDoRequest(register_req)
901 .addStringParm(1, password)
902 .addBoolParm(2, savePwd)
903 .addBoolParm(3, saveDataLocally, true)
904 .addStringParm(4, email)
905 .addBoolParm(5, allowSpam)
906 .endOneWay();
907 } catch(IOException e) {
908 mSidRoot.sidOnFatalError(e);
909 }
910 }
911 private final static byte[] logout_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 8};
912 /** Logs out current account. Note that calling this on client application exit is optional. * @param clearSavedPwd
913 * - true: Clears any saved password use with auto-login and so disables auto-login until you explicitly invoke Account.SetPasswordSaved(true).
914 * - false (default): Does not clear any saved password and so does not affect existing auto-login behavior.
915
916 */
917 public void logout(boolean clearSavedPwd) {
918 try {
919 sidDoRequest(logout_req)
920 .addBoolParm(1, clearSavedPwd)
921 .endOneWay();
922 } catch(IOException e) {
923 mSidRoot.sidOnFatalError(e);
924 }
925 }
926 private final static byte[] changePassword_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 11};
927 /** Changes this account's password. Returns false if the change failed. NB! You should pre-validate your password strings (Skype.ValidatePassword) and ensure that they are different prior to invoking this method. * @param oldPassword "Current password string (plaintext) for this account
928 * @param newPassword New password string (plaintext) for this account
929 * @param savePwd
930 * - true: Saves the new password and enables auto-login.
931 * - false (default): Clears any existing saved password and so the user cannot effect auto-login until they explicitly invoke Account.SetPasswordSaved(true)
932
933 */
934 public void changePassword(String oldPassword, String newPassword, boolean savePwd) {
935 try {
936 sidDoRequest(changePassword_req)
937 .addStringParm(1, oldPassword)
938 .addStringParm(2, newPassword)
939 .addBoolParm(3, savePwd)
940 .endOneWay();
941 } catch(IOException e) {
942 mSidRoot.sidOnFatalError(e);
943 }
944 }
945 private final static byte[] setPasswordSaved_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 25};
946 /** save or clear credentials for auto-login whilst already logged in * @param savePwd
947 */
948 public void setPasswordSaved(boolean savePwd) {
949 try {
950 sidDoRequest(setPasswordSaved_req)
951 .addBoolParm(1, savePwd)
952 .endOneWay();
953 } catch(IOException e) {
954 mSidRoot.sidOnFatalError(e);
955 }
956 }
957 private final static byte[] setServerSideIntProperty_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 12};
958 /** Setter for integer (and enum) server-side properties. For a list of writeable server-side properties, see the detailed description of the Account class. * @param propKey
959 * @param value
960 */
961 public void setServerSideIntProperty(int propKey, int value) {
962 try {
963 sidDoRequest(setServerSideIntProperty_req)
964 .addEnumParm(1, propKey)
965 .addUintParm(2, value)
966 .endOneWay();
967 } catch(IOException e) {
968 mSidRoot.sidOnFatalError(e);
969 }
970 }
971 private final static byte[] setServerSideStrProperty_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 13};
972 /** Setter for String server-side properties. For a list of writeable server-side properties, see the detailed description of the Account class. * @param propKey
973 * @param value
974 */
975 public void setServerSideStrProperty(int propKey, String value) {
976 try {
977 sidDoRequest(setServerSideStrProperty_req)
978 .addEnumParm(1, propKey)
979 .addStringParm(2, value)
980 .endOneWay();
981 } catch(IOException e) {
982 mSidRoot.sidOnFatalError(e);
983 }
984 }
985 private final static byte[] cancelServerCommit_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 15};
986 /** Cancels an attempt to commit a server-side P_XXX_POLICY or the P_OFFLINE_CALLFORWARD server-side property. Invoking this cancellation only makes sense whilst the P_COMMITTSTATUS is in COMMITTING_TO_SERVER state. */
987 public void cancelServerCommit() {
988 try {
989 sidDoRequest(cancelServerCommit_req)
990 .endOneWay();
991 } catch(IOException e) {
992 mSidRoot.sidOnFatalError(e);
993 }
994 }
995 private final static byte[] setIntProperty_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 16};
996 /** Setter for integer properties. For a list of writeable account profile properties, see the detailed description of the Account class. * @param propKey
997 * @param value
998 */
999 public void setIntProperty(int propKey, int value) {
1000 try {
1001 sidDoRequest(setIntProperty_req)
1002 .addEnumParm(1, propKey)
1003 .addUintParm(2, value)
1004 .endOneWay();
1005 } catch(IOException e) {
1006 mSidRoot.sidOnFatalError(e);
1007 }
1008 }
1009 private final static byte[] setStrProperty_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 17};
1010 /** Setter for String properties. For a list of writeable account profile properties, see the detailed description of the Account class. NB! You should pre-validate your about and mood message strings (Skype.ValidateProfileString) prior to invoking this method. * @param propKey
1011 * @param value
1012 */
1013 public void setStrProperty(int propKey, String value) {
1014 try {
1015 sidDoRequest(setStrProperty_req)
1016 .addEnumParm(1, propKey)
1017 .addStringParm(2, value)
1018 .endOneWay();
1019 } catch(IOException e) {
1020 mSidRoot.sidOnFatalError(e);
1021 }
1022 }
1023 private final static byte[] setBinProperty_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 18};
1024 /** Setter for BLOB properties, such as its avatar image. For a list of writeable account profile properties, see the detailed description of the Account class. NB! You should pre-validate your avatar image (Skype.ValidateAvatar) prior to invoking this method. * @param propKey
1025 * @param value
1026 */
1027 public void setBinProperty(int propKey, byte[] value) {
1028 try {
1029 sidDoRequest(setBinProperty_req)
1030 .addEnumParm(1, propKey)
1031 .addBinaryParm(2, value)
1032 .endOneWay();
1033 } catch(IOException e) {
1034 mSidRoot.sidOnFatalError(e);
1035 }
1036 }
1037 private final static byte[] setAvailability_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 19};
1038 /** Sets online status of the currently logged in account to one of the values from Contact class AVAILABILITY enumerator. * @param availability only subset of all contact availabilities allowed
1039 */
1040 public void setAvailability(Contact.Availability availability) {
1041 try {
1042 sidDoRequest(setAvailability_req)
1043 .addEnumParm(1, availability)
1044 .endOneWay();
1045 } catch(IOException e) {
1046 mSidRoot.sidOnFatalError(e);
1047 }
1048 }
1049 private final static byte[] setStandby_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 10}; /** Transitions the availability of this account's associated user, who is assumed to be logged in. * @param standby
1050 * - true: Saves the user's current availability, then sets it to CONTACT.AVAILABILITY.OFFLINE
1051 * - false: Reconnects the user and restores their previous availability
1052
1053 */
1054 public void setStandby(boolean standby) {
1055 try {
1056 sidDoRequest(setStandby_req)
1057 .addBoolParm(1, standby)
1058 .endOneWay();
1059 } catch(IOException e) {
1060 mSidRoot.sidOnFatalError(e);
1061 }
1062 }
1063 private final static byte[] getCapabilityStatus_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 21};
1064 public class GetCapabilityStatusResponse {
1065 public CapabilityStatus status;
1066 public int expiryTimestamp;
1067 };
1068
1069 /** Returns state of a given account capability. Takes Contact class CAPABILITY property as input argument and returns its state and expiration timestamp where appropriate. For example (C++ wrapper, with other wrappers the syntax may vary but the idea is the same) MyAccount.GetCapabilityStatus(Contact.CAPABILITY_SKYPEOUT, Cap, T); will return Account.CAPABILITY_EXISTS if local account has SkypeOut enabled. * @param capability
1070 * @return GetCapabilityStatusResponse
1071 * <br> - status
1072 * <br> - expiryTimestamp
1073 */
1074 public GetCapabilityStatusResponse getCapabilityStatus(Contact.Capability capability) {
1075 try {
1076 Decoding decoder = sidDoRequest(getCapabilityStatus_req)
1077 .addEnumParm(1, capability)
1078 .endRequest();
1079 GetCapabilityStatusResponse result = new GetCapabilityStatusResponse();
1080 result.status = (CapabilityStatus) decoder.getEnumParm(1, CapabilityStatus.get(0), false);
1081 result.expiryTimestamp = decoder.getUintParm(2, true);
1082 return result;
1083 } catch(IOException e) {
1084 mSidRoot.sidOnFatalError(e);
1085 return null
1086 ;}
1087 }
1088 private final static byte[] getSkypeNameHash_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 22};
1089 /** Response is empty when called with an inactive or invalid account * @return skypenameHash
1090 */
1091 public String getSkypeNameHash() {
1092 try {
1093 return sidDoRequest(getSkypeNameHash_req)
1094 .endRequest().getStringParm(1, true);
1095 } catch(IOException e) {
1096 mSidRoot.sidOnFatalError(e);
1097 return ""
1098 ;}
1099 }
1100 private final static byte[] getVerifiedEmail_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 2};
1101 /** returns verified-by-Skype e-mail for this account if exists and verifiable * @return email
1102 */
1103 public String getVerifiedEmail() {
1104 try {
1105 return sidDoRequest(getVerifiedEmail_req)
1106 .endRequest().getStringParm(1, true);
1107 } catch(IOException e) {
1108 mSidRoot.sidOnFatalError(e);
1109 return ""
1110 ;}
1111 }
1112 private final static byte[] getVerifiedCompany_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 3};
1113 /** returns verified-by-Skype company for this account if exists and verifiable * @return company
1114 */
1115 public String getVerifiedCompany() {
1116 try {
1117 return sidDoRequest(getVerifiedCompany_req)
1118 .endRequest().getStringParm(1, true);
1119 } catch(IOException e) {
1120 mSidRoot.sidOnFatalError(e);
1121 return ""
1122 ;}
1123 }
1124 private final static byte[] delete_req = {(byte) 90,(byte) 82,(byte) 5,(byte) 24};
1125 /** Deletes all account data stored locally. Does not remove any account data from the server! */
1126 public void delete() {
1127 try {
1128 sidDoRequest(delete_req)
1129 .endOneWay();
1130 } catch(IOException e) {
1131 mSidRoot.sidOnFatalError(e);
1132 }
1133 }
1134 /***
1135 * generic multiget of a list of Property
1136 * @param requested the list of requested properties of Account
1137 * @return SidGetResponding
1138 */
1139 public SidGetResponding sidMultiGet(Property[] requested) {
1140 return super.sidMultiGet(requested);
1141 }
1142 /***
1143 * generic multiget of list of Property for a list of Account
1144 * @param requested the list of requested properties
1145 * @return SidGetResponding[] can be casted to (Account[]) if all properties are cached
1146 */
1147 static public SidGetResponding[] sidMultiGet(Property[] requested, Account[] objects) {
1148 return SidObject.sidMultiGet(requested, objects);
1149 }
1150 /*** multiget the following properties
1151 * - P_SKYPE_NAME
1152 * - P_FULL_NAME
1153 * - P_MOOD_TEXT
1154 * - P_EMAILS
1155 * - P_PHONE_HOME
1156 * - P_PHONE_OFFICE
1157 * - P_PHONE_MOBILE
1158 * - P_BIRTHDAY
1159 * - P_GENDER
1160 * - P_LANGUAGES
1161 * - P_COUNTRY
1162 * - P_PROVINCE
1163 * - P_CITY
1164 * - P_HOMEPAGE
1165 * - P_ABOUT
1166 * - P_TIMEZONE
1167 */
1168 public Account mgetProfile() {
1169 return (Account) super.sidMultiGet(Property.mget_profile_mreq, this);
1170 }
1171 /** Account.STATUS */
1172 public Status getStatus() {
1173 synchronized(this) {
1174 if ((mSidCached & 0x1) != 0)
1175 return mStatus;
1176 }
1177 return (Status) sidRequestEnumProperty(Property.P_STATUS);
1178 }
1179 /** Account.PWDCHANGESTATUS */
1180 public PwdChangeStatus getPwdChangeStatus() {
1181 synchronized(this) {
1182 if ((mSidCached & 0x2) != 0)
1183 return mPwdChangeStatus;
1184 }
1185 return (PwdChangeStatus) sidRequestEnumProperty(Property.P_PWD_CHANGE_STATUS);
1186 }
1187 /** This property should only be examined when Account.P_STATUS is LOGGED_OUT or LOGGED_OUT_AND_PWD_SAVED. That is, you should not monitor changes to this property in Account.OnChange callback, other than after already having checked that P_STATUS property has appropriate value. The reason for this is that the LOGOUTREASON does not get reset before the next login attempt. For example: if a user tried to log in with a wrong password, the LOGOUTREASON gets set to INCORRECT_PASSWORD. Now, if the user tries to log in again, and yet again submits an incorrect password, the value of the LOGOUTREASON does not change anymore, because it already is set to INCORRECT_PASSWORD. Consequently, Account.OnChange will not fire in this case. */
1188 public LogoutReason getLogoutReason() {
1189 synchronized(this) {
1190 if ((mSidCached & 0x4) != 0)
1191 return mLogoutReason;
1192 }
1193 return (LogoutReason) sidRequestEnumProperty(Property.P_LOGOUT_REASON);
1194 }
1195 /** Account.COMMITSTATUS */
1196 public CommitStatus getCommitStatus() {
1197 synchronized(this) {
1198 if ((mSidCached & 0x8) != 0)
1199 return mCommitStatus;
1200 }
1201 return (CommitStatus) sidRequestEnumProperty(Property.P_COMMIT_STATUS);
1202 }
1203 /** suggested skypenames, semi-colon separated. present if logoutreason==SKYPENAME_TAKEN */
1204 public String getSuggestedSkypeName() {
1205 synchronized(this) {
1206 if ((mSidCached & 0x10) != 0)
1207 return mSuggestedSkypeName;
1208 }
1209 return sidRequestStringProperty(Property.P_SUGGESTED_SKYPE_NAME);
1210 }
1211 /** 'EUR', 'USD', etc. */
1212 public String getSkypeoutBalanceCurrency() {
1213 synchronized(this) {
1214 if ((mSidCached & 0x20) != 0)
1215 return mSkypeoutBalanceCurrency;
1216 }
1217 return sidRequestStringProperty(Property.P_SKYPEOUT_BALANCE_CURRENCY);
1218 }
1219 /** balance in 'cents' */
1220 public int getSkypeoutBalance() {
1221 synchronized(this) {
1222 if ((mSidCached & 0x40) != 0)
1223 return mSkypeoutBalance;
1224 }
1225 return sidRequestUintProperty(Property.P_SKYPEOUT_BALANCE);
1226 }
1227 /** decimal points in ACCOUNT_SKYPEOUT_BALANCE */
1228 public int getSkypeoutPrecision() {
1229 synchronized(this) {
1230 if ((mSidCached & 0x80) != 0)
1231 return mSkypeoutPrecision;
1232 }
1233 return sidRequestUintProperty(Property.P_SKYPEOUT_PRECISION);
1234 }
1235 /** space-separated list of skypein numbers */
1236 public String getSkypeinNumbers() {
1237 synchronized(this) {
1238 if ((mSidCached & 0x100) != 0)
1239 return mSkypeinNumbers;
1240 }
1241 return sidRequestStringProperty(Property.P_SKYPEIN_NUMBERS);
1242 }
1243 /** Account.CBLSYNCSTATUS */
1244 public CblSyncStatus getCblSyncStatus() {
1245 synchronized(this) {
1246 if ((mSidCached & 0x200) != 0)
1247 return mCblSyncStatus;
1248 }
1249 return (CblSyncStatus) sidRequestEnumProperty(Property.P_CBL_SYNC_STATUS);
1250 }
1251 /** space-separated list of 'begSecond,endSecond,identity' tokens */
1252 public String getOfflineCallForward() {
1253 synchronized(this) {
1254 if ((mSidCached & 0x400) != 0)
1255 return mOfflineCallForward;
1256 }
1257 return sidRequestStringProperty(Property.P_OFFLINE_CALL_FORWARD);
1258 }
1259 /** Server-side account property, use SetServerside*Property() to set */
1260 public ChatPolicy getChatPolicy() {
1261 synchronized(this) {
1262 if ((mSidCached & 0x800) != 0)
1263 return mChatPolicy;
1264 }
1265 return (ChatPolicy) sidRequestEnumProperty(Property.P_CHAT_POLICY);
1266 }
1267 /** Server-side account property, use SetServerside*Property() to set */
1268 public SkypeCallPolicy getSkypeCallPolicy() {
1269 synchronized(this) {
1270 if ((mSidCached & 0x1000) != 0)
1271 return mSkypeCallPolicy; }
1272 return (SkypeCallPolicy) sidRequestEnumProperty(Property.P_SKYPE_CALL_POLICY);
1273 }
1274 /** Server-side account property, use SetServerside*Property() to set */
1275 public PstnCallPolicy getPstnCallPolicy() {
1276 synchronized(this) {
1277 if ((mSidCached & 0x2000) != 0)
1278 return mPstnCallPolicy;
1279 }
1280 return (PstnCallPolicy) sidRequestEnumProperty(Property.P_PSTN_CALL_POLICY);
1281 }
1282 /** Server-side account property, use SetServerside*Property() to set */
1283 public AvatarPolicy getAvatarPolicy() {
1284 synchronized(this) {
1285 if ((mSidCached & 0x4000) != 0)
1286 return mAvatarPolicy;
1287 }
1288 return (AvatarPolicy) sidRequestEnumProperty(Property.P_AVATAR_POLICY);
1289 }
1290 /** Server-side account property, use SetServerside*Property() to set */
1291 public BuddyCountPolicy getBuddyCountPolicy() {
1292 synchronized(this) {
1293 if ((mSidCached & 0x8000) != 0)
1294 return mBuddyCountPolicy;
1295 }
1296 return (BuddyCountPolicy) sidRequestEnumProperty(Property.P_BUDDY_COUNT_POLICY);
1297 }
1298 /** Server-side account property, use SetServerside*Property() to set */
1299 public TimezonePolicy getTimezonePolicy() {
1300 synchronized(this) {
1301 if ((mSidCached & 0x10000) != 0)
1302 return mTimezonePolicy;
1303 }
1304 return (TimezonePolicy) sidRequestEnumProperty(Property.P_TIMEZONE_POLICY);
1305 }
1306 /** Server-side account property, use SetServerside*Property() to set */
1307 public WebPresencePolicy getWebPresencePolicy() {
1308 synchronized(this) {
1309 if ((mSidCached & 0x20000) != 0)
1310 return mWebPresencePolicy;
1311 }
1312 return (WebPresencePolicy) sidRequestEnumProperty(Property.P_WEB_PRESENCE_POLICY);
1313 }
1314 /** Server-side account property, use SetServerside*Property() to set */
1315 public PhoneNumbersPolicy getPhoneNumbersPolicy() {
1316 synchronized(this) {
1317 if ((mSidCached & 0x40000) != 0)
1318 return mPhoneNumbersPolicy;
1319 }
1320 return (PhoneNumbersPolicy) sidRequestEnumProperty(Property.P_PHONE_NUMBERS_POLICY);
1321 }
1322 /** Server-side account property, use SetServerside*Property() to set */
1323 public VoicemailPolicy getVoicemailPolicy() {
1324 synchronized(this) {
1325 if ((mSidCached & 0x80000) != 0)
1326 return mVoicemailPolicy;
1327 }
1328 return (VoicemailPolicy) sidRequestEnumProperty(Property.P_VOICEMAIL_POLICY);
1329 }
1330 /** Alerts: opted out partner id's, space separated */
1331 public String getPartnerOptedOut() {
1332 synchronized(this) {
1333 if ((mSidCached & 0x100000) != 0)
1334 return mPartnerOptedOut;
1335 }
1336 return sidRequestStringProperty(Property.P_PARTNER_OPTED_OUT);
1337 }
1338 /** service information if the user is a paid service provider */
1339 public String getServiceProviderInfo() {
1340 synchronized(this) {
1341 if ((mSidCached & 0x200000) != 0)
1342 return mServiceProviderInfo;
1343 }
1344 return sidRequestStringProperty(Property.P_SERVICE_PROVIDER_INFO);
1345 }
1346 /** NB! Unlike your common UNIX timestamps, the registration_timestamp is special, as it counts MINUTES rather than seconds, from Epoch (January 1, 1970) */
1347 public int getRegistrationTimestamp() {
1348 synchronized(this) {
1349 if ((mSidCached & 0x400000) != 0)
1350 return mRegistrationTimestamp;
1351 }
1352 return sidRequestUintProperty(Property.P_REGISTRATION_TIMESTAMP);
1353 }
1354 /** number of times this user is logged in from other computers */
1355 public int getOtherInstancesCount() {
1356 synchronized(this) {
1357 if ((mSidCached & 0x800000) != 0)
1358 return mOtherInstancesCount;
1359 }
1360 return sidRequestUintProperty(Property.P_OTHER_INSTANCES_COUNT);
1361 }
1362 public String getSkypeName() {
1363 synchronized(this) {
1364 if ((mSidCached & 0x1000000) != 0)
1365 return mSkypeName;
1366 }
1367 return sidRequestStringProperty(Property.P_SKYPE_NAME);
1368 }
1369 public String getFullName() {
1370 synchronized(this) {
1371 if ((mSidCached & 0x2000000) != 0)
1372 return mFullName;
1373 }
1374 return sidRequestStringProperty(Property.P_FULL_NAME);
1375 }
1376 /** YYYYMMDD */
1377 public int getBirthday() {
1378 synchronized(this) {
1379 if ((mSidCached & 0x4000000) != 0)
1380 return mBirthday;
1381 }
1382 return sidRequestUintProperty(Property.P_BIRTHDAY);
1383 }
1384 /** 1-male, 2-female */
1385 public int getGender() {
1386 synchronized(this) {
1387 if ((mSidCached & 0x8000000) != 0)
1388 return mGender;
1389 }
1390 return sidRequestUintProperty(Property.P_GENDER);
1391 }
1392 /** ISO language codes, space-separated */
1393 public String getLanguages() {
1394 synchronized(this) {
1395 if ((mSidCached & 0x10000000) != 0)
1396 return mLanguages;
1397 }
1398 return sidRequestStringProperty(Property.P_LANGUAGES);
1399 }
1400 /** ISO country code */
1401 public String getCountry() {
1402 synchronized(this) {
1403 if ((mSidCached & 0x20000000) != 0)
1404 return mCountry;
1405 }
1406 return sidRequestStringProperty(Property.P_COUNTRY);
1407 }
1408 public String getProvince() {
1409 synchronized(this) {
1410 if ((mSidCached & 0x40000000) != 0)
1411 return mProvince;
1412 }
1413 return sidRequestStringProperty(Property.P_PROVINCE);
1414 }
1415 public String getCity() {
1416 synchronized(this) {
1417 if ((mSidCached & 0x80000000) != 0)
1418 return mCity;
1419 }
1420 return sidRequestStringProperty(Property.P_CITY);
1421 }
1422 /** NB! string not integer */
1423 public String getPhoneHome() {
1424 synchronized(this) {
1425 if ((mSidExtraCached[0] & 0x1) != 0)
1426 return mPhoneHome;
1427 }
1428 return sidRequestStringProperty(Property.P_PHONE_HOME);
1429 }
1430 public String getPhoneOffice() {
1431 synchronized(this) {
1432 if ((mSidExtraCached[0] & 0x2) != 0)
1433 return mPhoneOffice;
1434 }
1435 return sidRequestStringProperty(Property.P_PHONE_OFFICE);
1436 }
1437 public String getPhoneMobile() {
1438 synchronized(this) {
1439 if ((mSidExtraCached[0] & 0x4) != 0)
1440 return mPhoneMobile;
1441 }
1442 return sidRequestStringProperty(Property.P_PHONE_MOBILE);
1443 }
1444 /** This is a string property, that contains space-separated list of email addresses. When surfacing this property in your UI, you will need to take into account that there may be more than one email addresses in this property (i.e. split the value at spaces and display them as list). Similarly, when modifying this property with SetStrProperty method, your editor should allow editing of component email addresses separately and add them all up again, before submitting back to the account. */
1445 public String getEmails() {
1446 synchronized(this) {
1447 if ((mSidExtraCached[0] & 0x8) != 0)
1448 return mEmails;
1449 }
1450 return sidRequestStringProperty(Property.P_EMAILS);
1451 }
1452 public String getHomepage() {
1453 synchronized(this) {
1454 if ((mSidExtraCached[0] & 0x10) != 0)
1455 return mHomepage;
1456 }
1457 return sidRequestStringProperty(Property.P_HOMEPAGE);
1458 }
1459 /** arbitrary introductory text */
1460 public String getAbout() {
1461 synchronized(this) {
1462 if ((mSidExtraCached[0] & 0x20) != 0)
1463 return mAbout;
1464 }
1465 return sidRequestStringProperty(Property.P_ABOUT);
1466 }
1467 /** UNIX timestamp of last profile change */
1468 public int getProfileTimestamp() {
1469 synchronized(this) {
1470 if ((mSidExtraCached[0] & 0x40) != 0)
1471 return mProfileTimestamp;
1472 }
1473 return sidRequestUintProperty(Property.P_PROFILE_TIMESTAMP);
1474 }
1475 /** Personal mood text (visible to authorised users only). Max length 300 bytes. */
1476 public String getMoodText() {
1477 synchronized(this) {
1478 if ((mSidExtraCached[0] & 0x80) != 0)
1479 return mMoodText;
1480 }
1481 return sidRequestStringProperty(Property.P_MOOD_TEXT);
1482 }
1483 /** 24*3600+diff_to_UTC_in_seconds. nb! changes with DST */
1484 public int getTimezone() {
1485 synchronized(this) {
1486 if ((mSidExtraCached[0] & 0x100) != 0)
1487 return mTimezone;
1488 }
1489 return sidRequestUintProperty(Property.P_TIMEZONE);
1490 }
1491 /** Count of this user's authorized contacts. */
1492 public int getNrofAuthedBuddies() {
1493 synchronized(this) {
1494 if ((mSidExtraCached[0] & 0x200) != 0)
1495 return mNrofAuthedBuddies;
1496 }
1497 return sidRequestUintProperty(Property.P_NROF_AUTHED_BUDDIES);
1498 }
1499 /** Contact.AVAILABILITY */
1500 public Contact.Availability getAvailability() {
1501 synchronized(this) {
1502 if ((mSidExtraCached[0] & 0x400) != 0)
1503 return mAvailability;
1504 }
1505 return (Contact.Availability) sidRequestEnumProperty(Property.P_AVAILABILITY);
1506 }
1507 /**
1508 * Account avatar picture can be set with Account.SetBinProperty method. The contact avatar picture is limited to max 96x96 pixels and 32000 bytes. If the submitted avatar picture exceeds either of these size limits, it is the responsibility of your client to scale the image down to appropriate size.
1509 *
1510 * The avatar pictures have to be in JPG format. A SkypeKit client can enable the user to set the Account avatar in other picture formats, in which case the picture should be converted to JPG before submitting it. *
1511 * In any case, the avatar picture should be pre-validated with the Skype.ValidateAvatar method.
1512 */
1513 public byte[] getAvatarImage() {
1514 synchronized(this) {
1515 if ((mSidExtraCached[0] & 0x800) != 0)
1516 return mAvatarImage;
1517 }
1518 return sidRequestBinaryProperty(Property.P_AVATAR_IMAGE);
1519 }
1520 /** UNIX timestamp of when current avatar was set */
1521 public int getAvatarTimestamp() {
1522 synchronized(this) {
1523 if ((mSidExtraCached[0] & 0x1000) != 0)
1524 return mAvatarTimestamp;
1525 }
1526 return sidRequestUintProperty(Property.P_AVATAR_TIMESTAMP);
1527 }
1528 /** UNIX timestamp of when current mood was set */
1529 public int getMoodTimestamp() {
1530 synchronized(this) {
1531 if ((mSidExtraCached[0] & 0x2000) != 0)
1532 return mMoodTimestamp;
1533 }
1534 return sidRequestUintProperty(Property.P_MOOD_TIMESTAMP);
1535 }
1536 /** XML version of CONTACT_MOOD_TEXT. Max length 1000 bytes. */
1537 public String getRichMoodText() {
1538 synchronized(this) {
1539 if ((mSidExtraCached[0] & 0x4000) != 0)
1540 return mRichMoodText;
1541 }
1542 return sidRequestXmlProperty(Property.P_RICH_MOOD_TEXT);
1543 }
1544 public String sidGetStringProperty(final PropertyEnumConverting prop) {
1545 switch(prop.getId()) {
1546 case 72:
1547 return mSuggestedSkypeName;
1548 case 74:
1549 return mSkypeoutBalanceCurrency;
1550 case 76:
1551 return mSkypeinNumbers;
1552 case 77:
1553 return mOfflineCallForward;
1554 case 773:
1555 return mPartnerOptedOut;
1556 case 800:
1557 return mServiceProviderInfo;
1558 case 4:
1559 return mSkypeName;
1560 case 5:
1561 return mFullName;
1562 case 9:
1563 return mLanguages;
1564 case 10:
1565 return mCountry;
1566 case 11:
1567 return mProvince;
1568 case 12:
1569 return mCity;
1570 case 13:
1571 return mPhoneHome;
1572 case 14:
1573 return mPhoneOffice;
1574 case 15:
1575 return mPhoneMobile;
1576 case 16:
1577 return mEmails;
1578 case 17:
1579 return mHomepage;
1580 case 18:
1581 return mAbout;
1582 case 26:
1583 return mMoodText;
1584 case 205:
1585 return mRichMoodText;
1586 }
1587 return "";
1588 }
1589 public int sidGetIntProperty(final PropertyEnumConverting prop) {
1590 switch(prop.getId()) {
1591 case 75:
1592 return mSkypeoutBalance;
1593 case 804:
1594 return mSkypeoutPrecision;
1595 case 801:
1596 return mRegistrationTimestamp;
1597 case 802:
1598 return mOtherInstancesCount;
1599 case 7:
1600 return mBirthday;
1601 case 8:
1602 return mGender;
1603 case 19:
1604 return mProfileTimestamp;
1605 case 27:
1606 return mTimezone;
1607 case 28:
1608 return mNrofAuthedBuddies;
1609 case 182:
1610 return mAvatarTimestamp;
1611 case 183:
1612 return mMoodTimestamp;
1613 }
1614 return 0;
1615 }
1616 public EnumConverting sidGetEnumProperty(final PropertyEnumConverting prop) {
1617 switch(prop.getId()) {
1618 case 70:
1619 return mStatus;
1620 case 71:
1621 return mPwdChangeStatus;
1622 case 73:
1623 return mLogoutReason;
1624 case 78:
1625 return mCommitStatus;
1626 case 79:
1627 return mCblSyncStatus;
1628 case 160:
1629 return mChatPolicy;
1630 case 161:
1631 return mSkypeCallPolicy;
1632 case 162:
1633 return mPstnCallPolicy;
1634 case 163:
1635 return mAvatarPolicy;
1636 case 164:
1637 return mBuddyCountPolicy;
1638 case 165:
1639 return mTimezonePolicy;
1640 case 166:
1641 return mWebPresencePolicy;
1642 case 168:
1643 return mPhoneNumbersPolicy;
1644 case 169:
1645 return mVoicemailPolicy;
1646 case 34:
1647 return mAvailability;
1648 }
1649 return null;
1650 }
1651 public byte[] sidGetBinaryProperty(final PropertyEnumConverting prop) {
1652 assert(prop.getId() == 37);
1653 return mAvatarImage;
1654 }
1655 public String getPropertyAsString(final int prop) {
1656 switch (prop) {
1657 case 70: return getStatus().toString();
1658 case 71: return getPwdChangeStatus().toString();
1659 case 73: return getLogoutReason().toString();
1660 case 78: return getCommitStatus().toString();
1661 case 72: return getSuggestedSkypeName();
1662 case 74: return getSkypeoutBalanceCurrency();
1663 case 75: return Integer.toString(getSkypeoutBalance());
1664 case 804: return Integer.toString(getSkypeoutPrecision());
1665 case 76: return getSkypeinNumbers();
1666 case 79: return getCblSyncStatus().toString();
1667 case 77: return getOfflineCallForward();
1668 case 160: return getChatPolicy().toString();
1669 case 161: return getSkypeCallPolicy().toString();
1670 case 162: return getPstnCallPolicy().toString();
1671 case 163: return getAvatarPolicy().toString();
1672 case 164: return getBuddyCountPolicy().toString();
1673 case 165: return getTimezonePolicy().toString();
1674 case 166: return getWebPresencePolicy().toString();
1675 case 168: return getPhoneNumbersPolicy().toString();
1676 case 169: return getVoicemailPolicy().toString();
1677 case 773: return getPartnerOptedOut();
1678 case 800: return getServiceProviderInfo();
1679 case 801: return Integer.toString(getRegistrationTimestamp());
1680 case 802: return Integer.toString(getOtherInstancesCount());
1681 case 4: return getSkypeName();
1682 case 5: return getFullName();
1683 case 7: return Integer.toString(getBirthday());
1684 case 8: return Integer.toString(getGender());
1685 case 9: return getLanguages();
1686 case 10: return getCountry();
1687 case 11: return getProvince();
1688 case 12: return getCity();
1689 case 13: return getPhoneHome();
1690 case 14: return getPhoneOffice();
1691 case 15: return getPhoneMobile();
1692 case 16: return getEmails();
1693 case 17: return getHomepage();
1694 case 18: return getAbout();
1695 case 19: return Integer.toString(getProfileTimestamp());
1696 case 26: return getMoodText();
1697 case 27: return Integer.toString(getTimezone());
1698 case 28: return Integer.toString(getNrofAuthedBuddies());
1699 case 34: return getAvailability().toString();
1700 case 37: return "<binary>";
1701 case 182: return Integer.toString(getAvatarTimestamp());
1702 case 183: return Integer.toString(getMoodTimestamp());
1703 }
1704 return "<unkown>";
1705 }
1706 public String getPropertyAsString(final Property prop) {
1707 return getPropertyAsString(prop.getId());
1708 }
1709 protected void sidOnChangedProperty(final int propertyId, final int value, final String svalue) {
1710 final Property property = Property.get(propertyId);
1711 if (property == Property.P_UNKNOWN) return;
1712 final int idx = property.getIdx();
1713 if (idx != 0) {
1714 int word = (idx-1) / 32;
1715 int bit = 1<<((idx-1)%32);
1716 synchronized (this) {
1717 if (word == 0) mSidCached |= bit; else mSidExtraCached[word-1] |= bit;
1718 switch (propertyId) {
1719 case 70: mStatus = Status.get(value); break;
1720 case 71: mPwdChangeStatus = PwdChangeStatus.get(value); break;
1721 case 73: mLogoutReason = LogoutReason.get(value); break;
1722 case 78: mCommitStatus = CommitStatus.get(value); break;
1723 case 72:
1724 if (svalue != null) mSuggestedSkypeName = svalue;
1725 else mSidCached &=~bit;
1726 break;
1727 case 74:
1728 if (svalue != null) mSkypeoutBalanceCurrency = svalue;
1729 else mSidCached &=~bit;
1730 break;
1731 case 75: mSkypeoutBalance = value; break;
1732 case 804: mSkypeoutPrecision = value; break;
1733 case 76:
1734 if (svalue != null) mSkypeinNumbers = svalue;
1735 else mSidCached &=~bit;
1736 break;
1737 case 79: mCblSyncStatus = CblSyncStatus.get(value); break;
1738 case 77:
1739 if (svalue != null) mOfflineCallForward = svalue;
1740 else mSidCached &=~bit;
1741 break;
1742 case 160: mChatPolicy = ChatPolicy.get(value); break;
1743 case 161: mSkypeCallPolicy = SkypeCallPolicy.get(value); break;
1744 case 162: mPstnCallPolicy = PstnCallPolicy.get(value); break;
1745 case 163: mAvatarPolicy = AvatarPolicy.get(value); break;
1746 case 164: mBuddyCountPolicy = BuddyCountPolicy.get(value); break;
1747 case 165: mTimezonePolicy = TimezonePolicy.get(value); break;
1748 case 166: mWebPresencePolicy = WebPresencePolicy.get(value); break;
1749 case 168: mPhoneNumbersPolicy = PhoneNumbersPolicy.get(value); break;
1750 case 169: mVoicemailPolicy = VoicemailPolicy.get(value); break;
1751 case 773:
1752 if (svalue != null) mPartnerOptedOut = svalue;
1753 else mSidCached &=~bit;
1754 break;
1755 case 800:
1756 if (svalue != null) mServiceProviderInfo = svalue;
1757 else mSidCached &=~bit;
1758 break;
1759 case 801: mRegistrationTimestamp = value; break;
1760 case 802: mOtherInstancesCount = value; break;
1761 case 4:
1762 if (svalue != null) mSkypeName = svalue;
1763 else mSidCached &=~bit;
1764 break;
1765 case 5:
1766 if (svalue != null) mFullName = svalue;
1767 else mSidCached &=~bit;
1768 break;
1769 case 7: mBirthday = value; break;
1770 case 8: mGender = value; break;
1771 case 9:
1772 if (svalue != null) mLanguages = svalue;
1773 else mSidCached &=~bit;
1774 break;
1775 case 10:
1776 if (svalue != null) mCountry = svalue;
1777 else mSidCached &=~bit;
1778 break; case 11:
1779 if (svalue != null) mProvince = svalue;
1780 else mSidCached &=~bit;
1781 break;
1782 case 12:
1783 if (svalue != null) mCity = svalue;
1784 else mSidCached &=~bit;
1785 break;
1786 case 13:
1787 if (svalue != null) mPhoneHome = svalue;
1788 else mSidCached &=~bit;
1789 break;
1790 case 14:
1791 if (svalue != null) mPhoneOffice = svalue;
1792 else mSidExtraCached[0] &=~bit;
1793 break;
1794 case 15:
1795 if (svalue != null) mPhoneMobile = svalue;
1796 else mSidExtraCached[0] &=~bit;
1797 break;
1798 case 16:
1799 if (svalue != null) mEmails = svalue;
1800 else mSidExtraCached[0] &=~bit;
1801 break;
1802 case 17:
1803 if (svalue != null) mHomepage = svalue;
1804 else mSidExtraCached[0] &=~bit;
1805 break;
1806 case 18:
1807 if (svalue != null) mAbout = svalue;
1808 else mSidExtraCached[0] &=~bit;
1809 break;
1810 case 19: mProfileTimestamp = value; break;
1811 case 26:
1812 if (svalue != null) mMoodText = svalue;
1813 else mSidExtraCached[0] &=~bit;
1814 break;
1815 case 27: mTimezone = value; break;
1816 case 28: mNrofAuthedBuddies = value; break;
1817 case 34: mAvailability = Contact.Availability.get(value); break;
1818 case 182: mAvatarTimestamp = value; break;
1819 case 183: mMoodTimestamp = value; break;
1820 default: if (word == 0) mSidCached &= bit; else mSidExtraCached[word-1] &= ~bit; break;
1821 }
1822 }
1823 }
1824 AccountListener listener = ((Skype) mSidRoot).getAccountListener();
1825 if (listener != null)
1826 listener.onPropertyChange(this, property, value, svalue);
1827 }
1828 public void sidSetProperty(final PropertyEnumConverting prop, final String newValue) {
1829 final int propId = prop.getId();
1830 switch(propId) {
1831 case 72:
1832 mSidCached |= 0x10;
1833 mSuggestedSkypeName= newValue;
1834 break;
1835 case 74:
1836 mSidCached |= 0x20;
1837 mSkypeoutBalanceCurrency= newValue;
1838 break;
1839 case 76:
1840 mSidCached |= 0x100;
1841 mSkypeinNumbers= newValue;
1842 break;
1843 case 77:
1844 mSidCached |= 0x400;
1845 mOfflineCallForward= newValue;
1846 break;
1847 case 773:
1848 mSidCached |= 0x100000;
1849 mPartnerOptedOut= newValue;
1850 break;
1851 case 800:
1852 mSidCached |= 0x200000;
1853 mServiceProviderInfo= newValue;
1854 break;
1855 case 4:
1856 mSidCached |= 0x1000000;
1857 mSkypeName= newValue;
1858 break;
1859 case 5:
1860 mSidCached |= 0x2000000;
1861 mFullName= newValue;
1862 break;
1863 case 9:
1864 mSidCached |= 0x10000000;
1865 mLanguages= newValue;
1866 break;
1867 case 10:
1868 mSidCached |= 0x20000000;
1869 mCountry= newValue;
1870 break;
1871 case 11:
1872 mSidCached |= 0x40000000;
1873 mProvince= newValue;
1874 break;
1875 case 12:
1876 mSidCached |= 0x80000000;
1877 mCity= newValue;
1878 break;
1879 case 13:
1880 mSidExtraCached[0] |= 0x1;
1881 mPhoneHome= newValue;
1882 break;
1883 case 14:
1884 mSidExtraCached[0] |= 0x2;
1885 mPhoneOffice= newValue;
1886 break;
1887 case 15:
1888 mSidExtraCached[0] |= 0x4;
1889 mPhoneMobile= newValue;
1890 break;
1891 case 16:
1892 mSidExtraCached[0] |= 0x8;
1893 mEmails= newValue;
1894 break;
1895 case 17:
1896 mSidExtraCached[0] |= 0x10;
1897 mHomepage= newValue;
1898 break;
1899 case 18:
1900 mSidExtraCached[0] |= 0x20;
1901 mAbout= newValue;
1902 break;
1903 case 26:
1904 mSidExtraCached[0] |= 0x80;
1905 mMoodText= newValue;
1906 break;
1907 case 205:
1908 mSidExtraCached[0] |= 0x4000;
1909 mRichMoodText= newValue;
1910 break;
1911 }
1912 }
1913 public void sidSetProperty(final PropertyEnumConverting prop, final int newValue) {
1914 final int propId = prop.getId();
1915 switch(propId) {
1916 case 70:
1917 mSidCached |= 0x1;
1918 mStatus= Status.get(newValue);
1919 break;
1920 case 71:
1921 mSidCached |= 0x2;
1922 mPwdChangeStatus= PwdChangeStatus.get(newValue);
1923 break;
1924 case 73:
1925 mSidCached |= 0x4;
1926 mLogoutReason= LogoutReason.get(newValue);
1927 break;
1928 case 78:
1929 mSidCached |= 0x8;
1930 mCommitStatus= CommitStatus.get(newValue);
1931 break;
1932 case 75:
1933 mSidCached |= 0x40;
1934 mSkypeoutBalance= newValue;
1935 break;
1936 case 804:
1937 mSidCached |= 0x80;
1938 mSkypeoutPrecision= newValue;
1939 break;
1940 case 79:
1941 mSidCached |= 0x200;
1942 mCblSyncStatus= CblSyncStatus.get(newValue);
1943 break;
1944 case 160:
1945 mSidCached |= 0x800;
1946 mChatPolicy= ChatPolicy.get(newValue);
1947 break;
1948 case 161:
1949 mSidCached |= 0x1000;
1950 mSkypeCallPolicy= SkypeCallPolicy.get(newValue);
1951 break;
1952 case 162:
1953 mSidCached |= 0x2000;
1954 mPstnCallPolicy= PstnCallPolicy.get(newValue);
1955 break;
1956 case 163:
1957 mSidCached |= 0x4000;
1958 mAvatarPolicy= AvatarPolicy.get(newValue);
1959 break;
1960 case 164:
1961 mSidCached |= 0x8000;
1962 mBuddyCountPolicy= BuddyCountPolicy.get(newValue);
1963 break;
1964 case 165:
1965 mSidCached |= 0x10000;
1966 mTimezonePolicy= TimezonePolicy.get(newValue);
1967 break;
1968 case 166:
1969 mSidCached |= 0x20000;
1970 mWebPresencePolicy= WebPresencePolicy.get(newValue);
1971 break;
1972 case 168:
1973 mSidCached |= 0x40000;
1974 mPhoneNumbersPolicy= PhoneNumbersPolicy.get(newValue);
1975 break;
1976 case 169:
1977 mSidCached |= 0x80000;
1978 mVoicemailPolicy= VoicemailPolicy.get(newValue);
1979 break;
1980 case 801:
1981 mSidCached |= 0x400000;
1982 mRegistrationTimestamp= newValue;
1983 break;
1984 case 802:
1985 mSidCached |= 0x800000;
1986 mOtherInstancesCount= newValue;
1987 break;
1988 case 7:
1989 mSidCached |= 0x4000000;
1990 mBirthday= newValue;
1991 break;
1992 case 8:
1993 mSidCached |= 0x8000000;
1994 mGender= newValue;
1995 break;
1996 case 19:
1997 mSidExtraCached[0] |= 0x40;
1998 mProfileTimestamp= newValue;
1999 break;
2000 case 27:
2001 mSidExtraCached[0] |= 0x100;
2002 mTimezone= newValue;
2003 break;
2004 case 28:
2005 mSidExtraCached[0] |= 0x200;
2006 mNrofAuthedBuddies= newValue;
2007 break;
2008 case 34:
2009 mSidExtraCached[0] |= 0x400;
2010 mAvailability= Contact.Availability.get(newValue);
2011 break;
2012 case 182:
2013 mSidExtraCached[0] |= 0x1000;
2014 mAvatarTimestamp= newValue;
2015 break;
2016 case 183:
2017 mSidExtraCached[0] |= 0x2000;
2018 mMoodTimestamp= newValue;
2019 break;
2020 }
2021 }
2022 public void sidSetProperty(final PropertyEnumConverting prop, final byte[] newValue) {
2023 final int propId = prop.getId();
2024 assert(propId == 37);
2025 mSidExtraCached[0] |= 0x800;
2026 mAvatarImage= newValue;
2027 }
2028 public Status mStatus;
2029 public PwdChangeStatus mPwdChangeStatus;
2030 public LogoutReason mLogoutReason;
2031 public CommitStatus mCommitStatus;
2032 public String mSuggestedSkypeName;
2033 public String mSkypeoutBalanceCurrency;
2034 public int mSkypeoutBalance;
2035 public int mSkypeoutPrecision;
2036 public String mSkypeinNumbers;
2037 public CblSyncStatus mCblSyncStatus;
2038 public String mOfflineCallForward;
2039 public ChatPolicy mChatPolicy;
2040 public SkypeCallPolicy mSkypeCallPolicy;
2041 public PstnCallPolicy mPstnCallPolicy;
2042 public AvatarPolicy mAvatarPolicy;
2043 public BuddyCountPolicy mBuddyCountPolicy;
2044 public TimezonePolicy mTimezonePolicy;
2045 public WebPresencePolicy mWebPresencePolicy;
2046 public PhoneNumbersPolicy mPhoneNumbersPolicy;
2047 public VoicemailPolicy mVoicemailPolicy;
2048 public String mPartnerOptedOut;
2049 public String mServiceProviderInfo;
2050 public int mRegistrationTimestamp;
2051 public int mOtherInstancesCount;
2052 public String mSkypeName;
2053 public String mFullName;
2054 public int mBirthday;
2055 public int mGender;
2056 public String mLanguages;
2057 public String mCountry;
2058 public String mProvince;
2059 public String mCity;
2060 public String mPhoneHome;
2061 public String mPhoneOffice;
2062 public String mPhoneMobile;
2063 public String mEmails;
2064 public String mHomepage;
2065 public String mAbout;
2066 public int mProfileTimestamp;
2067 public String mMoodText;
2068 public int mTimezone;
2069 public int mNrofAuthedBuddies;
2070 public Contact.Availability mAvailability;
2071 public byte[] mAvatarImage;
2072 public int mAvatarTimestamp;
2073 public int mMoodTimestamp;
2074 public String mRichMoodText;
2075 /***
2076 * invalidateCache: the next time the property is get, it will be querried to the runtime, meanwhile it can be discarded.
2077 * This allows fine grained cache management. Note that this doesn't delete the property, you still have to set it to null * to get a chance having this behavior. The rationale if that the generated properties being public, you can directly assign it to null
2078 * whilst a generated invalidateCache would require switching on the values to do so.
2079 * Account o; o.invalidate(Account.Property.P_MY_PROP); o.mMyProp = null;
2080 * @param property the property to be invalidated
2081 */
2082 public void invalidateCache(final PropertyEnumConverting property) {
2083 int idx = property.getIdx();
2084 if (idx-- > 0) {
2085 int word = idx / 32;
2086 if (word-- == 0) mSidCached = ~(1<<(idx%32));
2087 else mSidExtraCached[word] &=~(1<<(idx%32));
2088 }
2089 }
2090
2091 protected boolean isCached(final PropertyEnumConverting property) {
2092 int idx = property.getIdx();
2093 if (idx-- > 0) {
2094 int word = idx / 32;
2095 if (word-- == 0) return (mSidCached & ~(1<<(idx%32))) != 0;
2096 else return (mSidExtraCached[word] & ~(1<<(idx%32))) != 0;
2097 }
2098 return false;
2099 }
2100
2101 protected boolean hasCached() {
2102 if (mSidCached != 0) return true;
2103 for (int i = 0, e = mSidExtraCached.length; i < e; i++)
2104 if (mSidExtraCached[i] != 0) return true;
2105 return false;
2106 }
2107 private int[] mSidExtraCached = new int[1];
2108 public int moduleId() {
2109 return 5;
2110 }
2111
2112 public Account(final int oid, final SidRoot root) {
2113 super(oid, root, 47);
2114 }
2115 }