NewsBlur/clients/ios/Classes/NewsBlurViewController.h
David Sinclair 106c970b4a iOS: #1236 (offline text)
- Added a "Download text" preference.  Defaults on.
- If on, the text is fetched for feeds that are in text view when fetching new stories.
- The text is fetched after stories, and before images, using a similar mechanism.
- The text is stored in a new "cached_text" database table.
- The text is deleted when the story is deleted.
- When displaying a text view, the cached text is used if available, otherwise it is fetched as before.
2019-10-25 20:52:51 -07:00

147 lines
5.6 KiB
Objective-C

//
// NewsBlurViewController.h
// NewsBlur
//
// Created by Samuel Clay on 6/16/10.
// Copyright NewsBlur 2010. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "NewsBlurAppDelegate.h"
#import "FolderTitleView.h"
#import "BaseViewController.h"
#import "NBNotifier.h"
#import "IASKAppSettingsViewController.h"
#import "MCSwipeTableViewCell.h"
// indices in appDelegate.dictFoldersArray and button tags
// keep in sync with NewsBlurTopSectionNames
static enum {
NewsBlurTopSectionGlobalSharedStories = 0,
NewsBlurTopSectionAllSharedStories = 1,
NewsBlurTopSectionInfrequentSiteStories = 2,
NewsBlurTopSectionAllStories = 3
} NewsBlurTopSection;
@class NewsBlurAppDelegate;
@interface NewsBlurViewController : BaseViewController
<UITableViewDelegate, UITableViewDataSource,
NSCacheDelegate,
UIPopoverControllerDelegate,
IASKSettingsDelegate,
MCSwipeTableViewCellDelegate,
UIGestureRecognizerDelegate, UISearchBarDelegate> {
NewsBlurAppDelegate *appDelegate;
NSMutableDictionary * activeFeedLocations;
NSMutableDictionary *stillVisibleFeeds;
NSMutableDictionary *visibleFolders;
NSMutableDictionary *indexPathsForFeedIds;
BOOL isOffline;
BOOL viewShowingAllFeeds;
BOOL interactiveFeedDetailTransition;
NSDate *lastUpdate;
NSCache *imageCache;
UITableView * feedTitlesTable;
UIToolbar * feedViewToolbar;
UISlider * feedScoreSlider;
UIBarButtonItem * homeButton;
UIBarButtonItem * addBarButton;
UIBarButtonItem * settingsBarButton;
UIBarButtonItem * activitiesButton;
UISegmentedControl * intelligenceControl;
NBNotifier *notifier;
}
@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) IBOutlet UIBarButtonItem * addBarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * settingsBarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * activitiesButton;
@property (nonatomic) IBOutlet UIBarButtonItem *userInfoBarButton;
@property (nonatomic) IBOutlet UIBarButtonItem *userAvatarButton;
@property (nonatomic) IBOutlet UILabel *neutralCount;
@property (nonatomic) IBOutlet UILabel *positiveCount;
@property (nonatomic) IBOutlet UILabel *userLabel;
@property (nonatomic) IBOutlet UIImageView *yellowIcon;
@property (nonatomic) IBOutlet UIImageView *greenIcon;
@property (nonatomic) NSMutableDictionary *activeFeedLocations;
@property (nonatomic) NSMutableDictionary *stillVisibleFeeds;
@property (nonatomic) NSMutableDictionary *visibleFolders;
@property (nonatomic, readwrite) BOOL viewShowingAllFeeds;
@property (nonatomic, readwrite) BOOL interactiveFeedDetailTransition;
@property (nonatomic, readwrite) BOOL isOffline;
@property (nonatomic) UIRefreshControl *refreshControl;
@property (nonatomic) UISearchBar *searchBar;
@property (nonatomic, strong) NSArray<NSString *> *searchFeedIds;
@property (nonatomic) NSDate *lastUpdate;
@property (nonatomic) NSCache *imageCache;
@property (nonatomic) IBOutlet UISegmentedControl * intelligenceControl;
@property (nonatomic) NSIndexPath *currentRowAtIndexPath;
@property (nonatomic) NSInteger currentSection;
@property (strong, nonatomic) IBOutlet UIView *noFocusMessage;
@property (strong, nonatomic) IBOutlet UILabel *noFocusLabel;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *toolbarLeftMargin;
@property (nonatomic, retain) NBNotifier *notifier;
@property (nonatomic, retain) UIImageView *avatarImageView;
- (void)layoutForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
- (void)returnToApp;
- (void)fetchFeedList:(BOOL)showLoader;
- (void)finishLoadingFeedListWithDict:(NSDictionary *)results finished:(BOOL)finished;
- (void)didSelectSectionHeader:(UIButton *)button;
- (void)didSelectSectionHeaderWithTag:(NSInteger)tag;
- (IBAction)selectIntelligence;
- (void)markFeedRead:(NSString *)feedId cutoffDays:(NSInteger)days;
- (void)markFeedsRead:(NSArray *)feedIds cutoffDays:(NSInteger)days;
- (void)markEverythingReadWithDays:(NSInteger)days;
- (void)markVisibleStoriesRead;
- (void)didCollapseFolder:(UIButton *)button;
- (BOOL)isFeedVisible:(id)feedId;
- (void)changeToAllMode;
- (void)calculateFeedLocations;
- (IBAction)sectionTapped:(UIButton *)button;
- (IBAction)sectionUntapped:(UIButton *)button;
- (IBAction)sectionUntappedOutside:(UIButton *)button;
- (void)redrawUnreadCounts;
- (void)showExplainerOnEmptyFeedlist;
+ (int)computeMaxScoreForFeed:(NSDictionary *)feed;
- (void)loadFavicons;
- (void)loadAvatars;
- (void)refreshFeedList;
- (void)refreshFeedList:(id)feedId;
- (void)loadOfflineFeeds:(BOOL)failed;
- (void)showUserProfile;
- (IBAction)showSettingsPopover:(id)sender;
- (IBAction)showInteractionsPopover:(id)sender;
- (void)fadeSelectedCell;
- (void)fadeFeed:(NSString *)feedId;
- (IBAction)tapAddSite:(id)sender;
- (void)resetToolbar;
- (void)layoutHeaderCounts:(UIInterfaceOrientation)orientation;
- (void)refreshHeaderCounts;
- (void)redrawFeedCounts:(id)feedId;
- (void)resizePreviewSize;
- (void)resizeFontSize;
- (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController*)sender;
- (void)settingDidChange:(NSNotification*)notification;
- (void)showRefreshNotifier;
- (void)showCountingNotifier;
- (void)showSyncingNotifier;
- (void)showSyncingNotifier:(float)progress hoursBack:(NSInteger)hours;
- (void)showCachingNotifier:(NSString *)prefix progress:(float)progress hoursBack:(NSInteger)hours;
- (void)showOfflineNotifier;
- (void)showDoneNotifier;
- (void)hideNotifier;
@end