Frameworks/Adium Framework/Source/AIStatusControllerProtocol.h
author Frank Dowsett <wixardy@adium.im>
Sun Feb 05 20:13:17 2012 -0500 (3 months ago)
branchPreferencesRedux
changeset 4670 16d2f6ca66d1
parent 1505 7381a793a78a
permissions -rw-r--r--
Update the XMPP logo and change the name from "Jabber" to "XMPP". Fixes #10375
wixardy@3679
     1
/* 
wixardy@3679
     2
 * Adium is the legal property of its developers, whose names are listed in the copyright file included
wixardy@3679
     3
 * with this source distribution.
wixardy@3679
     4
 * 
wixardy@3679
     5
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
wixardy@3679
     6
 * General Public License as published by the Free Software Foundation; either version 2 of the License,
wixardy@3679
     7
 * or (at your option) any later version.
wixardy@3679
     8
 * 
wixardy@3679
     9
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
wixardy@3679
    10
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
wixardy@3679
    11
 * Public License for more details.
wixardy@3679
    12
 * 
wixardy@3679
    13
 * You should have received a copy of the GNU General Public License along with this program; if not,
wixardy@3679
    14
 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
David@0
    15
 */
David@0
    16
David@0
    17
#import <Adium/AIControllerProtocol.h>
David@557
    18
#import <Adium/AIStatusDefines.h>
David@0
    19
David@557
    20
@class AIStatus, AIAccount, AIStatusGroup, AIService;
David@0
    21
David@0
    22
//Status State Notifications
David@0
    23
#define AIStatusStateArrayChangedNotification	@"AIStatusStateArrayChangedNotification"
David@0
    24
#define AIStatusActiveStateChangedNotification	@"AIStatusActiveStateChangedNotification"
David@0
    25
David@0
    26
//Idle Notifications
David@0
    27
#define AIMachineIsIdleNotification				@"AIMachineIsIdleNotification"
David@0
    28
#define AIMachineIsActiveNotification			@"AIMachineIsActiveNotification"
David@0
    29
#define AIMachineIdleUpdateNotification			@"AIMachineIdleUpdateNotification"
David@0
    30
David@0
    31
//Preferences
David@0
    32
#define PREF_GROUP_SAVED_STATUS					@"Saved Status"
David@0
    33
#define KEY_SAVED_STATUS						@"Saved Status Array"
David@0
    34
David@0
    35
#define KEY_STATUS_NAME							@"Status Name"
David@0
    36
#define KEY_STATUS_DESCRIPTION					@"Status Description"
David@0
    37
#define	KEY_STATUS_TYPE							@"Status Type"
David@0
    38
David@0
    39
#define PREF_GROUP_STATUS_PREFERENCES			@"Status Preferences"
David@0
    40
#define KEY_STATUS_CONVERSATION_COUNT			@"Unread Conversations"
zacw@1505
    41
#define KEY_STATUS_MENTION_COUNT				@"Unread Mentions"
David@0
    42
#define KEY_STATUS_REPORT_IDLE					@"Report Idle"
David@0
    43
#define KEY_STATUS_REPORT_IDLE_INTERVAL			@"Report Idle Interval"
David@0
    44
#define	KEY_STATUS_AUTO_AWAY					@"Auto Away"
David@0
    45
#define KEY_STATUS_AUTO_AWAY_STATUS_STATE_ID	@"Auto Away Status State ID"
David@0
    46
#define KEY_STATUS_FUS							@"Fast User Switching Auto Away"
David@0
    47
#define KEY_STATUS_FUS_STATUS_STATE_ID			@"Fast User Switching Status State ID"
David@0
    48
#define KEY_STATUS_SS							@"ScreenSaver Auto Away"
David@0
    49
#define KEY_STATUS_SS_STATUS_STATE_ID			@"ScreenSaver Status State ID"
David@0
    50
#define KEY_STATUS_AUTO_AWAY_INTERVAL			@"Auto Away Interval"
David@0
    51
David@0
    52
#define KEY_STATUS_SHOW_STATUS_WINDOW				@"Show Status Window"
David@0
    53
#define KEY_STATUS_STATUS_WINDOW_ON_TOP				@"Status Window Always On Top"
David@0
    54
#define KEY_STATUS_STATUS_WINDOW_HIDE_IN_BACKGROUND	@"Status Window Hide in Background"
David@0
    55
David@0
    56
//Built-in names and descriptions, which services should use when they support identical or approximately identical states
David@0
    57
#define	STATUS_NAME_AVAILABLE				@"Generic Available"
David@0
    58
#define STATUS_NAME_FREE_FOR_CHAT			@"Free for Chat"
David@0
    59
#define STATUS_NAME_AVAILABLE_FRIENDS_ONLY	@"Available for Friends Only"
David@0
    60
David@0
    61
#define	STATUS_NAME_AWAY					@"Generic Away"
David@0
    62
#define STATUS_NAME_EXTENDED_AWAY			@"Extended Away"
David@0
    63
#define STATUS_NAME_AWAY_FRIENDS_ONLY		@"Away for Friends Only"
David@0
    64
#define STATUS_NAME_DND						@"DND"
David@0
    65
#define STATUS_NAME_NOT_AVAILABLE			@"Not Available"
David@0
    66
#define STATUS_NAME_OCCUPIED				@"Occupied"
David@0
    67
#define STATUS_NAME_BRB						@"BRB"
David@0
    68
#define STATUS_NAME_BUSY					@"Busy"
David@0
    69
#define STATUS_NAME_PHONE					@"Phone"
David@0
    70
#define STATUS_NAME_LUNCH					@"Lunch"
David@0
    71
#define STATUS_NAME_NOT_AT_HOME				@"Not At Home"
David@0
    72
