//
//  WBModelSidebarController.h
//  MySQLWorkbench
//
//  Created by Alfredo Kojima on 15/Dec/08.
//  Copyright 2008 Sun Microsystems Inc. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "GRTTreeDataSource.h"
#import "MTableView.h"

namespace wb {
  class WBContextUI;
};

@class MCanvasViewer;
@class GRTTreeDataSource;
@class GRTListDataSource;
@class WBObjectDescriptionController;
@class WBObjectPropertiesController;


@interface WBModelSidebarController : NSObject<GRTDragDelegate>
{
  IBOutlet NSView *sidebarView;
  
  IBOutlet MCanvasViewer *navigatorViewer;
  
  IBOutlet NSTextField *diagramSizeText;
  
  IBOutlet NSOutlineView *catalogOutline;
  IBOutlet NSOutlineView *layerOutline;
  IBOutlet NSTableView *userTypeTable;
  
  IBOutlet GRTTreeDataSource *catalogDS;
  IBOutlet GRTTreeDataSource *layerDS;
  
  IBOutlet GRTListDataSource *userTypeDS;
  
  IBOutlet NSTableView *propertiesTable;
  
  IBOutlet MTableView *historyTable;
  IBOutlet GRTListDataSource *historyDS;
  
  IBOutlet NSButton *changeButton;
  
  IBOutlet NSSlider *zoomSlider;
  IBOutlet NSComboBox *zoomCombo;
  
  IBOutlet WBObjectDescriptionController *descriptionController;
  IBOutlet WBObjectPropertiesController* mPropertiesController;
  
  wb::WBContextUI *_wbui;
}

- (IBAction)changeDiagramSize:(id)sender;
- (IBAction)setZoom:(id)sender;
- (IBAction)activateCatalogItem:(id)sender;
- (IBAction)activateLayerItem:(id)sender;
- (IBAction)activateHistoryItem:(id)sender;

- (void)setupWithWBContextUI:(wb::WBContextUI*)wbui;
- (void)resetForNewModel;
- (NSView*)sidebar;

- (void)updateForSelectionChange;
- (void) copyHistoryToPasteboard;

- (void)refresh;
- (void)refreshInfo; 
- (void)refreshZoom;
- (void)refreshHistory;
- (void)refreshCatalogTree;
- (void)refreshLayerTree;
- (void)refreshUserTypeList;

// Access for backend callbacks.
- (NSOutlineView*) catalogOutline;
- (GRTTreeDataSource*) catalogDS;
- (NSTableView*) historyTable;
- (GRTListDataSource*) historyDS;

@end
