2019-10-26 11:45:19 +00:00
|
|
|
/* Implementation of class NSBackgroundActivityScheduler
|
|
|
|
Copyright (C) 2019 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
By: Gregory John Casamento <greg.casamento@gmail.com>
|
|
|
|
Date: Fri Oct 25 00:52:54 EDT 2019
|
|
|
|
|
|
|
|
This file is part of the GNUstep Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <Foundation/NSBackgroundActivityScheduler.h>
|
|
|
|
|
|
|
|
@implementation NSBackgroundActivityScheduler
|
|
|
|
|
2019-10-26 12:11:59 +00:00
|
|
|
- (instancetype) initWithIdentifier: (NSString *)identifier
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
self = [super init];
|
|
|
|
if(self != nil)
|
|
|
|
{
|
|
|
|
_identifier = identifier;
|
|
|
|
_qualityOfService = NSQualityOfServiceDefault;
|
|
|
|
_repeats = NO;
|
|
|
|
_interval = 0;
|
|
|
|
_tolerance = 0;
|
|
|
|
_shouldDefer = NO;
|
|
|
|
}
|
|
|
|
return self;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString *) identifier
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
return _identifier;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setIdentifier: (NSString *)identifier
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
ASSIGNCOPY(_identifier, identifier);
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSQualityOfService) qualityOfService
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
return _qualityOfService;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setQualityOfService: (NSQualityOfService)qualityOfService
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
_qualityOfService = qualityOfService;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) repeats
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
return _repeats;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setRepeats: (BOOL)flag
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
_repeats = flag;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSTimeInterval) interval
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
return _interval;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setInterval: (NSTimeInterval)interval
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
_interval = interval;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSTimeInterval) tolerance
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
return _tolerance;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
2019-10-26 12:20:20 +00:00
|
|
|
- (void) setTolerance: (NSTimeInterval)tolerance
|
2019-10-26 12:11:59 +00:00
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
_tolerance = tolerance;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) shouldDefer
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
return _shouldDefer;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setShouldDefer: (BOOL)flag
|
|
|
|
{
|
2019-10-26 12:20:20 +00:00
|
|
|
_shouldDefer = flag;
|
2019-10-26 12:11:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) scheduleWithBlock: (GSScheduledBlock)block
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) invalidate
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-10-26 11:45:19 +00:00
|
|
|
@end
|
|
|
|
|