Add -[AIService pathForDefaultServiceIconOfType:], and use it for replacing %serviceIconImg% in headers. Fixes #12697.
2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
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.
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.
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.
17 #import "AIMobileMeService.h"
18 #import "AIPurpleMobileMeAccount.h"
19 #import "AIPurpleMobileMeAccountViewController.h"
20 #import <AIUtilities/AIImageAdditions.h>
22 @implementation AIMobileMeService
25 - (Class)accountClass{
26 return [AIPurpleMobileMeAccount class];
29 - (AIAccountViewController *)accountViewController{
30 return [AIPurpleMobileMeAccountViewController accountViewController];
34 - (NSString *)serviceCodeUniqueID{
35 return @"libpurple-oscar-MobileMe";
37 - (NSString *)serviceID{
40 - (NSString *)shortDescription{
43 - (NSString *)longDescription{
46 - (NSCharacterSet *)ignoredCharacters{
47 return [NSCharacterSet characterSetWithCharactersInString:@" "];
49 - (BOOL)caseSensitive{
52 - (AIServiceImportance)serviceImportance{
53 return AIServiceSecondary;
55 - (NSString *)userNameLabel{
56 return AILocalizedString(@"Member Name",nil); //.Mac Member Name
61 * Service Icon packs should always include images for all the built-in Adium services. This method allows external
62 * service plugins to specify an image which will be used when the service icon pack does not specify one. It will
63 * also be useful if new services are added to Adium itself after a significant number of Service Icon packs exist
64 * which do not yet have an image for this service. If the active Service Icon pack provides an image for this service,
65 * this method will not be called.
67 * The service should _not_ cache this icon internally; multiple calls should return unique NSImage objects.
69 * @param iconType The AIServiceIconType of the icon to return. This specifies the desired size of the icon.
70 * @return NSImage to use for this service by default
72 - (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType
74 return [NSImage imageNamed:((iconType == AIServiceIconSmall || iconType == AIServiceIconList) ? @"MobileMe-small" : @"MobileMe-large")
75 forClass:[self class] loadLazily:YES];
79 * @brief Path for default icon
81 * For use in message views, this is the path to a default icon as described above.
83 * @param iconType The AIServiceIconType of the icon to return.
84 * @return The path to the image, otherwise nil.
86 - (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType
88 if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) {
89 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"MobileMe-small"];
91 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"MobileMe-large"];