//
//  LCPreferencesController.h
//  LCToolkit
//
//  Created by Logan Collins on 6/16/07.
//  Copyright 2010 Logan Collins. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@class LCPreferencePane;


/* LCPreferencesController is a simple preferences window controller
 * The controller manages a series of preference panes that are displayed for the user
 */
@interface LCPreferencesController : NSWindowController <NSWindowDelegate, NSToolbarDelegate> {
@private
	NSMutableArray *preferencePaneIdentifiers;
	NSMutableDictionary *preferencePanes;
	NSMutableDictionary *toolbarItems;
	
	LCPreferencePane *currentPane;
	
	NSToolbar *toolbar;
}

// Shared global instance
+ (LCPreferencesController *)sharedController;

// Returns an array of current preference panes. Observable via KVO.
@property (readonly, retain) NSArray *preferencePanes;

// Returns the current preference pane. Observable via KVO.
@property (readonly, retain) LCPreferencePane *currentPreferencePane;

// Returns the preference pane with a specific identifier (or nil if none exists)
- (LCPreferencePane *)preferencePaneWithIdentifier:(NSString *)identifier;

// Returns the preference pane at a specific index
- (LCPreferencePane *)preferencePaneAtIndex:(NSUInteger)index;

// Insert and remove preference panes from the controller
- (void)addPreferencePane:(LCPreferencePane *)preferencePane;
- (void)insertPreferencePane:(LCPreferencePane *)preferencePane atIndex:(NSUInteger)index;
- (void)removePreferencePaneAtIndex:(NSUInteger)index;
- (void)removePreferencePane:(LCPreferencePane *)preferencePane;

// Switch to the preference pane with a specific identifier
- (void)showPreferencePaneWithIdentifier:(NSString *)identifier;

@end
