/***********************************************************************
  Secure PDF 2024 for macOS and iOS
  Copyright (c) 2026 /n software inc.
************************************************************************/

#import <Foundation/Foundation.h>


#ifndef NS_SWIFT_NAME
#define NS_SWIFT_NAME(x)
#endif

@protocol SecurePDFPDFExplorerDelegate <NSObject>
@optional
- (void)onError:(int)errorCode :(NSString*)description NS_SWIFT_NAME(onError(_:_:));

- (void)onLog:(int)logLevel :(NSString*)message :(NSString*)logType NS_SWIFT_NAME(onLog(_:_:_:));

@end

@interface SecurePDFPDFExplorer : NSObject {
  @public void* m_pObj;
  @public CFMutableArrayRef m_rNotifiers;
  __unsafe_unretained id <SecurePDFPDFExplorerDelegate> m_delegate;
  BOOL m_raiseNSException;
  BOOL m_delegateHasError;

  BOOL m_delegateHasLog;

}

+ (SecurePDFPDFExplorer*)pdfexplorer;

- (id)init;
- (void)dealloc;

- (NSString*)lastError;
- (int)lastErrorCode;
- (int)eventErrorCode;

@property (nonatomic,readwrite,assign,getter=delegate,setter=setDelegate:) id <SecurePDFPDFExplorerDelegate> delegate;
- (id <SecurePDFPDFExplorerDelegate>)delegate;
- (void) setDelegate:(id <SecurePDFPDFExplorerDelegate>)anObject;

  /* Events */

- (void)onError:(int)errorCode :(NSString*)description NS_SWIFT_NAME(onError(_:_:));

- (void)onLog:(int)logLevel :(NSString*)message :(NSString*)logType NS_SWIFT_NAME(onLog(_:_:_:));

  /* Properties */

@property (nonatomic,readwrite,assign,getter=RuntimeLicense,setter=setRuntimeLicense:) NSString* RuntimeLicense NS_SWIFT_NAME(RuntimeLicense);
- (NSString*)RuntimeLicense;
- (void)setRuntimeLicense:(NSString*)newRuntimeLicense;

@property (nonatomic,readonly,assign,getter=VERSION) NSString* VERSION NS_SWIFT_NAME(VERSION);
- (NSString*)VERSION;

@property (nonatomic,readwrite,assign,getter=raiseNSException,setter=setRaiseNSException:) BOOL raiseNSException NS_SWIFT_NAME(raiseNSException);
- (BOOL)raiseNSException NS_SWIFT_NAME(raiseNSException());
- (void)setRaiseNSException:(BOOL)newRaiseNSException NS_SWIFT_NAME(setRaiseNSException(_:));

@property (nonatomic,readwrite,assign,getter=inputData,setter=setInputData:) NSData* inputData NS_SWIFT_NAME(inputData);

- (NSData*)inputData NS_SWIFT_NAME(inputData());
- (void)setInputData :(NSData*)newInputData NS_SWIFT_NAME(setInputData(_:));

@property (nonatomic,readwrite,assign,getter=inputFile,setter=setInputFile:) NSString* inputFile NS_SWIFT_NAME(inputFile);

- (NSString*)inputFile NS_SWIFT_NAME(inputFile());
- (void)setInputFile :(NSString*)newInputFile NS_SWIFT_NAME(setInputFile(_:));

@property (nonatomic,readonly,assign,getter=outputData) NSData* outputData NS_SWIFT_NAME(outputData);

- (NSData*)outputData NS_SWIFT_NAME(outputData());

@property (nonatomic,readwrite,assign,getter=outputFile,setter=setOutputFile:) NSString* outputFile NS_SWIFT_NAME(outputFile);

- (NSString*)outputFile NS_SWIFT_NAME(outputFile());
- (void)setOutputFile :(NSString*)newOutputFile NS_SWIFT_NAME(setOutputFile(_:));

@property (nonatomic,readwrite,assign,getter=overwrite,setter=setOverwrite:) BOOL overwrite NS_SWIFT_NAME(overwrite);

- (BOOL)overwrite NS_SWIFT_NAME(overwrite());
- (void)setOverwrite :(BOOL)newOverwrite NS_SWIFT_NAME(setOverwrite(_:));

