Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
TextEditPlus Step 2/EncodingManager.h
#import <Foundation/Foundation.h> |
enum { |
NoStringEncoding = 0xFFFFFFFF |
}; |
@interface EncodingPopUpButton : NSPopUpButton { |
NSStringEncoding defaultEncoding; |
BOOL hasDefaultEntry; |
} |
- (void)setEncoding:(NSStringEncoding)encoding defaultEntry:(BOOL)flag; |
@end |
@interface EncodingManager : NSObject { |
@private |
IBOutlet NSMatrix *encodingMatrix; |
NSArray *encodings; |
} |
/* There is just one instance... |
*/ |
+ (EncodingManager *)sharedInstance; |
/* List of encodings that should be shown in encoding lists |
*/ |
- (NSArray *)enabledEncodings; |
/* Empties then initializes the supplied popup with the supported encodings. |
*/ |
- (void)setupPopUp:(EncodingPopUpButton *)button selectedEncoding:(unsigned)selectedEncoding withDefaultEntry:(BOOL)flag; |
/* Action methods for bringing up and dealing with changes in the encodings list panel |
*/ |
- (IBAction)showPanel:(id)sender; |
- (IBAction)encodingListChanged:(id)sender; |
- (IBAction)clearAll:(id)sender; |
- (IBAction)selectAll:(id)sender; |
- (IBAction)revertToDefault:(id)sender; |
/* Internal method to save and communicate changes to the encoding list |
*/ |
- (void)noteEncodingListChange:(BOOL)writeDefault updateList:(BOOL)updateList postNotification:(BOOL)post; |
@end |
Copyright © 2006 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2006-07-28