summaryrefslogtreecommitdiff
path: root/platform/ios/Classes/MuTapResult.m
diff options
context:
space:
mode:
authorPaul Gardiner <paul.gardiner@artifex.com>2013-10-03 15:14:01 +0100
committerPaul Gardiner <paul.gardiner@artifex.com>2013-10-09 14:31:12 +0100
commit5ac49662b7d7affd0b43c6b8e827e292b6b8e3e3 (patch)
tree35d03d97edec2db4463f7764efc95055fad3a216 /platform/ios/Classes/MuTapResult.m
parent17c797eaaec9b33aedf4970fe2184f86f65b25d8 (diff)
downloadmupdf-5ac49662b7d7affd0b43c6b8e827e292b6b8e3e3.tar.xz
iOS: implement internal-link following
Also: add hooks for the other link types remove unnecessary protocol from MuPageViewReflow turn off optimizations for the debug build
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