1 | /* |
---|
2 | * Adium is the legal property of its developers, whose names are listed in the copyright file included |
---|
3 | * with this source distribution. |
---|
4 | * |
---|
5 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
---|
6 | * General Public License as published by the Free Software Foundation; either version 2 of the License, |
---|
7 | * or (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
---|
10 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
11 | * Public License for more details. |
---|
12 | * |
---|
13 | * You should have received a copy of the GNU General Public License along with this program; if not, |
---|
14 | * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
15 | */ |
---|
16 | |
---|
17 | #import <Adium/AIAccount.h> |
---|
18 | |
---|
19 | @class AIWiredString; |
---|
20 | |
---|
21 | typedef enum { |
---|
22 | AIReconnectNever = 0, |
---|
23 | AIReconnectImmediately, |
---|
24 | AIReconnectNormally |
---|
25 | } AIReconnectDelayType; |
---|
26 | |
---|
27 | @interface AIAccount (Abstract) |
---|
28 | |
---|
29 | - (id)initWithUID:(NSString *)inUID internalObjectID:(NSString *)inInternalObjectID service:(AIService *)inService; |
---|
30 | - (NSData *)userIconData; |
---|
31 | - (void)setUserIconData:(NSData *)inData; |
---|
32 | - (NSString *)host; |
---|
33 | - (int)port; |
---|
34 | - (void)filterAndSetUID:(NSString *)inUID; |
---|
35 | - (BOOL)enabled; |
---|
36 | - (void)setEnabled:(BOOL)inEnabled; |
---|
37 | |
---|
38 | //Status |
---|
39 | - (void)preferencesChangedForGroup:(NSString *)group key:(NSString *)key object:(AIListObject *)object |
---|
40 | preferenceDict:(NSDictionary *)prefDict firstTime:(BOOL)firstTime; |
---|
41 | - (void)silenceAllContactUpdatesForInterval:(NSTimeInterval)interval; |
---|
42 | - (void)updateContactStatus:(AIListContact *)inContact; |
---|
43 | - (void)updateCommonStatusForKey:(NSString *)key; |
---|
44 | - (AIStatus *)statusState; |
---|
45 | - (AIStatus *)actualStatusState; |
---|
46 | - (void)setStatusState:(AIStatus *)statusState; |
---|
47 | - (void)setStatusStateAndRemainOffline:(AIStatus *)statusState; |
---|
48 | |
---|
49 | //Properties |
---|
50 | - (NSString *)currentDisplayName; |
---|
51 | |
---|
52 | /*! |
---|
53 | * @brief Sent by an account to itself to update its user icon |
---|
54 | * |
---|
55 | * Both NSImage and NSData forms are passed to prevent duplication of data; either or both may be used. |
---|
56 | * |
---|
57 | * The image should be resized as needed for the protocol. |
---|
58 | * |
---|
59 | * Subclasses MUST call super's implementation. |
---|
60 | * |
---|
61 | * @param image An NSImage of the user icon, or nil if no image. |
---|
62 | * @param originalData The original data which made the image, which may be in any NSImage-compatible format, or nil if no image. |
---|
63 | */ |
---|
64 | - (void)setAccountUserImage:(NSImage *)image withData:(NSData *)originalData; |
---|
65 | |
---|
66 | //Auto-Refreshing Status String |
---|
67 | - (NSAttributedString *)autoRefreshingOutgoingContentForStatusKey:(NSString *)key; |
---|
68 | - (void)autoRefreshingOutgoingContentForStatusKey:(NSString *)key selector:(SEL)selector context:(id)originalContext; |
---|
69 | - (NSAttributedString *)autoRefreshingOriginalAttributedStringForStatusKey:(NSString *)key; |
---|
70 | - (void)setValue:(id)value forProperty:(NSString *)key notify:(NotifyTiming)notify; |
---|
71 | - (void)startAutoRefreshingStatusKey:(NSString *)key forOriginalValueString:(NSString *)originalValueString; |
---|
72 | - (void)stopAutoRefreshingStatusKey:(NSString *)key; |
---|
73 | - (void)_startAttributedRefreshTimer; |
---|
74 | - (void)_stopAttributedRefreshTimer; |
---|
75 | - (void)gotFilteredStatusMessage:(NSAttributedString *)statusMessage forStatusState:(AIStatus *)statusState; |
---|
76 | - (void)updateLocalDisplayNameTo:(NSAttributedString *)displayName; |
---|
77 | - (NSString *)currentDisplayName; |
---|
78 | |
---|
79 | //Contacts |
---|
80 | - (NSArray *)contacts; |
---|
81 | - (AIListContact *)contactWithUID:(NSString *)sourceUID; |
---|
82 | - (void)removeAllContacts; |
---|
83 | - (void)removePropetyValuesFromContact:(AIListContact *)listContact silently:(BOOL)silent; |
---|
84 | |
---|
85 | //Connectivity |
---|
86 | - (BOOL)shouldBeOnline; |
---|
87 | - (void)setShouldBeOnline:(BOOL)inShouldBeOnline; |
---|
88 | - (void)toggleOnline; |
---|
89 | - (void)didConnect; |
---|
90 | - (NSSet *)contactProperties; |
---|
91 | - (void)didDisconnect; |
---|
92 | - (void)connectScriptCommand:(NSScriptCommand *)command; |
---|
93 | - (void)disconnectScriptCommand:(NSScriptCommand *)command; |
---|
94 | - (void)serverReportedInvalidPassword; |
---|
95 | - (void)getProxyConfigurationNotifyingTarget:(id)target selector:(SEL)selector context:(id)context; |
---|
96 | - (NSString *)lastDisconnectionError; |
---|
97 | - (void)setLastDisconnectionError:(NSString *)inError; |
---|
98 | - (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString **)disconnectionError; |
---|
99 | - (BOOL)encrypted; |
---|
100 | |
---|
101 | //FUS Disconnecting |
---|
102 | - (void)autoReconnectAfterDelay:(NSTimeInterval)delay; |
---|
103 | - (void)cancelAutoReconnect; |
---|
104 | - (void)initFUSDisconnecting; |
---|
105 | |
---|
106 | //Temporary Accounts |
---|
107 | - (BOOL)isTemporary; |
---|
108 | - (void)setIsTemporary:(BOOL)inIsTemporary; |
---|
109 | |
---|
110 | - (void)setPasswordTemporarily:(AIWiredString *)inPassword; |
---|
111 | /*! |
---|
112 | * @brief While we are connected, return the password used to connect |
---|
113 | * |
---|
114 | * This will not look up the password in the keychain. Results are undefined if we are not connected. |
---|
115 | */ |
---|
116 | - (AIWiredString *)passwordWhileConnected; |
---|
117 | |
---|
118 | @end |
---|
119 | |
---|
120 | @interface AIAccount (Abstract_ForSubclasses) |
---|
121 | //Chats |
---|
122 | - (void)displayYouHaveConnectedInChat:(AIChat *)chat; |
---|
123 | @end |
---|