2010-06-17 13:10:45 -04:00
|
|
|
//
|
|
|
|
// NewsBlurAppDelegate.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-17 13:10:45 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
2015-09-17 19:11:17 -07:00
|
|
|
#import <SafariServices/SafariServices.h>
|
2011-10-27 09:44:58 -07:00
|
|
|
#import "BaseViewController.h"
|
2013-06-14 19:21:30 -07:00
|
|
|
#import "FMDatabaseQueue.h"
|
2014-09-17 19:02:12 -07:00
|
|
|
#import "EventWindow.h"
|
2017-03-19 18:15:36 -07:00
|
|
|
#import "AFNetworking.h"
|
2010-06-17 13:10:45 -04:00
|
|
|
|
2012-06-20 08:42:19 -07:00
|
|
|
#define FEED_DETAIL_VIEW_TAG 1000001
|
|
|
|
#define STORY_DETAIL_VIEW_TAG 1000002
|
|
|
|
#define FEED_TITLE_GRADIENT_TAG 100003
|
2012-06-20 09:32:55 -07:00
|
|
|
#define FEED_DASHBOARD_VIEW_TAG 100004
|
2012-07-03 11:15:09 -07:00
|
|
|
#define SHARE_MODAL_HEIGHT 120
|
2012-07-23 15:27:20 -07:00
|
|
|
#define STORY_TITLES_HEIGHT 240
|
2012-07-18 13:56:09 -07:00
|
|
|
#define DASHBOARD_TITLE @"NewsBlur"
|
2012-06-20 08:42:19 -07:00
|
|
|
|
2012-06-19 11:48:51 -07:00
|
|
|
@class NewsBlurViewController;
|
2012-07-10 12:34:58 -07:00
|
|
|
@class DashboardViewController;
|
2012-06-19 10:55:46 -07:00
|
|
|
@class FeedsMenuViewController;
|
2012-10-12 13:58:26 -04:00
|
|
|
@class FeedDetailViewController;
|
|
|
|
@class FeedDetailMenuViewController;
|
2015-11-13 21:54:32 -08:00
|
|
|
@class MarkReadMenuViewController;
|
2012-06-13 18:07:24 -07:00
|
|
|
@class FirstTimeUserViewController;
|
2012-07-22 14:23:50 -07:00
|
|
|
@class FirstTimeUserAddSitesViewController;
|
|
|
|
@class FirstTimeUserAddFriendsViewController;
|
|
|
|
@class FirstTimeUserAddNewsBlurViewController;
|
2012-07-01 12:08:30 -07:00
|
|
|
@class FriendsListViewController;
|
2012-06-18 14:31:42 -07:00
|
|
|
@class FontSettingsViewController;
|
2010-06-25 18:36:01 -04:00
|
|
|
@class StoryDetailViewController;
|
2012-11-05 17:16:10 -08:00
|
|
|
@class StoryPageControl;
|
2012-06-21 11:53:48 -07:00
|
|
|
@class ShareViewController;
|
2010-10-31 23:02:13 -04:00
|
|
|
@class LoginViewController;
|
2011-12-02 16:23:00 -08:00
|
|
|
@class AddSiteViewController;
|
|
|
|
@class MoveSiteViewController;
|
2012-12-24 23:01:25 -08:00
|
|
|
@class TrainerViewController;
|
2016-11-23 08:09:19 -08:00
|
|
|
@class NotificationsViewController;
|
2014-11-10 16:00:59 -08:00
|
|
|
@class UserTagsViewController;
|
2010-11-13 18:32:43 -05:00
|
|
|
@class OriginalStoryViewController;
|
2012-07-01 18:26:39 -07:00
|
|
|
@class UserProfileViewController;
|
2012-07-24 11:44:16 -07:00
|
|
|
@class NBContainerViewController;
|
2016-01-27 20:52:09 -08:00
|
|
|
@class FeedChooserViewController;
|
|
|
|
@class MenuViewController;
|
2013-06-21 17:48:06 -07:00
|
|
|
@class IASKAppSettingsViewController;
|
2012-10-12 15:33:40 -04:00
|
|
|
@class UnreadCounts;
|
2014-02-12 20:09:37 -08:00
|
|
|
@class StoriesCollection;
|
2017-04-03 18:52:23 -07:00
|
|
|
@class PINCache;
|
2018-10-04 16:59:07 -07:00
|
|
|
@class PremiumManager;
|
2017-11-09 18:43:37 -08:00
|
|
|
@class PremiumViewController;
|
2012-06-15 16:35:54 -07:00
|
|
|
|
2013-11-23 13:03:14 -08:00
|
|
|
@interface NewsBlurAppDelegate : BaseViewController
|
2017-04-11 15:43:42 -07:00
|
|
|
<UIApplicationDelegate, UINavigationControllerDelegate, UIPopoverPresentationControllerDelegate,
|
2015-09-17 19:11:17 -07:00
|
|
|
SFSafariViewControllerDelegate> {
|
2014-09-17 19:02:12 -07:00
|
|
|
EventWindow *window;
|
2012-07-22 14:23:50 -07:00
|
|
|
UINavigationController *ftuxNavigationController;
|
2010-06-21 17:17:26 -04:00
|
|
|
UINavigationController *navigationController;
|
2012-07-31 17:17:02 -07:00
|
|
|
UINavigationController *modalNavigationController;
|
2012-08-13 18:45:06 -07:00
|
|
|
UINavigationController *shareNavigationController;
|
2012-07-28 12:56:51 -07:00
|
|
|
UINavigationController *userProfileNavigationController;
|
2013-03-02 19:15:08 -08:00
|
|
|
UINavigationController *trainNavigationController;
|
2016-11-23 08:09:19 -08:00
|
|
|
UINavigationController *notificationsNavigationController;
|
2017-11-09 18:43:37 -08:00
|
|
|
UINavigationController *premiumNavigationController;
|
2012-07-24 11:44:16 -07:00
|
|
|
NBContainerViewController *masterContainerViewController;
|
2012-06-11 16:56:38 -07:00
|
|
|
|
2012-07-22 14:23:50 -07:00
|
|
|
FirstTimeUserViewController *firstTimeUserViewController;
|
|
|
|
FirstTimeUserAddSitesViewController *firstTimeUserAddSitesViewController;
|
|
|
|
FirstTimeUserAddFriendsViewController *firstTimeUserAddFriendsViewController;
|
|
|
|
FirstTimeUserAddNewsBlurViewController *firstTimeUserAddNewsBlurViewController;
|
|
|
|
|
2012-07-10 12:34:58 -07:00
|
|
|
DashboardViewController *dashboardViewController;
|
2012-06-19 11:48:51 -07:00
|
|
|
NewsBlurViewController *feedsViewController;
|
2012-06-19 10:55:46 -07:00
|
|
|
FeedsMenuViewController *feedsMenuViewController;
|
2012-10-12 13:58:26 -04:00
|
|
|
FeedDetailViewController *feedDetailViewController;
|
|
|
|
FeedDetailMenuViewController *feedDetailMenuViewController;
|
2012-07-01 18:26:39 -07:00
|
|
|
FriendsListViewController *friendsListViewController;
|
2012-06-18 14:31:42 -07:00
|
|
|
FontSettingsViewController *fontSettingsViewController;
|
2012-10-12 13:58:26 -04:00
|
|
|
|
2010-06-25 18:36:01 -04:00
|
|
|
StoryDetailViewController *storyDetailViewController;
|
2012-11-05 15:12:42 -08:00
|
|
|
StoryPageControl *storyPageControl;
|
2012-06-21 11:53:48 -07:00
|
|
|
ShareViewController *shareViewController;
|
2010-10-31 23:02:13 -04:00
|
|
|
LoginViewController *loginViewController;
|
2011-12-02 16:23:00 -08:00
|
|
|
AddSiteViewController *addSiteViewController;
|
|
|
|
MoveSiteViewController *moveSiteViewController;
|
2012-12-24 23:01:25 -08:00
|
|
|
TrainerViewController *trainerViewController;
|
2016-11-23 08:09:19 -08:00
|
|
|
NotificationsViewController *notificationsViewController;
|
2014-11-10 16:00:59 -08:00
|
|
|
UserTagsViewController *userTagsViewController;
|
2010-11-13 18:32:43 -05:00
|
|
|
OriginalStoryViewController *originalStoryViewController;
|
2013-09-24 17:18:20 -07:00
|
|
|
UINavigationController *originalStoryViewNavController;
|
2012-07-01 18:26:39 -07:00
|
|
|
UserProfileViewController *userProfileViewController;
|
2013-06-21 17:48:06 -07:00
|
|
|
IASKAppSettingsViewController *preferencesViewController;
|
2017-11-09 18:43:37 -08:00
|
|
|
PremiumViewController *premiumViewController;
|
2014-11-10 16:00:59 -08:00
|
|
|
|
2017-03-19 18:15:36 -07:00
|
|
|
AFHTTPSessionManager *networkManager;
|
|
|
|
|
2010-11-13 18:32:43 -05:00
|
|
|
NSString * activeUsername;
|
2012-07-03 17:54:36 -07:00
|
|
|
NSString * activeUserProfileId;
|
2012-07-28 14:15:20 -07:00
|
|
|
NSString * activeUserProfileName;
|
2012-10-02 15:39:18 -07:00
|
|
|
BOOL hasNoSites;
|
2012-08-06 19:21:39 -07:00
|
|
|
BOOL isTryFeedView;
|
2012-06-19 15:47:51 -07:00
|
|
|
BOOL popoverHasFeedView;
|
2012-06-29 23:25:56 -07:00
|
|
|
BOOL inFeedDetail;
|
2012-08-02 18:00:48 -07:00
|
|
|
BOOL inStoryDetail;
|
2012-07-16 22:35:28 -07:00
|
|
|
BOOL inFindingStoryMode;
|
2013-07-17 19:22:41 -07:00
|
|
|
BOOL hasLoadedFeedDetail;
|
2013-07-17 19:00:00 -07:00
|
|
|
BOOL hasQueuedReadStories;
|
2012-07-16 19:45:14 -07:00
|
|
|
NSString *tryFeedStoryId;
|
2016-12-06 16:03:40 -08:00
|
|
|
NSString *tryFeedFeedId;
|
2014-02-12 16:39:30 -08:00
|
|
|
|
2010-06-25 18:36:01 -04:00
|
|
|
NSDictionary * activeStory;
|
2010-11-13 18:32:43 -05:00
|
|
|
NSURL * activeOriginalStoryURL;
|
2014-02-12 16:39:30 -08:00
|
|
|
NSString * activeShareType;
|
|
|
|
NSDictionary * activeComment;
|
2017-04-03 16:07:01 -07:00
|
|
|
NSInteger feedDetailPortraitYCoordinate;
|
|
|
|
NSInteger originalStoryCount;
|
2011-07-29 09:06:17 -07:00
|
|
|
NSInteger selectedIntelligence;
|
2017-04-03 16:07:01 -07:00
|
|
|
NSInteger savedStoriesCount;
|
|
|
|
NSInteger totalUnfetchedStoryCount;
|
|
|
|
NSInteger remainingUnfetchedStoryCount;
|
|
|
|
NSInteger latestFetchedStoryDate;
|
|
|
|
NSInteger latestCachedImageDate;
|
|
|
|
NSInteger totalUncachedImagesCount;
|
|
|
|
NSInteger remainingUncachedImagesCount;
|
2013-07-19 15:41:43 -07:00
|
|
|
NSMutableDictionary * recentlyReadStories;
|
2011-11-03 18:08:24 -07:00
|
|
|
NSMutableSet * recentlyReadFeeds;
|
2011-08-22 18:25:33 -07:00
|
|
|
NSMutableArray * readStories;
|
2012-10-14 17:30:03 -07:00
|
|
|
NSMutableDictionary *folderCountCache;
|
2014-09-26 18:35:40 -07:00
|
|
|
NSMutableDictionary *collapsedFolders;
|
2014-10-01 14:23:57 -07:00
|
|
|
UIFontDescriptor *fontDescriptorTitleSize;
|
2011-10-04 18:01:35 -07:00
|
|
|
|
|
|
|
NSDictionary * dictFolders;
|
2012-07-27 16:10:13 -07:00
|
|
|
NSMutableDictionary * dictFeeds;
|
2012-06-26 16:24:19 -07:00
|
|
|
NSMutableDictionary * dictActiveFeeds;
|
2012-06-25 15:02:20 -07:00
|
|
|
NSDictionary * dictSocialFeeds;
|
2013-03-04 20:21:29 -08:00
|
|
|
NSDictionary * dictSocialProfile;
|
2012-07-01 18:26:39 -07:00
|
|
|
NSDictionary * dictUserProfile;
|
2013-03-04 20:21:29 -08:00
|
|
|
NSDictionary * dictSocialServices;
|
2013-06-29 17:28:41 -07:00
|
|
|
NSMutableDictionary * dictUnreadCounts;
|
2015-10-05 11:45:33 -07:00
|
|
|
NSMutableDictionary * dictTextFeeds;
|
2012-07-26 23:07:47 -07:00
|
|
|
NSArray * userInteractionsArray;
|
|
|
|
NSArray * userActivitiesArray;
|
2011-10-04 18:01:35 -07:00
|
|
|
NSMutableArray * dictFoldersArray;
|
2016-11-23 09:29:29 -08:00
|
|
|
NSArray * notificationFeedIds;
|
2012-08-14 17:20:45 -07:00
|
|
|
|
2013-06-14 19:21:30 -07:00
|
|
|
FMDatabaseQueue *database;
|
2013-07-15 18:25:09 -07:00
|
|
|
NSOperationQueue *offlineQueue;
|
2013-08-05 18:32:43 -07:00
|
|
|
NSOperationQueue *offlineCleaningQueue;
|
2014-02-11 15:20:41 -08:00
|
|
|
NSOperationQueue *cacheImagesOperationQueue;
|
2012-08-14 17:20:45 -07:00
|
|
|
NSArray *categories;
|
|
|
|
NSDictionary *categoryFeeds;
|
2012-11-01 15:26:50 -07:00
|
|
|
UIImageView *splashView;
|
2013-06-23 22:19:08 -07:00
|
|
|
NSMutableDictionary *activeCachedImages;
|
2014-02-24 18:56:51 -08:00
|
|
|
|
2017-04-03 18:52:23 -07:00
|
|
|
PINCache *cachedFavicons;
|
|
|
|
PINCache *cachedStoryImages;
|
2010-06-17 13:10:45 -04:00
|
|
|
}
|
|
|
|
|
2014-09-17 19:02:12 -07:00
|
|
|
@property (nonatomic) IBOutlet EventWindow *window;
|
2012-07-22 14:23:50 -07:00
|
|
|
@property (nonatomic) IBOutlet UINavigationController *ftuxNavigationController;
|
2012-07-28 12:56:51 -07:00
|
|
|
@property (nonatomic) IBOutlet UINavigationController *navigationController;
|
2012-07-31 17:17:02 -07:00
|
|
|
@property (nonatomic) UINavigationController *modalNavigationController;
|
2012-08-13 18:45:06 -07:00
|
|
|
@property (nonatomic) UINavigationController *shareNavigationController;
|
2013-03-02 19:15:08 -08:00
|
|
|
@property (nonatomic) UINavigationController *trainNavigationController;
|
2016-11-23 08:09:19 -08:00
|
|
|
@property (nonatomic) UINavigationController *notificationsNavigationController;
|
2017-11-09 18:43:37 -08:00
|
|
|
@property (nonatomic) UINavigationController *premiumNavigationController;
|
2012-07-28 12:56:51 -07:00
|
|
|
@property (nonatomic) UINavigationController *userProfileNavigationController;
|
2013-09-24 17:18:20 -07:00
|
|
|
@property (nonatomic) UINavigationController *originalStoryViewNavController;
|
2012-07-24 11:44:16 -07:00
|
|
|
@property (nonatomic) IBOutlet NBContainerViewController *masterContainerViewController;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) IBOutlet DashboardViewController *dashboardViewController;
|
|
|
|
@property (nonatomic) IBOutlet NewsBlurViewController *feedsViewController;
|
|
|
|
@property (nonatomic) IBOutlet FeedsMenuViewController *feedsMenuViewController;
|
|
|
|
@property (nonatomic) IBOutlet FeedDetailViewController *feedDetailViewController;
|
2012-10-12 13:58:26 -04:00
|
|
|
@property (nonatomic) IBOutlet FeedDetailMenuViewController *feedDetailMenuViewController;
|
2016-02-04 20:10:32 -08:00
|
|
|
@property (nonatomic, strong) UINavigationController *feedDetailMenuNavigationController;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) IBOutlet FriendsListViewController *friendsListViewController;
|
|
|
|
@property (nonatomic) IBOutlet StoryDetailViewController *storyDetailViewController;
|
2012-11-05 15:12:42 -08:00
|
|
|
@property (nonatomic) IBOutlet StoryPageControl *storyPageControl;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) IBOutlet LoginViewController *loginViewController;
|
2016-03-17 20:40:09 -07:00
|
|
|
@property (nonatomic, strong) UINavigationController *addSiteNavigationController;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) IBOutlet AddSiteViewController *addSiteViewController;
|
|
|
|
@property (nonatomic) IBOutlet MoveSiteViewController *moveSiteViewController;
|
2012-12-24 23:01:25 -08:00
|
|
|
@property (nonatomic) IBOutlet TrainerViewController *trainerViewController;
|
2016-11-23 08:09:19 -08:00
|
|
|
@property (nonatomic) IBOutlet NotificationsViewController *notificationsViewController;
|
2014-11-10 16:00:59 -08:00
|
|
|
@property (nonatomic) IBOutlet UserTagsViewController *userTagsViewController;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) IBOutlet OriginalStoryViewController *originalStoryViewController;
|
|
|
|
@property (nonatomic) IBOutlet ShareViewController *shareViewController;
|
|
|
|
@property (nonatomic) IBOutlet FontSettingsViewController *fontSettingsViewController;
|
|
|
|
@property (nonatomic) IBOutlet UserProfileViewController *userProfileViewController;
|
2013-06-21 17:48:06 -07:00
|
|
|
@property (nonatomic) IBOutlet IASKAppSettingsViewController *preferencesViewController;
|
2018-10-04 16:59:07 -07:00
|
|
|
@property (nonatomic, strong) PremiumManager *premiumManager;
|
2017-11-09 18:43:37 -08:00
|
|
|
@property (nonatomic) IBOutlet PremiumViewController *premiumViewController;
|
2015-10-31 16:35:32 -07:00
|
|
|
@property (nonatomic, strong) UINavigationController *fontSettingsNavigationController;
|
2015-11-13 21:54:32 -08:00
|
|
|
@property (nonatomic, strong) MarkReadMenuViewController *markReadMenuViewController;
|
2016-01-27 20:52:09 -08:00
|
|
|
@property (nonatomic, strong) FeedChooserViewController *feedChooserViewController;
|
2012-07-22 14:23:50 -07:00
|
|
|
@property (nonatomic) IBOutlet FirstTimeUserViewController *firstTimeUserViewController;
|
|
|
|
@property (nonatomic) IBOutlet FirstTimeUserAddSitesViewController *firstTimeUserAddSitesViewController;
|
|
|
|
@property (nonatomic) IBOutlet FirstTimeUserAddFriendsViewController *firstTimeUserAddFriendsViewController;
|
|
|
|
@property (nonatomic) IBOutlet FirstTimeUserAddNewsBlurViewController *firstTimeUserAddNewsBlurViewController;
|
|
|
|
|
2017-03-19 18:15:36 -07:00
|
|
|
@property (nonatomic) AFHTTPSessionManager *networkManager;
|
2014-02-12 20:09:37 -08:00
|
|
|
@property (nonatomic, readwrite) StoriesCollection *storiesCollection;
|
2017-04-03 18:52:23 -07:00
|
|
|
@property (nonatomic, readwrite) PINCache *cachedFavicons;
|
|
|
|
@property (nonatomic, readwrite) PINCache *cachedStoryImages;
|
2014-02-24 18:56:51 -08:00
|
|
|
|
2016-01-21 22:11:37 -08:00
|
|
|
@property (nonatomic, readonly) NSString *url;
|
|
|
|
@property (nonatomic, readonly) NSString *host;
|
|
|
|
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (readwrite) NSString * activeUsername;
|
|
|
|
@property (readwrite) NSString * activeUserProfileId;
|
2012-07-28 14:15:20 -07:00
|
|
|
@property (readwrite) NSString * activeUserProfileName;
|
2012-10-02 15:39:18 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL hasNoSites;
|
2012-08-06 19:21:39 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL isTryFeedView;
|
2012-07-16 22:35:28 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL inFindingStoryMode;
|
2013-07-17 19:22:41 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL hasLoadedFeedDetail;
|
2012-07-16 19:45:14 -07:00
|
|
|
@property (nonatomic) NSString *tryFeedStoryId;
|
2016-12-06 16:03:40 -08:00
|
|
|
@property (nonatomic) NSString *tryFeedFeedId;
|
2012-07-31 23:49:51 -07:00
|
|
|
@property (nonatomic) NSString *tryFeedCategory;
|
2012-06-19 15:47:51 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL popoverHasFeedView;
|
2012-06-29 23:25:56 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL inFeedDetail;
|
2012-08-02 18:00:48 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL inStoryDetail;
|
2014-10-30 17:26:34 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL isPresentingActivities;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (readwrite) NSDictionary * activeStory;
|
|
|
|
@property (readwrite) NSURL * activeOriginalStoryURL;
|
2014-02-12 20:09:37 -08:00
|
|
|
@property (readwrite) NSDictionary * activeComment;
|
|
|
|
@property (readwrite) NSString * activeShareType;
|
2017-04-03 16:07:01 -07:00
|
|
|
@property (readwrite) NSInteger feedDetailPortraitYCoordinate;
|
|
|
|
@property (readwrite) NSInteger originalStoryCount;
|
|
|
|
@property (readwrite) NSInteger savedStoriesCount;
|
|
|
|
@property (readwrite) NSInteger totalUnfetchedStoryCount;
|
|
|
|
@property (readwrite) NSInteger remainingUnfetchedStoryCount;
|
|
|
|
@property (readwrite) NSInteger totalUncachedImagesCount;
|
|
|
|
@property (readwrite) NSInteger remainingUncachedImagesCount;
|
|
|
|
@property (readwrite) NSInteger latestFetchedStoryDate;
|
|
|
|
@property (readwrite) NSInteger latestCachedImageDate;
|
2011-07-29 09:06:17 -07:00
|
|
|
@property (readwrite) NSInteger selectedIntelligence;
|
2013-07-19 15:41:43 -07:00
|
|
|
@property (readwrite) NSMutableDictionary * recentlyReadStories;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (readwrite) NSMutableSet * recentlyReadFeeds;
|
|
|
|
@property (readwrite) NSMutableArray * readStories;
|
2013-09-05 12:38:06 -07:00
|
|
|
@property (readwrite) NSMutableDictionary *unreadStoryHashes;
|
2018-09-13 10:44:00 -07:00
|
|
|
@property (readwrite) NSMutableDictionary *unsavedStoryHashes;
|
2012-10-14 17:30:03 -07:00
|
|
|
@property (nonatomic) NSMutableDictionary *folderCountCache;
|
2014-09-26 18:35:40 -07:00
|
|
|
@property (nonatomic) NSMutableDictionary *collapsedFolders;
|
2014-10-01 14:23:57 -07:00
|
|
|
@property (nonatomic) UIFontDescriptor *fontDescriptorTitleSize;
|
|
|
|
|
2010-06-25 18:36:01 -04:00
|
|
|
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) NSDictionary *dictFolders;
|
2012-07-27 16:10:13 -07:00
|
|
|
@property (nonatomic, strong) NSMutableDictionary *dictFeeds;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) NSMutableDictionary *dictActiveFeeds;
|
|
|
|
@property (nonatomic) NSDictionary *dictSocialFeeds;
|
2014-05-20 12:21:17 -07:00
|
|
|
@property (nonatomic) NSDictionary *dictSavedStoryTags;
|
2016-03-26 21:27:25 -07:00
|
|
|
@property (nonatomic, strong) NSDictionary *dictSavedStoryFeedCounts;
|
2013-03-04 20:21:29 -08:00
|
|
|
@property (nonatomic) NSDictionary *dictSocialProfile;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) NSDictionary *dictUserProfile;
|
2013-03-04 20:21:29 -08:00
|
|
|
@property (nonatomic) NSDictionary *dictSocialServices;
|
2017-11-09 18:43:37 -08:00
|
|
|
@property (nonatomic) BOOL isPremium;
|
2017-11-15 11:14:05 -08:00
|
|
|
@property (nonatomic) NSInteger premiumExpire;
|
2013-06-29 17:28:41 -07:00
|
|
|
@property (nonatomic, strong) NSMutableDictionary *dictUnreadCounts;
|
2015-10-05 11:45:33 -07:00
|
|
|
@property (nonatomic, strong) NSMutableDictionary *dictTextFeeds;
|
2012-07-26 23:07:47 -07:00
|
|
|
@property (nonatomic) NSArray *userInteractionsArray;
|
|
|
|
@property (nonatomic) NSArray *userActivitiesArray;
|
2012-07-15 15:06:06 -07:00
|
|
|
@property (nonatomic) NSMutableArray *dictFoldersArray;
|
2016-11-23 09:29:29 -08:00
|
|
|
@property (nonatomic) NSArray *notificationFeedIds;
|
2011-10-04 18:01:35 -07:00
|
|
|
|
2012-08-14 17:20:45 -07:00
|
|
|
@property (nonatomic) NSArray *categories;
|
|
|
|
@property (nonatomic) NSDictionary *categoryFeeds;
|
2013-06-14 19:21:30 -07:00
|
|
|
@property (readwrite) FMDatabaseQueue *database;
|
2013-07-15 18:25:09 -07:00
|
|
|
@property (nonatomic) NSOperationQueue *offlineQueue;
|
2013-08-05 18:32:43 -07:00
|
|
|
@property (nonatomic) NSOperationQueue *offlineCleaningQueue;
|
2014-02-11 15:20:41 -08:00
|
|
|
@property (nonatomic) NSOperationQueue *cacheImagesOperationQueue;
|
2013-06-23 22:19:08 -07:00
|
|
|
@property (nonatomic) NSMutableDictionary *activeCachedImages;
|
2013-07-15 18:25:09 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL hasQueuedReadStories;
|
2018-09-13 10:44:00 -07:00
|
|
|
@property (nonatomic, readwrite) BOOL hasQueuedSavedStories;
|
2015-11-05 14:16:11 -08:00
|
|
|
@property (nonatomic, readonly) BOOL showingSafariViewController;
|
2015-11-28 22:07:38 -08:00
|
|
|
@property (nonatomic, readonly) BOOL isCompactWidth;
|
|
|
|
@property (nonatomic) CGFloat compactWidth;
|
2012-08-14 17:20:45 -07:00
|
|
|
|
2013-10-17 12:32:19 -07:00
|
|
|
@property (nonatomic, strong) void (^backgroundCompletionHandler)(UIBackgroundFetchResult);
|
|
|
|
|
2011-12-03 18:22:14 -08:00
|
|
|
+ (NewsBlurAppDelegate*) sharedAppDelegate;
|
2013-07-16 18:06:36 -07:00
|
|
|
- (void)registerDefaultsFromSettingsBundle;
|
2013-10-17 12:32:19 -07:00
|
|
|
- (void)finishBackground;
|
2011-12-03 18:22:14 -08:00
|
|
|
|
2012-06-13 18:07:24 -07:00
|
|
|
- (void)showFirstTimeUser;
|
2010-11-11 23:48:27 -05:00
|
|
|
- (void)showLogin;
|
2013-05-30 18:45:51 -07:00
|
|
|
- (void)setupReachability;
|
2016-11-17 19:53:46 -08:00
|
|
|
- (void)registerForRemoteNotifications;
|
2017-10-04 14:55:09 -07:00
|
|
|
- (void)registerForBadgeNotifications;
|
2012-06-24 23:02:37 -07:00
|
|
|
|
2012-07-01 12:08:30 -07:00
|
|
|
// social
|
2013-09-25 17:43:00 -07:00
|
|
|
- (NSDictionary *)getUser:(NSInteger)userId;
|
2012-07-28 12:56:51 -07:00
|
|
|
- (void)showUserProfileModal:(id)sender;
|
2012-07-28 14:15:20 -07:00
|
|
|
- (void)pushUserProfile;
|
2012-07-12 22:05:23 -07:00
|
|
|
- (void)hideUserProfileModal;
|
2014-01-06 18:37:57 -08:00
|
|
|
- (void)showSendTo:(UIViewController *)vc sender:(id)sender;
|
|
|
|
- (void)showSendTo:(UIViewController *)vc sender:(id)sender
|
|
|
|
withUrl:(NSURL *)url
|
2014-01-06 17:54:18 -08:00
|
|
|
authorName:(NSString *)authorName
|
|
|
|
text:(NSString *)text
|
|
|
|
title:(NSString *)title
|
|
|
|
feedTitle:(NSString *)title
|
|
|
|
images:(NSArray *)images;
|
2012-07-01 12:08:30 -07:00
|
|
|
- (void)showFindFriends;
|
2016-01-27 20:52:09 -08:00
|
|
|
- (void)showMuteSites;
|
|
|
|
- (void)showOrganizeSites;
|
2017-11-09 18:43:37 -08:00
|
|
|
- (void)showPremiumDialog;
|
2013-06-21 17:48:06 -07:00
|
|
|
- (void)showPreferences;
|
2019-02-05 21:05:34 -08:00
|
|
|
- (void)resizePreviewSize;
|
2017-10-04 16:34:30 -07:00
|
|
|
- (void)resizeFontSize;
|
2012-07-28 23:31:12 -07:00
|
|
|
|
2011-12-03 18:22:14 -08:00
|
|
|
- (void)showMoveSite;
|
2012-12-24 23:01:25 -08:00
|
|
|
- (void)openTrainSite;
|
2016-11-23 10:13:22 -08:00
|
|
|
- (void)openNotificationsWithFeed:(NSString *)feedId;
|
2016-11-24 16:41:41 -05:00
|
|
|
- (void)openNotificationsWithFeed:(NSString *)feedId sender:(id)sender;
|
2017-04-05 18:46:39 -07:00
|
|
|
- (void)updateNotifications:(NSDictionary *)params feed:(NSString *)feedId;
|
|
|
|
- (void)checkForFeedNotifications;
|
2013-10-02 16:28:09 -07:00
|
|
|
- (void)openTrainSiteWithFeedLoaded:(BOOL)feedLoaded from:(id)sender;
|
2012-12-27 23:04:25 -08:00
|
|
|
- (void)openTrainStory:(id)sender;
|
2014-11-10 16:00:59 -08:00
|
|
|
- (void)openUserTagsStory:(id)sender;
|
2010-06-25 18:36:01 -04:00
|
|
|
- (void)loadFeedDetailView;
|
2014-02-10 19:21:53 -08:00
|
|
|
- (void)loadFeedDetailView:(BOOL)transition;
|
2016-11-21 15:31:14 -08:00
|
|
|
- (void)loadFeed:(NSString *)feedId withStory:(NSString *)contentId animated:(BOOL)animated;
|
2012-08-12 21:46:47 -07:00
|
|
|
- (void)loadTryFeedDetailView:(NSString *)feedId withStory:(NSString *)contentId isSocial:(BOOL)social withUser:(NSDictionary *)user showFindingStory:(BOOL)showHUD;
|
2013-09-11 17:05:47 -07:00
|
|
|
- (void)loadStarredDetailViewWithStory:(NSString *)contentId showFindingStory:(BOOL)showHUD;
|
2014-02-12 20:09:37 -08:00
|
|
|
- (void)loadRiverFeedDetailView:(FeedDetailViewController *)feedDetailView withFolder:(NSString *)folder;
|
2014-02-18 18:38:07 -08:00
|
|
|
- (void)openDashboardRiverForStory:(NSString *)contentId
|
|
|
|
showFindingStory:(BOOL)showHUD;
|
2014-02-10 19:21:53 -08:00
|
|
|
|
2010-06-25 18:36:01 -04:00
|
|
|
- (void)loadStoryDetailView;
|
2012-06-29 21:15:43 -07:00
|
|
|
- (void)adjustStoryDetailWebView;
|
2012-07-23 15:27:20 -07:00
|
|
|
- (void)calibrateStoryTitles;
|
2012-12-12 15:08:24 -08:00
|
|
|
- (void)recalculateIntelligenceScores:(id)feedId;
|
2017-03-19 18:15:36 -07:00
|
|
|
- (void)cancelRequests;
|
2011-12-03 18:22:14 -08:00
|
|
|
- (void)reloadFeedsView:(BOOL)showLoader;
|
2010-11-11 23:48:27 -05:00
|
|
|
- (void)setTitle:(NSString *)title;
|
2012-06-14 10:19:36 -07:00
|
|
|
- (void)showOriginalStory:(NSURL *)url;
|
2010-11-13 18:32:43 -05:00
|
|
|
- (void)closeOriginalStory;
|
2012-07-10 12:34:58 -07:00
|
|
|
- (void)hideStoryDetailView;
|
2012-06-20 19:18:29 -07:00
|
|
|
- (void)changeActiveFeedDetailRow;
|
2012-07-30 14:58:57 -07:00
|
|
|
- (void)showShareView:(NSString *)type setUserId:(NSString *)userId setUsername:(NSString *)username setReplyId:(NSString *)commentIndex;
|
2012-07-12 13:34:41 -07:00
|
|
|
- (void)hideShareView:(BOOL)resetComment;
|
2012-06-27 15:24:18 -07:00
|
|
|
- (void)resetShareComments;
|
2012-06-26 12:12:31 -07:00
|
|
|
- (BOOL)isSocialFeed:(NSString *)feedIdStr;
|
2014-05-20 12:21:17 -07:00
|
|
|
- (BOOL)isSavedFeed:(NSString *)feedIdStr;
|
2016-03-26 21:27:25 -07:00
|
|
|
- (NSInteger)savedStoriesCountForFeed:(NSString *)feedIdStr;
|
|
|
|
- (BOOL)isSavedStoriesIntelligenceMode;
|
2015-11-18 13:43:04 -08:00
|
|
|
- (NSArray *)allFeedIds;
|
2015-11-13 21:54:32 -08:00
|
|
|
- (NSArray *)feedIdsForFolderTitle:(NSString *)folderTitle;
|
2012-07-02 13:10:00 -07:00
|
|
|
- (BOOL)isPortrait;
|
2012-07-02 11:28:55 -07:00
|
|
|
- (void)confirmLogout;
|
2013-03-04 20:21:29 -08:00
|
|
|
- (void)showConnectToService:(NSString *)serviceName;
|
2017-04-11 15:43:42 -07:00
|
|
|
- (void)showAlert:(UIAlertController *)alert withViewController:(UIViewController *)vc;
|
2017-09-26 10:48:02 -07:00
|
|
|
- (void)refreshUserProfile:(void(^)(void))callback;
|
2014-03-21 16:23:51 -07:00
|
|
|
- (void)refreshFeedCount:(id)feedId;
|
2011-08-22 18:25:33 -07:00
|
|
|
|
2015-10-05 11:45:33 -07:00
|
|
|
- (void)populateDictTextFeeds;
|
|
|
|
- (BOOL)isFeedInTextView:(id)feedId;
|
|
|
|
- (void)toggleFeedTextView:(id)feedId;
|
|
|
|
|
2013-06-29 17:28:41 -07:00
|
|
|
- (void)populateDictUnreadCounts;
|
2013-09-25 17:43:00 -07:00
|
|
|
- (NSInteger)unreadCount;
|
|
|
|
- (NSInteger)allUnreadCount;
|
|
|
|
- (NSInteger)unreadCountForFeed:(NSString *)feedId;
|
|
|
|
- (NSInteger)unreadCountForFolder:(NSString *)folderName;
|
2012-10-12 15:33:40 -04:00
|
|
|
- (UnreadCounts *)splitUnreadCountForFeed:(NSString *)feedId;
|
|
|
|
- (UnreadCounts *)splitUnreadCountForFolder:(NSString *)folderName;
|
2011-11-10 18:28:22 -08:00
|
|
|
- (NSDictionary *)markVisibleStoriesRead;
|
2014-09-26 18:35:40 -07:00
|
|
|
- (BOOL)isFolderCollapsed:(NSString *)folderName;
|
2013-09-30 16:18:11 -07:00
|
|
|
|
2011-11-09 09:51:42 -08:00
|
|
|
- (void)markActiveFolderAllRead;
|
2011-11-10 18:28:22 -08:00
|
|
|
- (void)markFeedAllRead:(id)feedId;
|
2013-09-30 16:18:11 -07:00
|
|
|
- (void)markFeedReadInCache:(NSArray *)feedIds;
|
2013-10-08 19:33:11 -07:00
|
|
|
- (void)markFeedReadInCache:(NSArray *)feedIds cutoffTimestamp:(NSInteger)cutoff;
|
2015-10-28 17:02:45 -07:00
|
|
|
- (void)markFeedReadInCache:(NSArray *)feedIds cutoffTimestamp:(NSInteger)cutoff older:(BOOL)older;
|
2013-10-08 19:33:11 -07:00
|
|
|
- (void)markStoriesRead:(NSDictionary *)stories inFeeds:(NSArray *)feeds cutoffTimestamp:(NSInteger)cutoff;
|
2014-03-05 14:13:49 -08:00
|
|
|
- (void)finishMarkAsRead:(NSDictionary *)story;
|
|
|
|
- (void)finishMarkAsUnread:(NSDictionary *)story;
|
2017-03-19 18:15:36 -07:00
|
|
|
- (void)failedMarkAsUnread:(NSDictionary *)params;
|
|
|
|
- (void)finishMarkAsSaved:(NSDictionary *)params;
|
|
|
|
- (void)failedMarkAsSaved:(NSDictionary *)params;
|
|
|
|
- (void)finishMarkAsUnsaved:(NSDictionary *)params;
|
|
|
|
- (void)failedMarkAsUnsaved:(NSDictionary *)params;
|
2014-12-16 15:36:58 -08:00
|
|
|
- (NSInteger)adjustSavedStoryCount:(NSString *)tagName direction:(NSInteger)direction;
|
2014-11-04 17:53:27 -08:00
|
|
|
- (NSArray *)updateStarredStoryCounts:(NSDictionary *)results;
|
2015-04-26 22:34:12 -07:00
|
|
|
- (void)renameFeed:(NSString *)newTitle;
|
|
|
|
- (void)renameFolder:(NSString *)newTitle;
|
2013-09-30 16:18:11 -07:00
|
|
|
|
2015-11-13 21:54:32 -08:00
|
|
|
- (void)showMarkReadMenuWithFeedIds:(NSArray *)feedIds collectionTitle:(NSString *)collectionTitle visibleUnreadCount:(NSInteger)visibleUnreadCount barButtonItem:(UIBarButtonItem *)barButtonItem completionHandler:(void (^)(BOOL marked))completionHandler;
|
|
|
|
- (void)showMarkReadMenuWithFeedIds:(NSArray *)feedIds collectionTitle:(NSString *)collectionTitle sourceView:(UIView *)sourceView sourceRect:(CGRect)sourceRect completionHandler:(void (^)(BOOL marked))completionHandler;
|
2016-01-08 21:53:16 -08:00
|
|
|
- (void)showMarkOlderNewerReadMenuWithStoriesCollection:(StoriesCollection *)olderNewerCollection story:(NSDictionary *)olderNewerStory sourceView:(UIView *)sourceView sourceRect:(CGRect)sourceRect extraItems:(NSArray *)extraItems completionHandler:(void (^)(BOOL marked))completionHandler;
|
2015-11-13 21:54:32 -08:00
|
|
|
|
2015-12-15 12:37:18 -08:00
|
|
|
- (void)showPopoverWithViewController:(UIViewController *)viewController contentSize:(CGSize)contentSize barButtonItem:(UIBarButtonItem *)barButtonItem;
|
|
|
|
- (void)showPopoverWithViewController:(UIViewController *)viewController contentSize:(CGSize)contentSize sourceView:(UIView *)sourceView sourceRect:(CGRect)sourceRect;
|
2016-03-18 21:29:42 -07:00
|
|
|
- (void)showPopoverWithViewController:(UIViewController *)viewController contentSize:(CGSize)contentSize sourceView:(UIView *)sourceView sourceRect:(CGRect)sourceRect permittedArrowDirections:(UIPopoverArrowDirection)permittedArrowDirections;
|
2016-01-07 21:12:58 -08:00
|
|
|
- (void)hidePopoverAnimated:(BOOL)animated completion:(void (^)(void))completion;
|
2015-12-15 12:37:18 -08:00
|
|
|
- (BOOL)hidePopoverAnimated:(BOOL)animated;
|
|
|
|
- (void)hidePopover;
|
|
|
|
|
2014-03-21 16:23:51 -07:00
|
|
|
+ (int)computeStoryScore:(NSDictionary *)intelligence;
|
2011-12-04 21:09:16 -08:00
|
|
|
- (NSString *)extractFolderName:(NSString *)folderName;
|
|
|
|
- (NSString *)extractParentFolderName:(NSString *)folderName;
|
2014-10-30 18:05:34 -07:00
|
|
|
- (NSArray *)parentFoldersForFeed:(NSString *)feedId;
|
2012-12-28 11:34:06 -08:00
|
|
|
- (NSDictionary *)getFeed:(NSString *)feedId;
|
2014-03-05 14:13:49 -08:00
|
|
|
- (NSDictionary *)getStory:(NSString *)storyHash;
|
2012-12-28 11:34:06 -08:00
|
|
|
|
2013-02-14 15:36:21 -08:00
|
|
|
+ (void)fillGradient:(CGRect)r startColor:(UIColor *)startColor endColor:(UIColor *)endColor;
|
2015-09-16 20:24:11 -07:00
|
|
|
+ (UIColor *)faviconColor:(NSString *)colorString;
|
|
|
|
+ (UIView *)makeGradientView:(CGRect)rect startColor:(NSString *)start endColor:(NSString *)end borderColor:(NSString *)borderColor;
|
2011-10-28 18:29:33 -07:00
|
|
|
- (UIView *)makeFeedTitleGradient:(NSDictionary *)feed withRect:(CGRect)rect;
|
2011-12-02 16:23:00 -08:00
|
|
|
- (UIView *)makeFeedTitle:(NSDictionary *)feed;
|
2014-02-24 18:56:51 -08:00
|
|
|
- (void)saveFavicon:(UIImage *)image feedId:(NSString *)filename;
|
|
|
|
- (UIImage *)getFavicon:(NSString *)filename;
|
|
|
|
- (UIImage *)getFavicon:(NSString *)filename isSocial:(BOOL)isSocial;
|
2014-05-20 13:12:03 -07:00
|
|
|
- (UIImage *)getFavicon:(NSString *)filename isSocial:(BOOL)isSocial isSaved:(BOOL)isSaved;
|
2012-12-27 18:37:05 -08:00
|
|
|
|
|
|
|
- (void)toggleAuthorClassifier:(NSString *)author feedId:(NSString *)feedId;
|
|
|
|
- (void)toggleTagClassifier:(NSString *)tag feedId:(NSString *)feedId;
|
2013-09-25 17:43:00 -07:00
|
|
|
- (void)toggleTitleClassifier:(NSString *)title feedId:(NSString *)feedId score:(NSInteger)score;
|
2012-12-27 18:37:05 -08:00
|
|
|
- (void)toggleFeedClassifier:(NSString *)feedId;
|
|
|
|
|
2013-09-25 17:43:00 -07:00
|
|
|
- (NSInteger)databaseSchemaVersion:(FMDatabase *)db;
|
2013-06-14 19:21:30 -07:00
|
|
|
- (void)createDatabaseConnection;
|
2017-04-04 15:33:08 -07:00
|
|
|
- (void)setupDatabase:(FMDatabase *)db force:(BOOL)force;
|
2013-07-18 18:24:38 -07:00
|
|
|
- (void)cancelOfflineQueue;
|
2013-07-15 18:25:09 -07:00
|
|
|
- (void)startOfflineQueue;
|
|
|
|
- (void)startOfflineFetchStories;
|
|
|
|
- (void)startOfflineFetchImages;
|
2015-09-16 16:53:07 -07:00
|
|
|
- (BOOL)isReachableForOffline;
|
2013-09-05 16:34:39 -07:00
|
|
|
- (void)storeUserProfiles:(NSArray *)userProfiles;
|
2015-09-17 13:15:10 -07:00
|
|
|
- (void)markScrollPosition:(NSInteger)position inStory:(NSDictionary *)story;
|
2013-08-06 18:08:55 -07:00
|
|
|
- (void)queueReadStories:(NSDictionary *)feedsStories;
|
2013-10-03 18:07:39 -07:00
|
|
|
- (BOOL)dequeueReadStoryHash:(NSString *)storyHash inFeed:(NSString *)storyFeedId;
|
2017-09-26 10:48:02 -07:00
|
|
|
- (void)flushQueuedReadStories:(BOOL)forceCheck withCallback:(void(^)(void))callback;
|
|
|
|
- (void)syncQueuedReadStories:(FMDatabase *)db withStories:(NSDictionary *)hashes withCallback:(void(^)(void))callback;
|
2018-09-13 10:44:00 -07:00
|
|
|
- (void)queueSavedStory:(NSDictionary *)story;
|
2013-06-23 22:19:08 -07:00
|
|
|
- (void)prepareActiveCachedImages:(FMDatabase *)db;
|
2013-10-08 16:00:55 -07:00
|
|
|
- (void)cleanImageCache;
|
2013-07-15 18:25:09 -07:00
|
|
|
- (void)deleteAllCachedImages;
|
2013-05-30 18:45:51 -07:00
|
|
|
|
2010-06-17 13:10:45 -04:00
|
|
|
@end
|
|
|
|
|
2012-10-12 15:33:40 -04:00
|
|
|
@interface UnreadCounts : NSObject {
|
2012-10-07 15:47:21 -04:00
|
|
|
int ps;
|
|
|
|
int nt;
|
|
|
|
int ng;
|
|
|
|
}
|
|
|
|
|
|
|
|
@property (readwrite) int ps;
|
|
|
|
@property (readwrite) int nt;
|
|
|
|
@property (readwrite) int ng;
|
|
|
|
|
2012-10-12 15:33:40 -04:00
|
|
|
- (void)addCounts:(UnreadCounts *)counts;
|
2012-10-07 15:47:21 -04:00
|
|
|
|
|
|
|
@end
|
|
|
|
|