//
//  IDEUserDefaults.h
//  IDE
//
//  Created by Todd Ditchendorf on 11/11/10.
//  Copyright 2010 Todd Ditchendorf. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#define kIDETabsViewPlacementKey @"IDETabsViewPlacement"
#define kIDELibraryViewPlacementKey @"IDELibraryViewPlacement"
#define kIDEOutlineViewPlacementKey @"IDEOutlineViewPlacement"
#define kIDEInspectorViewPlacementKey @"IDEInspectorViewPlacement"
#define kIDETimelineViewPlacementKey @"IDETimelineViewPlacement"
#define kIDELogViewPlacementKey @"IDELogViewPlacement"

#define kIDETabsPanelVisibleKey @"IDETabsPanelVisible"
#define kIDELibraryPanelVisibleKey @"IDELibraryPanelVisible"
#define kIDEOutlinePanelVisibleKey @"IDEOutlinePanelVisible"
#define kIDEInspectorPanelVisibleKey @"IDEInspectorPanelVisible"
#define kIDETimelinePanelVisibleKey @"IDETimelinePanelVisible"
#define kIDELogPanelVisibleKey @"IDELogPanelVisible"

typedef enum {
    IDEViewPlacementPanel = 0,
    IDEViewPlacementInnerLeftTopEdge = 1,
    IDEViewPlacementInnerLeftBottomEdge = 2,
    IDEViewPlacementInnerRightTopEdge = 3,
    IDEViewPlacementInnerRightBottomEdge = 4,
    IDEViewPlacementInnerTopEdge = 5,
    IDEViewPlacementInnerBottomEdge = 6,
    IDEViewPlacementOuterLeftTopEdge = 7,
    IDEViewPlacementOuterLeftBottomEdge = 8,
    IDEViewPlacementOuterRightTopEdge = 9,
    IDEViewPlacementOuterRightBottomEdge = 10,
    IDEViewPlacementOuterTopEdge = 11,
    IDEViewPlacementOuterBottomEdge = 12,
    IDEViewPlacementFullScreenLeftTopEdge = 13,
    IDEViewPlacementFullScreenLeftBottomEdge = 14,
    IDEViewPlacementFullScreenRightTopEdge = 15,
    IDEViewPlacementFullScreenRightBottomEdge = 16,
    IDEViewPlacementFullScreenTopEdge = 17,
    IDEViewPlacementFullScreenBottomEdge = 18,
} IDEViewPlacement;

BOOL IDEViewPlacementIsPortrait(IDEViewPlacement place);
BOOL IDEViewPlacementIsLandscape(IDEViewPlacement place);

extern NSString *const IDETabsViewPlacementWillChangeNotification;
extern NSString *const IDELibraryViewPlacementWillChangeNotification;
extern NSString *const IDEOutlineViewPlacementWillChangeNotification;
extern NSString *const IDEInspectorViewPlacementWillChangeNotification;
extern NSString *const IDETimelineViewPlacementWillChangeNotification;
extern NSString *const IDELogViewPlacementWillChangeNotification;

extern NSString *const IDETabsViewPlacementDidChangeNotification;
extern NSString *const IDELibraryViewPlacementDidChangeNotification;
extern NSString *const IDEOutlineViewPlacementDidChangeNotification;
extern NSString *const IDEInspectorViewPlacementDidChangeNotification;
extern NSString *const IDETimelineViewPlacementDidChangeNotification;
extern NSString *const IDELogViewPlacementDidChangeNotification;

extern NSString *const kIDEViewPlacementOldValueKey;
extern NSString *const kIDEViewPlacementNewValueKey;

@interface NSObject (IDENotifications)
- (void)tabsViewPlacementWillChange:(NSNotification *)n;
- (void)libraryViewPlacementWillChange:(NSNotification *)n;
- (void)outlineViewPlacementWillChange:(NSNotification *)n;
- (void)inspectorViewPlacementWillChange:(NSNotification *)n;
- (void)timelineViewPlacementWillChange:(NSNotification *)n;
- (void)logViewPlacementWillChange:(NSNotification *)n;

- (void)tabsViewPlacementDidChange:(NSNotification *)n;
- (void)libraryViewPlacementDidChange:(NSNotification *)n;
- (void)outlineViewPlacementDidChange:(NSNotification *)n;
- (void)inspectorViewPlacementDidChange:(NSNotification *)n;
- (void)timelineViewPlacementDidChange:(NSNotification *)n;
- (void)logViewPlacementDidChange:(NSNotification *)n;
@end

@interface IDEUserDefaults : NSObject {
    
}

+ (id)instance;

@property (nonatomic, copy, readonly) NSDictionary *paletteViewControllerClassNameDictionary;

@property (nonatomic, assign) IDEViewPlacement tabsViewPlacement;
@property (nonatomic, assign) IDEViewPlacement libraryViewPlacement;
@property (nonatomic, assign) IDEViewPlacement outlineViewPlacement;
@property (nonatomic, assign) IDEViewPlacement inspectorViewPlacement;
@property (nonatomic, assign) IDEViewPlacement timelineViewPlacement;
@property (nonatomic, assign) IDEViewPlacement logViewPlacement;

@property (nonatomic, assign, getter=isTabsPanelVisible) BOOL tabsPanelVisible;
@property (nonatomic, assign, getter=isLibraryPanelVisible) BOOL libraryPanelVisible;
@property (nonatomic, assign, getter=isOutlinePanelVisible) BOOL outlinePanelVisible;
@property (nonatomic, assign, getter=isInspectorPanelVisible) BOOL inspectorPanelVisible;
@property (nonatomic, assign, getter=isTimelinePanelVisible) BOOL timelinePanelVisible;
@property (nonatomic, assign, getter=isLogPanelVisible) BOOL logPanelVisible;
@end