@property (nonatomic,readonly,assign,getter=rootObjectCount) int rootObjectCount NS_SWIFT_NAME(rootObjectCount);

- (int)rootObjectCount NS_SWIFT_NAME(rootObjectCount());

- (BOOL)rootObjectContainer:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectContainer(_:));

- (int)rootObjectDisposition:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectDisposition(_:));

- (int)rootObjectElementCount:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectElementCount(_:));

- (int)rootObjectGenNumber:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectGenNumber(_:));

- (NSString*)rootObjectKeys:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectKeys(_:));

- (int)rootObjectObjectNumber:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectObjectNumber(_:));

- (int)rootObjectObjectType:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectObjectType(_:));

- (long long)rootObjectOffset:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectOffset(_:));

- (NSString*)rootObjectPath:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectPath(_:));

- (long long)rootObjectSize:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectSize(_:));

- (NSString*)rootObjectValue:(int)rootObjectIndex NS_SWIFT_NAME(rootObjectValue(_:));
- (void)setRootObjectValue:(int)rootObjectIndex :(NSString*)newRootObjectValue NS_SWIFT_NAME(setRootObjectValue(_:_:));

@property (nonatomic,readonly,assign,getter=selectedObjectCount) int selectedObjectCount NS_SWIFT_NAME(selectedObjectCount);

- (int)selectedObjectCount NS_SWIFT_NAME(selectedObjectCount());

- (BOOL)selectedObjectContainer:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectContainer(_:));

- (int)selectedObjectDisposition:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectDisposition(_:));

- (int)selectedObjectElementCount:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectElementCount(_:));

- (int)selectedObjectGenNumber:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectGenNumber(_:));

- (NSString*)selectedObjectKeys:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectKeys(_:));

- (int)selectedObjectObjectNumber:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectObjectNumber(_:));

- (int)selectedObjectObjectType:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectObjectType(_:));

- (long long)selectedObjectOffset:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectOffset(_:));

- (NSString*)selectedObjectPath:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectPath(_:));

- (long long)selectedObjectSize:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectSize(_:));

- (NSString*)selectedObjectValue:(int)selectedObjectIndex NS_SWIFT_NAME(selectedObjectValue(_:));
- (void)setSelectedObjectValue:(int)selectedObjectIndex :(NSString*)newSelectedObjectValue NS_SWIFT_NAME(setSelectedObjectValue(_:_:));

  /* Methods */

- (NSString*)addContainer:(NSString*)basePath :(NSString*)objectName :(BOOL)dictionary :(BOOL)indirect NS_SWIFT_NAME(addContainer(_:_:_:_:));

- (NSString*)addObject:(NSString*)basePath :(int)objectType :(NSString*)objectName :(NSString*)value :(BOOL)indirect NS_SWIFT_NAME(addObject(_:_:_:_:_:));

- (NSString*)addOpaque:(NSString*)basePath :(NSString*)objectName :(NSString*)value NS_SWIFT_NAME(addOpaque(_:_:_:));

- (NSString*)addPrimitive:(NSString*)basePath :(NSString*)objectName :(NSString*)value NS_SWIFT_NAME(addPrimitive(_:_:_:));

- (NSString*)addReference:(NSString*)basePath :(NSString*)objectName :(NSString*)refPath NS_SWIFT_NAME(addReference(_:_:_:));

- (NSString*)addStream:(NSString*)basePath :(NSString*)objectName :(NSData*)value NS_SWIFT_NAME(addStream(_:_:_:));

- (void)close NS_SWIFT_NAME(close());

- (NSString*)config:(NSString*)configurationString NS_SWIFT_NAME(config(_:));

- (void)createNew NS_SWIFT_NAME(createNew());

- (NSData*)getObjectData:(NSString*)path NS_SWIFT_NAME(getObjectData(_:));

- (void)open NS_SWIFT_NAME(open());

- (void)removeObject:(NSString*)path NS_SWIFT_NAME(removeObject(_:));

- (void)reset NS_SWIFT_NAME(reset());

- (void)select:(NSString*)filter :(BOOL)clearExistingSelection NS_SWIFT_NAME(select(_:_:));

- (void)setObjectData:(NSString*)path :(NSData*)value NS_SWIFT_NAME(setObjectData(_:_:));

@end

