This file can be downloaded as part of milnlicence.tbz.

//  LCLicenceObserver.h
//  LicenceCore -
//  Copyright © Graham Miln. All rights reserved.
//  This package is subject to the terms of the Artistic License 2.0.
//  If a copy of the Artistic-2.0 was not distributed with this file, you can
//  obtain one at

@import Foundation;
#import "LCLicenceCore.h"

@class LCLicenceObserver;
// WARNING: This protocol will change. The method names and conventions are blunt but workable for now.
@protocol LCLicenceObserverProtocol
/** Called when the combined licensed state changes. */
- (void)licenceObserver:(LCLicenceObserver*)anObserver licensed:(BOOL)isLicensed;
/** Called each time the licences change, including individual trusted states; aLicence can be nil. */
- (void)licenceObserver:(LCLicenceObserver*)anObserver didChange:(LCLicence*)aLicence;

/** LCLicenceObserver observes a LicenceCore and calls the delegate when specific changes occur. Avoids duplicate KVO code. */
@interface LCLicenceObserver : NSObject
+ (instancetype)observerWithCore:(LCLicenceCore*)aCore delegate:(NSObject<LCLicenceObserverProtocol>*)aDelegate;
- (instancetype)initWithCore:(LCLicenceCore*)aCore delegate:(NSObject<LCLicenceObserverProtocol>*)aDelegate;