#define STATUS_NAME_NOT_AT_DESK				@"Not At Desk"
David@0
    73
#define STATUS_NAME_NOT_IN_OFFICE			@"Not In Office"
David@0
    74
#define STATUS_NAME_VACATION				@"Vacation"
David@0
    75
#define STATUS_NAME_STEPPED_OUT				@"Stepped Out"
David@0
    76
David@0
    77
#define STATUS_NAME_INVISIBLE				@"Invisible"
David@0
    78
David@0
    79
#define STATUS_NAME_OFFLINE					@"Offline"
David@0
    80
David@0
    81
//Current version state ID string
David@0
    82
#define STATE_SAVED_STATE					@"State"
David@0
    83
David@0
    84
@protocol AIStatusController <AIController>
David@0
    85
/*!
David@0
    86
 * @brief Register a status for a service
David@0
    87
 *
David@0
    88
 * Implementation note: Each AIStatusType has its own NSMutableDictionary, statusDictsByServiceCodeUniqueID.
David@0
    89
 * statusDictsByServiceCodeUniqueID is keyed by serviceCodeUniqueID; each object is an NSMutableSet of NSDictionaries.
David@0
    90
 * Each of these dictionaries has KEY_STATUS_NAME, KEY_STATUS_DESCRIPTION, and KEY_STATUS_TYPE.
David@0
    91
 *
David@0
    92
 * @param statusName A name which will be passed back to accounts of this service.  Internal use only.  Use the AIStatusController.h \#defines where appropriate.
David@0
    93
 * @param description A human-readable localized description which will be shown to the user.  Use the AIStatusController.h \#defines where appropriate.
David@0
    94
 * @param type An AIStatusType, the general type of this status.
David@0
    95
 * @param service The AIService for which to register the status
David@0
    96
 */
David@0
    97
- (void)registerStatus:(NSString *)statusName
David@0
    98
	   withDescription:(NSString *)description
David@0
    99
				ofType:(AIStatusType)type 
David@0
   100
			forService:(AIService *)service;
David@0
   101
/*!
David@0
   102
 * @brief Generate and return a menu of status types (Away, Be right back, etc.)
David@0
   103
 *
David@0
   104
 * @param service The service for which to return a specific list of types, or nil to return all available types
David@0
   105
 * @param target The target for the menu items, which will have an action of \@selector(selectStatus:)
David@0
   106
 *
David@0
   107
 * @result The menu of statuses, separated by available and away status types
David@0
   108
 */
David@0
   109
- (NSMenu *)menuOfStatusesForService:(AIService *)service withTarget:(id)target;
David@0
   110
David@418
   111
@property (readonly, nonatomic) NSSet *flatStatusSet;
David@418
   112
@property (readonly, nonatomic) NSArray *sortedFullStateArray;
David@418
   113
@property (readonly, nonatomic) AIStatus *offlineStatusState;
David@418
   114
@property (readonly, nonatomic) AIStatus *availableStatus;
David@418
   115
@property (readonly, nonatomic) AIStatus *awayStatus;
David@418
   116
@property (readonly, nonatomic) AIStatus *invisibleStatus;
David@418
   117
@property (readonly, nonatomic) AIStatus *offlineStatus;
David@0
   118
- (AIStatus *)statusStateWithUniqueStatusID:(NSNumber *)uniqueStatusID;
David@0
   119
David@0
   120
- (void)setActiveStatusState:(AIStatus *)state;
David@0
   121
- (void)setActiveStatusState:(AIStatus *)state forAccount:(AIAccount *)account;
David@0
   122
- (void)setDelayStatusMenuRebuilding:(BOOL)shouldDelay;
David@0
   123
- (void)applyState:(AIStatus *)statusState toAccounts:(NSArray *)accountArray;
David@418
   124
@property (readonly, nonatomic) AIStatus *activeStatusState;
David@0
   125
- (NSSet *)allActiveStatusStates;
David@0
   126
- (AIStatusType)activeStatusTypeTreatingInvisibleAsAway:(BOOL)invisibleIsAway;
David@0
   127
- (NSSet *)activeUnavailableStatusesAndType:(AIStatusType *)activeUnvailableStatusType 
David@0
   128
								   withName:(NSString **)activeUnvailableStatusName
David@0
   129
			 allOnlineAccountsAreUnvailable:(BOOL *)allOnlineAccountsAreUnvailable;
David@0
   130
- (AIStatus *)defaultInitialStatusState;
David@0
   131
David@0
   132
- (NSString *)descriptionForStateOfStatus:(AIStatus *)statusState;
David@0
   133
- (NSString *)localizedDescriptionForCoreStatusName:(NSString *)statusName;
David@0
   134
- (NSString *)localizedDescriptionForStatusName:(NSString *)statusName statusType:(AIStatusType)statusType;
David@0
   135
- (NSString *)defaultStatusNameForType:(AIStatusType)statusType;
David@0
   136
David@0
   137
//State Editing
David@0
   138
- (void)addStatusState:(AIStatus *)state;
David@0
   139
- (void)removeStatusState:(AIStatus *)state;
David@0
   140
- (void)statusStateDidSetUniqueStatusID;
David@0
   141
David@0
   142
//State menu support
David@0
   143
- (void)setDelayActiveStatusUpdates:(BOOL)shouldDelay;
David@0
   144
- (BOOL)removeIfNecessaryTemporaryStatusState:(AIStatus *)originalState;
David@0
   145
- (AIStatusGroup *)rootStateGroup;
David@0
   146
David@0
   147
- (void)savedStatusesChanged;
David@0
   148
- (void)statusStateDidSetUniqueStatusID;
David@0
   149
@end