From ab398adfe5c3cf3ccf350921b339fef9e1cc250c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 6 May 2008 11:46:02 +0000 Subject: Further factorization, file content list, checkbox clarication, advanced search teaser, and fully awesome keyboard control. --- UICaboodle/BrowserView.h | 36 ++++++++++++++++++++++++++++++++++++ UICaboodle/Internals.h | 9 +++++++++ UICaboodle/ResetView.h | 19 +++++++++++++++++++ UICaboodle/ResetView.mm | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 UICaboodle/BrowserView.h create mode 100644 UICaboodle/Internals.h create mode 100644 UICaboodle/ResetView.h create mode 100644 UICaboodle/ResetView.mm (limited to 'UICaboodle') 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 +#import + +#import + +@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 +#include + +@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 -- cgit v1.2.3