2010-06-20 11:04:23 -04:00
|
|
|
//
|
|
|
|
// NewsBlurViewController.h
|
|
|
|
// NewsBlur
|
|
|
|
//
|
|
|
|
// Created by Samuel Clay on 6/16/10.
|
2010-06-21 17:17:26 -04:00
|
|
|
// Copyright NewsBlur 2010. All rights reserved.
|
2010-06-20 11:04:23 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
2010-11-13 13:42:20 -05:00
|
|
|
#import "NewsBlurAppDelegate.h"
|
2011-08-04 17:58:28 -07:00
|
|
|
#import "ASIHTTPRequest.h"
|
|
|
|
#import "PullToRefreshView.h"
|
2011-10-27 09:44:58 -07:00
|
|
|
#import "BaseViewController.h"
|
2010-06-20 11:04:23 -04:00
|
|
|
|
2010-06-21 17:17:26 -04:00
|
|
|
@class NewsBlurAppDelegate;
|
|
|
|
|
2011-10-27 09:44:58 -07:00
|
|
|
@interface NewsBlurViewController : BaseViewController
|
2011-08-24 10:24:02 -07:00
|
|
|
<UITableViewDelegate, UITableViewDataSource,
|
2011-09-06 17:51:02 -07:00
|
|
|
UIAlertViewDelegate, PullToRefreshViewDelegate,
|
2011-10-15 15:26:18 -07:00
|
|
|
ASIHTTPRequestDelegate, NSCacheDelegate> {
|
2010-06-21 17:17:26 -04:00
|
|
|
NewsBlurAppDelegate *appDelegate;
|
|
|
|
|
2011-08-02 10:13:06 -07:00
|
|
|
NSMutableDictionary * activeFeedLocations;
|
2011-08-15 17:57:37 -07:00
|
|
|
NSMutableDictionary *stillVisibleFeeds;
|
2011-08-24 21:41:44 -07:00
|
|
|
NSMutableDictionary *visibleFeeds;
|
2011-08-04 17:27:31 -07:00
|
|
|
BOOL viewShowingAllFeeds;
|
2011-08-04 17:58:28 -07:00
|
|
|
PullToRefreshView *pull;
|
|
|
|
NSDate *lastUpdate;
|
2011-10-14 09:51:27 -07:00
|
|
|
NSCache *imageCache;
|
2010-06-20 11:04:23 -04:00
|
|
|
|
2011-08-02 09:16:54 -07:00
|
|
|
IBOutlet UITableView * feedTitlesTable;
|
2010-11-11 23:48:27 -05:00
|
|
|
IBOutlet UIToolbar * feedViewToolbar;
|
|
|
|
IBOutlet UISlider * feedScoreSlider;
|
|
|
|
IBOutlet UIBarButtonItem * logoutButton;
|
2011-08-02 09:16:54 -07:00
|
|
|
IBOutlet UISegmentedControl * intelligenceControl;
|
2011-08-03 10:00:41 -07:00
|
|
|
IBOutlet UIBarButtonItem * sitesButton;
|
2011-10-06 16:25:38 -07:00
|
|
|
IBOutlet UIBarButtonItem * addButton;
|
2010-06-20 11:04:23 -04:00
|
|
|
}
|
|
|
|
|
2011-08-18 21:48:30 -07:00
|
|
|
- (void)returnToApp;
|
2011-08-13 23:00:51 -07:00
|
|
|
- (void)fetchFeedList:(BOOL)showLoader;
|
2011-09-05 22:06:31 -07:00
|
|
|
- (void)finishedWithError:(ASIHTTPRequest *)request;
|
|
|
|
- (void)finishLoadingFeedList:(ASIHTTPRequest *)request;
|
|
|
|
|
2010-11-11 23:48:27 -05:00
|
|
|
- (IBAction)doLogoutButton;
|
2011-10-25 09:47:55 -07:00
|
|
|
- (void)didSelectSectionHeader:(UIButton *)button;
|
2011-08-02 09:16:54 -07:00
|
|
|
- (IBAction)selectIntelligence;
|
2011-08-02 18:19:46 -07:00
|
|
|
- (void)updateFeedsWithIntelligence:(int)previousLevel newLevel:(int)newLevel;
|
2011-08-24 21:41:44 -07:00
|
|
|
- (void)calculateFeedLocations:(BOOL)markVisible;
|
2011-10-26 23:12:21 -07:00
|
|
|
- (IBAction)sectionTapped:(UITapGestureRecognizer *)recognizer;
|
2011-08-27 15:53:51 -07:00
|
|
|
- (void)redrawUnreadCounts;
|
2011-08-02 18:03:11 -07:00
|
|
|
+ (int)computeMaxScoreForFeed:(NSDictionary *)feed;
|
2011-08-16 19:55:44 -07:00
|
|
|
- (IBAction)doSwitchSitesUnread;
|
2011-10-04 18:01:35 -07:00
|
|
|
- (IBAction)doAddButton;
|
2011-08-04 17:58:28 -07:00
|
|
|
- (void)loadFavicons;
|
|
|
|
- (void)saveAndDrawFavicons:(ASIHTTPRequest *)request;
|
|
|
|
- (void)requestFailed:(ASIHTTPRequest *)request;
|
|
|
|
- (void)pullToRefreshViewShouldRefresh:(PullToRefreshView *)view;
|
|
|
|
- (NSDate *)pullToRefreshViewLastUpdated:(PullToRefreshView *)view;
|
2010-06-20 11:04:23 -04:00
|
|
|
|
2010-06-21 17:17:26 -04:00
|
|
|
@property (nonatomic, retain) IBOutlet NewsBlurAppDelegate *appDelegate;
|
2011-08-02 09:16:54 -07:00
|
|
|
@property (nonatomic, retain) IBOutlet UITableView *feedTitlesTable;
|
2010-06-20 11:04:23 -04:00
|
|
|
@property (nonatomic, retain) IBOutlet UIToolbar *feedViewToolbar;
|
2010-06-21 17:17:26 -04:00
|
|
|
@property (nonatomic, retain) IBOutlet UISlider * feedScoreSlider;
|
2010-11-11 23:48:27 -05:00
|
|
|
@property (nonatomic, retain) IBOutlet UIBarButtonItem * logoutButton;
|
2011-08-03 10:00:41 -07:00
|
|
|
@property (nonatomic, retain) IBOutlet UIBarButtonItem * sitesButton;
|
2011-10-06 16:25:38 -07:00
|
|
|
@property (nonatomic, retain) IBOutlet UIBarButtonItem * addButton;
|
2011-08-02 10:13:06 -07:00
|
|
|
@property (nonatomic, retain) NSMutableDictionary *activeFeedLocations;
|
2011-08-15 17:57:37 -07:00
|
|
|
@property (nonatomic, retain) NSMutableDictionary *stillVisibleFeeds;
|
2011-08-24 21:41:44 -07:00
|
|
|
@property (nonatomic, retain) NSMutableDictionary *visibleFeeds;
|
2011-08-04 17:27:31 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL viewShowingAllFeeds;
|
2011-08-04 17:58:28 -07:00
|
|
|
@property (nonatomic, retain) PullToRefreshView *pull;
|
|
|
|
@property (nonatomic, retain) NSDate *lastUpdate;
|
2011-10-14 09:51:27 -07:00
|
|
|
@property (nonatomic, retain) NSCache *imageCache;
|
2011-08-02 09:16:54 -07:00
|
|
|
@property (nonatomic, retain) IBOutlet UISegmentedControl * intelligenceControl;
|
2010-06-20 11:04:23 -04:00
|
|
|
|
|
|
|
@end
|