webticket: implement caching
[siplcs.git] / src / adium / ESSIPEService.m
blob3bbf85524429987e47bd8f081da44c3726f97e90
1 //
2 //  ESSIPEService.m
3 //  SIPEAdiumPlugin
4 //
5 //  Created by Matt Meissner on 10/30/09.
6 //  Copyright 2009 Matt Meissner. All rights reserved.
7 //
9 #import <AppKit/AppKit.h>
11 #import <AIUtilities/AICharacterSetAdditions.h>
12 #import <AIUtilities/AIImageAdditions.h>
13 #import <Adium/AIStatusControllerProtocol.h>
14 #import <AISharedAdium.h>
16 #import "ESSIPEAccountViewController.h"
17 #import "ESPurpleSIPEAccount.h"
18 #import "ESSIPEService.h"
20 @implementation ESSIPEService
22 //Account Creation -----------------------------------------------------------------------------------------------------
23 #pragma mark Account Creation
25 - (Class)accountClass
27         return [ESPurpleSIPEAccount class];
30 - (AIAccountViewController *)accountViewController{
31     return [ESSIPEAccountViewController accountViewController];
34 //Service Description --------------------------------------------------------------------------------------------------
35 #pragma mark Service Description
36 - (NSString *)serviceCodeUniqueID{
37     return @"libpurple-SIPE";
40 - (NSString *)serviceID{
41     return @"SIPE";
44 - (NSString *)serviceClass{
45         return @"SIPE";
48 - (NSString *)shortDescription{
49     return @"Office Communicator";
52 - (NSString *)longDescription{
53     return @"Office Communicator";
56 - (NSString *)UIDPlaceholder
58         return @"username@company.com,DOMAIN\\username";
62 - (NSCharacterSet *)allowedCharacters
64         NSMutableCharacterSet *allowedCharacters = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
65         NSCharacterSet *returnSet;
66         
67         [allowedCharacters addCharactersInString:@"._@-()[]^%#|/\\`=,"];
68         returnSet = [allowedCharacters immutableCopy];
69         
70         return [returnSet autorelease];
73 - (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType
75         NSImage *image;
76         
77         if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) {
78                 image = [NSImage imageNamed:@"sipe-small"];
79         } else {
80                 image = [NSImage imageNamed:@"sipe"];
81         }
83         return image;
86 - (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType
88         if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) {
89                 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"sipe-small"];
90         } else {
91                 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"sipe"];           
92         }
95 //Service Properties ---------------------------------------------------------------------------------------------------
96 #pragma mark Service Properties
98 - (BOOL)canCreateGroupChats
100         return YES;
103 - (AIServiceImportance)serviceImportance{
104         return AIServiceSecondary;
107 - (void)registerStatuses{
108         [adium.statusController registerStatus:STATUS_NAME_AVAILABLE
109                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE]
110                                     ofType:AIAvailableStatusType
111                                 forService:self];
113 - (BOOL)supportsPassword
115         return YES;
118 - (BOOL)requiresPassword
120         return YES;
123 @end