summaryrefslogtreecommitdiff
path: root/platform/ios/Classes/MuTapResult.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/Classes/MuTapResult.m')
-rw-r--r--platform/ios/Classes/MuTapResult.m94
1 files changed, 94 insertions, 0 deletions
diff --git a/platform/ios/Classes/MuTapResult.m b/platform/ios/Classes/MuTapResult.m
new file mode 100644
index 00000000..7e3d71d1
--- /dev/null
+++ b/platform/ios/Classes/MuTapResult.m
@@ -0,0 +1,94 @@
+//
+// MuTapResult.m
+// MuPDF
+//
+// Copyright (c) 2013 Artifex Software, Inc. All rights reserved.
+//
+
+#import "MuTapResult.h"
+
+@implementation MuTapResult
+
+-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock {}
+
+@end
+
+
+@implementation MuTapResultInternalLink
+
+@synthesize pageNumber;
+
+-(id) initWithPageNumber:(int)aNumber
+{
+ self = [super init];
+ if (self)
+ {
+ pageNumber = aNumber;
+ }
+ return self;
+}
+
+-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock
+{
+ internalLinkBlock(self);
+}
+
+@end
+
+
+@implementation MuTapResultExternalLink
+
+@synthesize url;
+
+-(id) initWithUrl:(NSString *)aString
+{
+ self = [super init];
+ if (self)
+ {
+ url = [aString retain];
+ }
+ return self;
+}
+
+-(void) dealloc
+{
+ [url release];
+ [super dealloc];
+}
+
+-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock
+{
+ externalLinkBlock(self);
+}
+
+@end
+
+
+@implementation MuTapResultRemoteLink
+
+@synthesize fileSpec, pageNumber, newWindow;
+
+-(id) initWithFileSpec:(NSString *)aString pageNumber:(int)aNumber newWindow:(BOOL)aBool
+{
+ self = [super init];
+ if (self)
+ {
+ fileSpec = [aString retain];
+ pageNumber = aNumber;
+ newWindow = aBool;
+ }
+ return self;
+}
+
+-(void) dealloc
+{
+ [fileSpec release];
+ [super dealloc];
+}
+
+-(void) switchCaseInternal:(void (^)(MuTapResultInternalLink *))internalLinkBlock caseExternal:(void (^)(MuTapResultExternalLink *))externalLinkBlock caseRemote:(void (^)(MuTapResultRemoteLink *))remoteLinkBlock
+{
+ remoteLinkBlock(self);
+}
+
+@end \ No newline at end of file