Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
7640 views
1
#import "MuTapResult.h"
2
3
@implementation MuTapResult
4
-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock caseWidget:(void (^)(MuTapResultWidget *))widgetBlock caseAnnotation:(void (^)(MuTapResultAnnotation *))annotationBlock {}
5
@end
6
7
@implementation MuTapResultInternalLink
8
{
9
int pageNumber;
10
}
11
12
@synthesize pageNumber;
13
14
-(id) initWithPageNumber:(int)aNumber
15
{
16
self = [super init];
17
if (self)
18
{
19
pageNumber = aNumber;
20
}
21
return self;
22
}
23
24
-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock caseWidget:(void (^)(MuTapResultWidget *))widgetBlock caseAnnotation:(void (^)(MuTapResultAnnotation *))annotationBlock
25
{
26
internalLinkBlock(self);
27
}
28
29
@end
30
31
@implementation MuTapResultExternalLink
32
{
33
NSString *url;
34
}
35
36
@synthesize url;
37
38
-(id) initWithUrl:(NSString *)aString
39
{
40
self = [super init];
41
if (self)
42
{
43
url = [aString retain];
44
}
45
return self;
46
}
47
48
-(void) dealloc
49
{
50
[url release];
51
[super dealloc];
52
}
53
54
-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock caseWidget:(void (^)(MuTapResultWidget *))widgetBlock caseAnnotation:(void (^)(MuTapResultAnnotation *))annotationBlock
55
{
56
externalLinkBlock(self);
57
}
58
59
@end
60
61
@implementation MuTapResultRemoteLink
62
{
63
NSString *fileSpec;
64
int pageNumber;
65
BOOL newWindow;
66
}
67
68
@synthesize fileSpec, pageNumber, newWindow;
69
70
-(id) initWithFileSpec:(NSString *)aString pageNumber:(int)aNumber newWindow:(BOOL)aBool
71
{
72
self = [super init];
73
if (self)
74
{
75
fileSpec = [aString retain];
76
pageNumber = aNumber;
77
newWindow = aBool;
78
}
79
return self;
80
}
81
82
-(void) dealloc
83
{
84
[fileSpec release];
85
[super dealloc];
86
}
87
88
-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock caseWidget:(void (^)(MuTapResultWidget *))widgetBlock caseAnnotation:(void (^)(MuTapResultAnnotation *))annotationBlock
89
{
90
remoteLinkBlock(self);
91
}
92
93
@end
94
95
@implementation MuTapResultWidget
96
97
-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock caseWidget:(void (^)(MuTapResultWidget *))widgetBlock caseAnnotation:(void (^)(MuTapResultAnnotation *))annotationBlock
98
{
99
widgetBlock(self);
100
}
101
102
@end
103
104
@implementation MuTapResultAnnotation
105
{
106
MuAnnotation *annot;
107
}
108
109
@synthesize annot;
110
111
-(id) initWithAnnotation:(MuAnnotation *)aAnnot
112
{
113
self = [super init];
114
if (self)
115
{
116
annot = [aAnnot retain];
117
}
118
return self;
119
}
120
121
-(void) dealloc
122
{
123
[annot release];
124
[super dealloc];
125
}
126
127
-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock caseWidget:(void (^)(MuTapResultWidget *))widgetBlock caseAnnotation:(void (^)(MuTapResultAnnotation *))annotationBlock
128
{
129
annotationBlock(self);
130
}
131
132
@end
133
134