1
This repository has been archived on 2022-08-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
notifications-for-youtube/Notifications for YouTube/NYTChannelRestriction.h
Kim Wittenburg 15062dfb27 Archive Project
2017-07-25 17:21:13 +02:00

45 lines
2.1 KiB
Objective-C
Executable File

//
// NYTChannelRestrictions.h
// Notifications for YouTube
//
// Created by Kim Wittenburg on 21.07.13.
// Copyright (c) 2013 Kim Wittenburg. All rights reserved.
//
@class NYTUser;
/* A channel restriction contains information about the rules that apply to a specific channel. Like a predicate a restriction eventually evaluates to YES or NO giving information wether a specific video should be included in the notifications or not.
You should be aware that encoding a restriction will NOT encode the associated user. Since every channel restriction belongs to one user it is recommended that you store any restrictions as the value for a key that identifies the user (preferably the user id or the channel id).
*/
@interface NYTChannelRestriction : NSObject <NSCoding>
/* Initializes a restriction. By default a restriction always evaluates to YES.
*/
- (id)init;
/* The user this restriction belongs to. This property is not necessary but it may make things easier if you, say, want to bind restrictions to a user interface.
*/
@property NYTUser *user;
/* If YES any other properties are ignored and this restriction just evaluates to NO.
*/
@property BOOL disableAllNotifications;
/* Specifies the way of interpretation of the predicate. If this is YES a positive predicate evaluation means that the video should be included in the notifications, if this is NO a positive predicate evaluation means that the video should NOT be included. The default value is YES.
*/
@property BOOL positivePredicate;
/* The predicate that is used to evaluate this restriction. The object this predicate eventually should be evaluated with should be an instance of NYTVideo.
*/
@property NSPredicate *predicate;
/* A localized string that summarizes this restriction. It can be "Show all", "Restricted" or "Show none".
*/
- (NSString *)localizedRestrictionSummary;
/* Returns YES if this predicate evaluates to the same value as a newly created restriction would. You can use this method to efficiently store only those restrictions that are NOT the default.
*/
- (BOOL)differsFromDefaultValues;
@end