NSSpellChecker: add missing definitions

Add definitions for the NSCorrectionResponse enum for increased
compatibility, as well as some spell checking notification constants.
This commit is contained in:
Daniel Ferreira 2017-08-15 11:49:11 +10:00 committed by Ivan Vučica
parent 4f4db46c87
commit 9ce55e08ca
2 changed files with 30 additions and 0 deletions

View file

@ -128,5 +128,26 @@ enum
- (void)updateSpellingPanelWithMisspelledWord:(NSString *)word;
@end
typedef NSInteger NSCorrectionResponse;
enum
{
NSCorrectionResponseNone,
NSCorrectionResponseAccepted,
NSCorrectionResponseRejected,
NSCorrectionResponseIgnored,
NSCorrectionResponseEdited,
NSCorrectionResponseReverted
};
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
APPKIT_EXTERN NSString *NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification;
APPKIT_EXTERN NSString *NSSpellCheckerDidChangeAutomaticTextReplacementNotification;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
APPKIT_EXTERN NSString *NSSpellCheckerDidChangeAutomaticQuoteSubstitutionNotification;
APPKIT_EXTERN NSString *NSSpellCheckerDidChangeAutomaticDashSubstitutionNotification;
#endif
#endif // _GNUstep_H_NSSpellChecker

View file

@ -620,6 +620,15 @@ NSString *NSSpellingStateAttributeName = @"NSSpellingState";
const unsigned NSSpellingStateSpellingFlag = 1;
const unsigned NSSpellingStateGrammarFlag = 2;
NSString *NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification =
@"NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification";
NSString *NSSpellCheckerDidChangeAutomaticTextReplacementNotification =
@"NSSpellCheckerDidChangeAutomaticTextReplacementNotification";
NSString *NSSpellCheckerDidChangeAutomaticQuoteSubstitutionNotification =
@"NSSpellCheckerDidChangeAutomaticQuoteSubstitutionNotification";
NSString *NSSpellCheckerDidChangeAutomaticDashSubstitutionNotification =
@"NSSpellCheckerDidChangeAutomaticDashSubstitutionNotification";
NSString *NSPlainTextDocumentType = @"NSPlainText";
NSString *NSRTFTextDocumentType = @"NSRTF";