Add -[AIService pathForDefaultServiceIconOfType:], and use it for replacing %serviceIconImg% in headers. Fixes #12697.
5 // Created by Evan Schoenberg on 12/17/05.
8 #import "ESSimpleService.h"
9 #import "ESPurpleSimpleAccount.h"
10 #import "ESPurpleSimpleAccountViewController.h"
11 #import <Adium/AIStatusControllerProtocol.h>
12 #import <AIUtilities/AIImageAdditions.h>
14 @implementation ESSimpleService
16 - (Class)accountClass{
17 return [ESPurpleSimpleAccount class];
20 - (AIAccountViewController *)accountViewController{
21 return [ESPurpleSimpleAccountViewController accountViewController];
24 - (DCJoinChatViewController *)joinChatView{
29 - (NSString *)serviceCodeUniqueID{
30 return @"libpurple-simple";
32 - (NSString *)serviceID{
35 - (NSString *)serviceClass{
38 - (NSString *)shortDescription{
41 - (NSString *)longDescription{
42 return @"SIP / SIMPLE";
44 - (NSCharacterSet *)allowedCharacters{
45 return [NSCharacterSet characterSetWithCharactersInString:@"+abcdefghijklmnopqrstuvwxyz0123456789._-@\\"];
47 - (NSUInteger)allowedLength{
50 - (BOOL)caseSensitive{
53 - (AIServiceImportance)serviceImportance{
54 return AIServiceSecondary;
56 - (BOOL)canCreateGroupChats{
60 - (void)registerStatuses{
61 [adium.statusController registerStatus:STATUS_NAME_AVAILABLE
62 withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE]
63 ofType:AIAvailableStatusType
70 * Service Icon packs should always include images for all the built-in Adium services. This method allows external
71 * service plugins to specify an image which will be used when the service icon pack does not specify one. It will
72 * also be useful if new services are added to Adium itself after a significant number of Service Icon packs exist
73 * which do not yet have an image for this service. If the active Service Icon pack provides an image for this service,
74 * this method will not be called.
76 * The service should _not_ cache this icon internally; multiple calls should return unique NSImage objects.
78 * @param iconType The AIServiceIconType of the icon to return. This specifies the desired size of the icon.
79 * @return NSImage to use for this service by default
81 - (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType
83 return [NSImage imageNamed:@"simple" forClass:[self class] loadLazily:YES];
87 * @brief Path for default icon
89 * For use in message views, this is the path to a default icon as described above.
91 * @param iconType The AIServiceIconType of the icon to return.
92 * @return The path to the image, otherwise nil.
94 - (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType
96 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"simple"];