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/AIAbstractListObjectMenu.h> |
---|
18 | #import <Adium/AIContactControllerProtocol.h> |
---|
19 | |
---|
20 | @class AIAccount, AIStatusMenu; |
---|
21 | |
---|
22 | typedef enum { |
---|
23 | AIAccountNoSubmenu = 0, |
---|
24 | AIAccountStatusSubmenu, |
---|
25 | AIAccountOptionsSubmenu |
---|
26 | } AIAccountSubmenuType; |
---|
27 | |
---|
28 | @interface AIAccountMenu : AIAbstractListObjectMenu <AIListObjectObserver> { |
---|
29 | id delegate; |
---|
30 | BOOL delegateRespondsToDidSelectAccount; |
---|
31 | BOOL delegateRespondsToShouldIncludeAccount; |
---|
32 | |
---|
33 | BOOL useSystemFont; |
---|
34 | BOOL submenuType; |
---|
35 | BOOL showTitleVerbs; |
---|
36 | BOOL includeDisabledAccountsMenu; |
---|
37 | BOOL includeAddAccountsMenu; |
---|
38 | BOOL includeConnectAllMenuItem; |
---|
39 | |
---|
40 | NSControlSize controlSize; |
---|
41 | |
---|
42 | AIStatusMenu *statusMenu; |
---|
43 | } |
---|
44 | |
---|
45 | + (id)accountMenuWithDelegate:(id)inDelegate |
---|
46 | submenuType:(AIAccountSubmenuType)inSubmenuType |
---|
47 | showTitleVerbs:(BOOL)inShowTitleVerbs; |
---|
48 | |
---|
49 | /*! @brief Whether to use the system font instead of the menu font. |
---|
50 | * |
---|
51 | * @par By default, menu items in the account menu use the menu font, but a client can request them with the system font instead. |
---|
52 | * |
---|
53 | * @return \c NO if the menu font should be used (the default); \c YES if the system font should be used instead. |
---|
54 | */ |
---|
55 | - (BOOL) useSystemFont; |
---|
56 | /*! @brief Change whether to use the system font instead of the menu font. |
---|
57 | * |
---|
58 | * @par By default, menu items in the account menu use the menu font, but a client can request them with the system font instead. |
---|
59 | * |
---|
60 | * @par One situation in which it's appropriate to use the system font instead of the menu font is in the case of an NSPopUpButton, in which case the menu font is too big. |
---|
61 | * |
---|
62 | * @param flag \c NO if the menu font should be used (the default); \c YES if the system font should be used instead. |
---|
63 | */ |
---|
64 | - (void) setUseSystemFont:(BOOL)flag; |
---|
65 | |
---|
66 | - (void)setDelegate:(id)inDelegate; |
---|
67 | - (id)delegate; |
---|
68 | |
---|
69 | - (NSMenuItem *)menuItemForAccount:(AIAccount *)account; |
---|
70 | |
---|
71 | @end |
---|
72 | |
---|
73 | @interface NSObject (AIAccountMenuDelegate) |
---|
74 | - (void)accountMenu:(AIAccountMenu *)inAccountMenu didRebuildMenuItems:(NSArray *)menuItems; |
---|
75 | - (void)accountMenu:(AIAccountMenu *)inAccountMenu didSelectAccount:(AIAccount *)inAccount; //Optional |
---|
76 | - (BOOL)accountMenu:(AIAccountMenu *)inAccountMenu shouldIncludeAccount:(AIAccount *)inAccount; //Optional |
---|
77 | |
---|
78 | /*! |
---|
79 | * @brief At what size will this menu be used? |
---|
80 | * |
---|
81 | * If not implemented, the default is NSRegularControlSize. NSMiniControlSize is not supported. |
---|
82 | */ |
---|
83 | - (NSControlSize)controlSizeForAccountMenu:(AIAccountMenu *)inAccountMenu; //Optional |
---|
84 | |
---|
85 | //Should the account menu include a submenu of services for adding accounts? |
---|
86 | - (BOOL)accountMenuShouldIncludeAddAccountsMenu:(AIAccountMenu *)inAccountMenu; //Optional |
---|
87 | |
---|
88 | //Should the account menu include a "connect all" menu item? |
---|
89 | - (BOOL)accountMenuShouldIncludeConnectAllMenuItem:(AIAccountMenu *)inAccountMenu; //Optional |
---|
90 | |
---|
91 | //Should the account menu include a submenu of 'disabled accounts'? |
---|
92 | - (BOOL)accountMenuShouldIncludeDisabledAccountsMenu:(AIAccountMenu *)inAccountMenu; //Optional |
---|
93 | @end |
---|