import Editor from "./editor";
import Layer from "./layer";

/**
 * Tool super class.
 */
export default class Tool {

  editor: Editor;
  props: any;
  key: string;
  cursor: string;
  _inProgress: boolean = false;


  constructor(key, cursor) {
    this.props = {};
    this.key = key || 'tool';
    this.cursor = cursor || 'default';
  }


  getProp(key) {
    return this.props[key];
  }

  setProp(key, val) {
    this.props[key] = val;
  }

  getPropKeys() {
    return Object.keys(this.props);
  }

  cloneProps() {
    return Object.assign({}, this.props);
  }

  setEditor(editor : Editor) {
    this.editor = editor;
  }

  isActive() {
    return this.editor != null;
  }


  inProgress(evt: MouseEvent) { return this._inProgress; }

  onDragStart(evt: MouseEvent) { }
  onDragMove(evt: MouseEvent) { }
  onDragEnd(evt: MouseEvent) { }
  onmousedown(evt: MouseEvent) { }

  oncancel() { }
  ondblclick(evt: MouseEvent) { }
  onclick(evt: MouseEvent) { }
  onmouseup(evt: MouseEvent) { }
  onmousemove(evt: MouseEvent) { }
  //setOnHover(arg0: boolean) { }

  onSelect() {}

  onUnSelect() {}


}
