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;
|
|
|
|
|
2012-06-19 11:48:51 -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,
|
2012-06-19 13:51:48 -07:00
|
|
|
ASIHTTPRequestDelegate, NSCacheDelegate,
|
|
|
|
UIPopoverControllerDelegate> {
|
2010-06-21 17:17:26 -04:00
|
|
|
NewsBlurAppDelegate *appDelegate;
|
|
|
|
|
2011-08-02 10:13:06 -07:00
|
|
|
NSMutableDictionary * activeFeedLocations;
|
2011-08-24 21:41:44 -07:00
|
|
|
NSMutableDictionary *visibleFeeds;
|
2011-10-31 10:10:38 -07:00
|
|
|
NSMutableDictionary *stillVisibleFeeds;
|
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
|
|
|
|
2012-07-14 01:16:35 -07:00
|
|
|
UIView *innerView;
|
|
|
|
UITableView * feedTitlesTable;
|
|
|
|
UIToolbar * feedViewToolbar;
|
|
|
|
UISlider * feedScoreSlider;
|
|
|
|
UIBarButtonItem * homeButton;
|
|
|
|
UISegmentedControl * intelligenceControl;
|
|
|
|
UIPopoverController *popoverController;
|
2010-06-20 11:04:23 -04:00
|
|
|
}
|
|
|
|
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) IBOutlet NewsBlurAppDelegate *appDelegate;
|
|
|
|
@property (nonatomic) IBOutlet UIView *innerView;
|
|
|
|
@property (nonatomic) IBOutlet UITableView *feedTitlesTable;
|
|
|
|
@property (nonatomic) IBOutlet UIToolbar *feedViewToolbar;
|
|
|
|
@property (nonatomic) IBOutlet UISlider * feedScoreSlider;
|
|
|
|
@property (nonatomic) IBOutlet UIBarButtonItem * homeButton;
|
|
|
|
@property (nonatomic) NSMutableDictionary *activeFeedLocations;
|
|
|
|
@property (nonatomic) NSMutableDictionary *visibleFeeds;
|
|
|
|
@property (nonatomic) NSMutableDictionary *stillVisibleFeeds;
|
2012-07-12 00:10:42 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL viewShowingAllFeeds;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) PullToRefreshView *pull;
|
|
|
|
@property (nonatomic) NSDate *lastUpdate;
|
|
|
|
@property (nonatomic) NSCache *imageCache;
|
|
|
|
@property (nonatomic) IBOutlet UISegmentedControl * intelligenceControl;
|
|
|
|
@property (nonatomic) UIPopoverController *popoverController;
|
2012-07-12 00:10:42 -07:00
|
|
|
|
2011-08-18 21:48:30 -07:00
|
|
|
- (void)returnToApp;
|
2012-07-02 11:42:06 -07:00
|
|
|
- (void)fetchFeedList:(BOOL)showLoader refreshFeeds:(BOOL)refreshFeeds;
|
2011-09-05 22:06:31 -07:00
|
|
|
- (void)finishedWithError:(ASIHTTPRequest *)request;
|
|
|
|
- (void)finishLoadingFeedList:(ASIHTTPRequest *)request;
|
2012-06-29 17:37:49 -07:00
|
|
|
- (void)finishRefreshingFeedList:(ASIHTTPRequest *)request;
|
2011-09-05 22:06:31 -07:00
|
|
|
|
2012-06-19 14:27:35 -07:00
|
|
|
- (void)dismissFeedsMenu;
|
2012-06-28 11:12:38 -07:00
|
|
|
- (IBAction)showMenuButton:(id)sender;
|
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-11-30 18:46:11 -08:00
|
|
|
- (IBAction)sectionTapped:(UIButton *)button;
|
|
|
|
- (IBAction)sectionUntapped:(UIButton *)button;
|
2012-06-26 12:12:31 -07:00
|
|
|
- (IBAction)sectionUntappedOutside:(UIButton *)button;
|
2011-08-27 15:53:51 -07:00
|
|
|
- (void)redrawUnreadCounts;
|
2011-08-02 18:03:11 -07:00
|
|
|
+ (int)computeMaxScoreForFeed:(NSDictionary *)feed;
|
2012-06-29 10:20:06 -07:00
|
|
|
- (void)switchSitesUnread;
|
2011-08-04 17:58:28 -07:00
|
|
|
- (void)loadFavicons;
|
2012-06-26 11:45:42 -07:00
|
|
|
- (void)loadAvatars;
|
2011-08-04 17:58:28 -07:00
|
|
|
- (void)saveAndDrawFavicons:(ASIHTTPRequest *)request;
|
|
|
|
- (void)requestFailed:(ASIHTTPRequest *)request;
|
2012-07-02 11:42:06 -07:00
|
|
|
- (void)refreshFeedList;
|
2011-08-04 17:58:28 -07:00
|
|
|
- (void)pullToRefreshViewShouldRefresh:(PullToRefreshView *)view;
|
2012-07-12 00:10:42 -07:00
|
|
|
- (void)showUserProfilePopover:(id)sender;
|
2012-07-12 11:35:32 -07:00
|
|
|
- (void)showSettingsPopover:(id)sender;
|
2011-08-04 17:58:28 -07:00
|
|
|
- (NSDate *)pullToRefreshViewLastUpdated:(PullToRefreshView *)view;
|
2010-06-20 11:04:23 -04:00
|
|
|
|
|
|
|
@end
|