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"
|
2010-06-20 11:04:23 -04:00
|
|
|
|
2010-06-21 17:17:26 -04:00
|
|
|
@class NewsBlurAppDelegate;
|
|
|
|
|
2010-06-20 11:04:23 -04:00
|
|
|
@interface NewsBlurViewController : UIViewController
|
|
|
|
<UITableViewDelegate, UITableViewDataSource>
|
|
|
|
{
|
2010-06-21 17:17:26 -04:00
|
|
|
NewsBlurAppDelegate *appDelegate;
|
|
|
|
|
2010-11-13 13:42:20 -05:00
|
|
|
NSMutableData *responseData;
|
2010-06-20 11:04:23 -04:00
|
|
|
NSDictionary * dictFolders;
|
2011-06-10 10:40:44 -04:00
|
|
|
NSDictionary * dictFeeds;
|
2010-06-20 11:04:23 -04:00
|
|
|
NSMutableArray * dictFoldersArray;
|
2011-08-02 10:13:06 -07:00
|
|
|
NSMutableDictionary * activeFeedLocations;
|
2011-08-15 17:57:37 -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;
|
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;
|
2010-06-20 11:04:23 -04:00
|
|
|
}
|
|
|
|
|
2011-08-13 23:00:51 -07:00
|
|
|
- (void)fetchFeedList:(BOOL)showLoader;
|
2010-11-11 23:48:27 -05:00
|
|
|
- (IBAction)doLogoutButton;
|
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-02 10:13:06 -07:00
|
|
|
- (void)calculateFeedLocations;
|
2011-08-02 18:03:11 -07:00
|
|
|
+ (int)computeMaxScoreForFeed:(NSDictionary *)feed;
|
2011-08-16 19:55:44 -07:00
|
|
|
- (IBAction)doSwitchSitesUnread;
|
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;
|
2010-06-20 11:04:23 -04:00
|
|
|
@property (nonatomic, retain) NSMutableArray *dictFoldersArray;
|
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;
|
2010-06-20 11:04:23 -04:00
|
|
|
@property (nonatomic, retain) NSDictionary *dictFolders;
|
2011-06-10 10:40:44 -04:00
|
|
|
@property (nonatomic, retain) NSDictionary *dictFeeds;
|
2010-11-13 13:42:20 -05:00
|
|
|
@property (nonatomic, retain) NSMutableData *responseData;
|
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-08-02 09:16:54 -07:00
|
|
|
@property (nonatomic, retain) IBOutlet UISegmentedControl * intelligenceControl;
|
2010-06-20 11:04:23 -04:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2010-11-13 13:42:20 -05:00
|
|
|
|
|
|
|
@interface LogoutDelegate : NSObject {
|
|
|
|
NewsBlurAppDelegate *appDelegate;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response;
|
|
|
|
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
|
|
|
|
- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
|
|
|
|
|
|
|
|
@property (nonatomic, retain) IBOutlet NewsBlurAppDelegate *appDelegate;
|
|
|
|
|
|
|
|
@end
|