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 "AILaconicaService.h"
18 #import <Adium/AIStatusControllerProtocol.h>
19 #import <AIUtilities/AIImageAdditions.h>
20 #import "AILaconicaAccount.h"
21 #import "AILaconicaAccountViewController.h"
23 @implementation AILaconicaService
26 return [AILaconicaAccount class];
29 - (AIAccountViewController *)accountViewController
31 return [AILaconicaAccountViewController accountViewController];
34 - (DCJoinChatViewController *)joinChatView
39 // Service description
40 - (NSString *)serviceCodeUniqueID{
43 - (NSString *)serviceID{
46 - (NSString *)serviceClass{
49 - (NSString *)shortDescription{
52 - (NSString *)longDescription{
55 - (NSCharacterSet *)allowedCharacters{
56 return [NSCharacterSet characterSetWithCharactersInString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"];
58 - (NSUInteger)allowedLength{
61 - (BOOL)caseSensitive{
64 - (AIServiceImportance)serviceImportance{
65 return AIServiceSecondary;
67 - (BOOL)supportsProxySettings{
70 - (void)registerStatuses{
71 [adium.statusController registerStatus:STATUS_NAME_AVAILABLE
72 withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE]
73 ofType:AIAvailableStatusType
77 - (BOOL)isSocialNetworkingService
85 * Service Icon packs should always include images for all the built-in Adium services. This method allows external
86 * service plugins to specify an image which will be used when the service icon pack does not specify one. It will
87 * also be useful if new services are added to Adium itself after a significant number of Service Icon packs exist
88 * which do not yet have an image for this service. If the active Service Icon pack provides an image for this service,
89 * this method will not be called.
91 * The service should _not_ cache this icon internally; multiple calls should return unique NSImage objects.
93 * @param iconType The AIServiceIconType of the icon to return. This specifies the desired size of the icon.
94 * @return NSImage to use for this service by default
96 - (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType
98 if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) {
99 return [NSImage imageNamed:@"laconica-small" forClass:[self class] loadLazily:YES];
101 return [NSImage imageNamed:@"laconica" forClass:[self class] loadLazily:YES];
106 * @brief Path for default icon
108 * For use in message views, this is the path to a default icon as described above.
110 * @param iconType The AIServiceIconType of the icon to return.
111 * @return The path to the image, otherwise nil.
113 - (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType
115 if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) {
116 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"laconica-small"];
118 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"laconica"];