//
//  GRTShellViewController.h
//  MySQLWorkbench
//
//  Created by Alfredo Kojima on 23/Sep/08.
//  Copyright 2008 Sun Microsystems Inc. All rights reserved.
//

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

namespace bec {
  class GRTManager;
};


@interface CommandTextView : NSTextView
{
  NSMutableCharacterSet *mTokenCharSet;
}
@end


@interface GRTShellViewController : NSResponder
{
  IBOutlet NSTextView *shellText;
  IBOutlet NSTextField *shellPrompt;
  IBOutlet CommandTextView *shellCommand;
  
  IBOutlet NSView *sidebarView;
  
  IBOutlet NSOutlineView *globalsOutline;
  IBOutlet NSOutlineView *classesOutline;
  IBOutlet NSOutlineView *modulesOutline;
  IBOutlet NSTableView *inspectorTable;
  
  IBOutlet NSTextField *pathText;
  IBOutlet NSTextView *classText;
  IBOutlet NSTextView *moduleText;
  
  IBOutlet NSComboBox *globalsPathCombo;
  
  IBOutlet GRTTreeDataSource *globalsDS;
  IBOutlet GRTTreeDataSource *classesDS;
  IBOutlet GRTTreeDataSource *modulesDS;
  IBOutlet GRTListDataSource *inspectorDS;

  bec::GRTManager *_grtm;
  NSTimeInterval _lastShortcutEventTime;
  BOOL _promptPrinted;
}

- (void)refresh;

- (void)nextShellCommand:(NSString*)prompt;

- (void)writeLine:(NSString*)text;
- (void)write:(NSString*)text;

- (void)setupWithGRTManager:(bec::GRTManager*)grtm;
- (void)handleGRTMessage:(const grt::Message*)msg;

- (NSView*)sidebar;

@end
