//
//  TeXDistCommon.h
//  TeXDist
//
//  Created by coder on 05/07/2011.
//  Copyright 2011 Laurens'Tribune. All rights reserved.
//
#import <Cocoa/Cocoa.h>

#ifndef MAC_OS_X_VERSION_10_4
#define MAC_OS_X_VERSION_10_4 1040
#endif

#ifndef MAC_OS_X_VERSION_10_5
#define MAC_OS_X_VERSION_10_5 1050
#endif

#ifndef OR
#define OR ||
#endif

#ifndef AND
#define AND &&
#endif

#ifndef NOT
#define NOT !
#endif

extern NSInteger TeXDistLogLevel;
#   define TeXDistLogLevelAlways (-1)

#   define TeXDistLog(LEVEL,DESCRIPTION,...) \
if (LEVEL<TeXDistLogLevel) {\
	NSLog(DESCRIPTION,##__VA_ARGS__,NULL);\
}

extern NSString * const TeXDistLogLevelPreferenceKey;
extern NSString * const TeXDistPreferenceID;

enum TeXDistErrors {
	kTeXDistOK = 0,
	kTeXDistNoCredentials,
	kTeXDistTooManyCredentials,
	kTeXDistNoMoreCredentials,
	kTeXDistNoDistributions,
	kTeXDistNoDefaultTeX,
	kTeXDistNoDefaultTeXContents,
    kTeXDistNoActiveDistribution,
    kTeXDistNoArchitecture,
	kTeXDistResetCantRemove = 100,
	kTeXDistResetMissingDirectory,
	kTeXDistResetMissingArgument,
	kTeXDistResetInconsistency,
	kTeXDistResetCantLink,
	kTeXDistResetCantCreateDirectory,
	kTeXDistResetNoAvailableDistribution,
	kTeXDistArgMissingSource = 200,
	kTeXDistArgMissingDestinationPath,
	kTeXDistArgMissingPath,
	kTeXDistArgMissingDistribution,
	kTeXDistMissingDirectory = 300,
	kTeXDistCantCreate,
	kTeXDistCantRemove,
	kTeXDistCantLink,
	kTeXDistCantMove,
	kTeXDistCantActivate,
    kTeXDistCannotUpdate_usr_texbin = 400
};

extern NSString * const TeXDistDomain;
extern NSString * const TeXDist_texbin;
extern NSString * const TeXDistComponentRoot;
extern NSString * const TeXDistComponentPrograms;

extern NSString * const TeXDistSetUpExpectedProgramsKey;
extern NSString * const TeXDistSetUpCPUNamesPriorityByArchKey;
extern NSString * const TeXDistSetUpLibraryTeXKey;
extern NSString * const TeXDistSetUpDefaultTeXKey;
extern NSString * const TeXDistSetUpProgramsRelativeKey;
extern NSString * const TeXDistSetUpRootRelativeKey;
extern NSString * const TeXDistSetUp_usr_texbin_Key;
extern NSString * const TeXDistSetUpMinimumSystemVersionsByArchKey;
extern NSString * const TeXDistSetUpMaximumSystemVersionsByArchKey;

extern NSString * const TeXDistSetUpArchitecturePrioritiesByArchKey;

extern NSString * const TeXDistExtensionKey;

extern NSString * const kTeXDistErrorStatusKey;
extern NSString * const kTeXDistErrorMessageKey;
extern NSString * const kTeXDisMissingDirectoryKey;
extern NSString * const kTeXDistCantCreateKey;
extern NSString * const kTeXDistCantRemoveKey;
extern NSString * const kTeXDistCantLinkSourceKey;
extern NSString * const kTeXDistCantLinkDestinationKey;
extern NSString * const kTeXDistCantMoveFromKey;
extern NSString * const kTeXDistCantMoveToKey;
#define kTeXDistResetErrorNumberKey kTeXDistErrorStatusKey
extern NSString * const kTeXDistResetCantRemoveKey;
extern NSString * const kTeXDistResetMissingDirectoryKey;
extern NSString * const kTeXDistResetMissingArgumentKey;
extern NSString * const kTeXDistResetCantLinkFromKey;
extern NSString * const kTeXDistResetCantLinkToKey;
extern NSString * const kTeXDistCantActivateMessage;

extern NSString * const kTeXDistNoAuthorisationMessage;
extern NSString * const kTeXDistNoDistributionsMessage;
extern NSString * const kTeXDistNoDefaultTeXMessage;
extern NSString * const kTeXDistNoDefaultTeXContentsMessage;
extern NSString * const kTeXDistNoActiveDistributionMessage;
extern NSString * const kTeXDistCannotUpdate_usr_texbin_Message;
extern NSString * const kTeXDistNoArchitectureMessage;
extern NSString * const kTeXDistMissingDistributionMessage;

extern NSString * const kTeXDistHelpArgument;
extern NSString * const kTeXDistResetArgument;
extern NSString * const kTeXDistListDistributionsArgument;
extern NSString * const kTeXDistListActiveDistributionArgument;
extern NSString * const kTeXDistUpdateArgument;
extern NSString * const kTeXDistNoCredentialsArgument;
extern NSString * const kTeXDistNoUserInterfaceArgument;
extern NSString * const kTeXDistActivateArgument;
extern NSString * const kTeXDistributionArgument;
extern NSString * const kTeXDistArchitectureArgument;

extern NSString * const TeXDistUtilityCommand_ln;
extern NSString * const TeXDistUtilityCommand_mkdir;
extern NSString * const TeXDistUtilityCommand_rm;
extern NSString * const TeXDistUtilityOption_dest_path;
extern NSString * const TeXDistUtilityOption_path;
extern NSString * const TeXDistUtilityOption_create_intermediates;
extern NSString * const TeXDistUtilitySubTask;

@interface NSDictionary(TeXDist)
- (void)TeXDist_writeTo_stdout;
@end
