forked from quicksilver/com.apple.AddressBook-qsplugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QSABMimicActionProvider.m
90 lines (67 loc) · 2.71 KB
/
QSABMimicActionProvider.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#import "QSABMimicActionProvider.h"
//#import <QSCore/QSCore.h>
//#import "QSWindow.h"
#import <AddressBook/AddressBook.h>
#define kABAimToAction @"AIM_MESSAGE"
#define kABCopyMapURLAction @"COPY_MAP_URL"
#define kQSABLargeTypeAction @"QSABLargeTypeAction"
@implementation QSABMimicActionProvider
- (NSArray *) types{
return [NSArray arrayWithObjects:QSContactPhoneType,nil];
}
- (NSArray *) actions{
return nil;
QSAction *action=[QSAction actionWithIdentifier:kQSABLargeTypeAction];
[action setIcon:[NSImage imageNamed:@"All16"]];
[action setProvider:self];
[action setAction:@selector(showLargeType:)];
[action setArgumentCount:1];
return [NSArray arrayWithObject:action];
}
- (NSArray *)validActionsForDirectObject:(QSObject *)dObject indirectObject:(QSObject *)iObject{
return nil;
return [NSArray arrayWithObject:kQSABLargeTypeAction];
}
- (QSObject *)mapOf:(QSObject *)dObject{
return nil;
}
- (NSArray *)validIndirectObjectsForAction:(NSString *)action directObject:(QSObject *)dObject{
//if ([action isEqualToString:
QSObject *proxy=[QSObject textProxyObjectWithDefaultValue:@""];
return [NSArray arrayWithObject:proxy];
//NSMutableArray *objects=[QSLib scoredArrayForString:nil inSet:[QSLib arrayForType:@"ABPeopleUIDsPboardType"]];
//return [NSArray arrayWithObjects:[NSNull null],objects,nil];
}
- (QSObject *)addData:(QSObject *)dObject toContact:(QSObject *)iObject{
//NSLog(@"%@,,,",[iObject objectForType:@"ABPeopleUIDsPboardType"]);
ABPerson *thePerson=(ABPerson *)[[ABAddressBook sharedAddressBook] recordForUniqueId:[iObject objectForType:@"ABPeopleUIDsPboardType"]];
NSString *string=[dObject stringValue];
NSString *note=[thePerson valueForProperty:kABNoteProperty];
if ([note length])
note=[note stringByAppendingFormat:@"\r%@",string];
else
note=string;
[thePerson setValue:note forProperty:kABNoteProperty];
//NSLog(@"note %@",[thePerson valueForProperty:kABNoteProperty]);
[[ABAddressBook sharedAddressBook]save];
return nil;
}
/*
- (char)isAMacDotComAddress:(QSObject *)dObject;
- (char)isAOLAddress:(QSObject *)dObject;
- (void)aimTo:(QSObject *)dObject;
- (void)sendIndividualMailNotification:(QSObject *)dObject;
- (void)gotoHomePage:(QSObject *)dObject;
- _mapURL:(QSObject *)dObject;
- (void)mapOf:(QSObject *)dObject;
- (void)copyMapURL:(QSObject *)dObject;
- (void)copyAddress:(QSObject *)dObject;
- (void)emailTo:(QSObject *)dObject;
- (void)macDotComHomePage:(QSObject *)dObject;
- (void)aolHomePage:(QSObject *)dObject;
- (void)homePageFromEmail:(QSObject *)dObject;
- (void)openPublicIDiskForUser:(QSObject *)dObject isMe:(char)fp12;
- (void)openIDisk:(QSObject *)dObject;
- (void)showLargeType:(QSObject *)dObject;
*/
@end