summaryrefslogtreecommitdiff
path: root/UICaboodle
diff options
context:
space:
mode:
Diffstat (limited to 'UICaboodle')
-rw-r--r--UICaboodle/BrowserView.h36
-rw-r--r--UICaboodle/Internals.h9
-rw-r--r--UICaboodle/ResetView.h19
-rw-r--r--UICaboodle/ResetView.mm42
4 files changed, 106 insertions, 0 deletions
diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h
new file mode 100644
index 0000000..a58a5b7
--- /dev/null
+++ b/UICaboodle/BrowserView.h
@@ -0,0 +1,36 @@
+#import "ResetView.h"
+
+@class NSMutableArray;
+@class NSString;
+@class NSURL;
+@class NSURLRequest;
+
+@class UIProgressIndicator;
+@class UIScroller;
+@class UIWebView;
+
+@class Database;
+
+@interface BrowserView : RVPage {
+ _transient Database *database_;
+ UIScroller *scroller_;
+ UIWebView *webview_;
+ NSMutableArray *urls_;
+ UIProgressIndicator *indicator_;
+
+ NSString *title_;
+ bool loading_;
+ bool reloading_;
+}
+
+- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
+- (void) loadURL:(NSURL *)url;
+
+- (void) loadRequest:(NSURLRequest *)request;
+- (void) reloadURL;
+
+- (WebView *) webView;
+
+- (id) initWithBook:(RVBook *)book database:(Database *)database;
+
+@end
diff --git a/UICaboodle/Internals.h b/UICaboodle/Internals.h
new file mode 100644
index 0000000..a34c29f
--- /dev/null
+++ b/UICaboodle/Internals.h
@@ -0,0 +1,9 @@
+- (NSMethodSignature *) methodSignatureForSelector:(SEL)selector {
+ fprintf(stderr, "[%s]S-%s\n", class_getName(self->isa), sel_getName(selector));
+ return [super methodSignatureForSelector:selector];
+}
+
+- (BOOL) respondsToSelector:(SEL)selector {
+ fprintf(stderr, "[%s]R-%s\n", class_getName(self->isa), sel_getName(selector));
+ return [super respondsToSelector:selector];
+}
diff --git a/UICaboodle/ResetView.h b/UICaboodle/ResetView.h
new file mode 100644
index 0000000..903bec0
--- /dev/null
+++ b/UICaboodle/ResetView.h
@@ -0,0 +1,19 @@
+#import <RVPage.h>
+#import <RVBook.h>
+
+#import <UIKit/UIKit.h>
+
+@interface UIView (RVBook)
+- (void) resetViewAnimated:(BOOL)animated;
+- (void) clearView;
+@end
+
+@interface UITable (RVBook)
+- (void) resetViewAnimated:(BOOL)animated;
+- (void) clearView;
+@end
+
+@interface UISectionList (RVBook)
+- (void) resetViewAnimated:(BOOL)animated;
+- (void) clearView;
+@end
diff --git a/UICaboodle/ResetView.mm b/UICaboodle/ResetView.mm
new file mode 100644
index 0000000..8c0041a
--- /dev/null
+++ b/UICaboodle/ResetView.mm
@@ -0,0 +1,42 @@
+#import "ResetView.h"
+
+#include <objc/objc.h>
+#include <objc/runtime.h>
+
+@implementation UIView (RVBook)
+
+- (void) resetViewAnimated:(BOOL)animated {
+ fprintf(stderr, "%s\n", class_getName(self->isa));
+ _assert(false);
+}
+
+- (void) clearView {
+ fprintf(stderr, "%s\n", class_getName(self->isa));
+ _assert(false);
+}
+
+@end
+
+@implementation UITable (RVBook)
+
+- (void) resetViewAnimated:(BOOL)animated {
+ [self selectRow:-1 byExtendingSelection:NO withFade:animated];
+}
+
+- (void) clearView {
+ [self clearAllData];
+}
+
+@end
+
+@implementation UISectionList (RVBook)
+
+- (void) resetViewAnimated:(BOOL)animated {
+ [[self table] resetViewAnimated:animated];
+}
+
+- (void) clearView {
+ [[self table] clearView];
+}
+
+@end