11cb0ef41Sopenharmony_ci// Copyright 2015 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciimport { GNode } from "./node";
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciexport abstract class View {
81cb0ef41Sopenharmony_ci  protected container: HTMLElement;
91cb0ef41Sopenharmony_ci  protected divNode: HTMLElement;
101cb0ef41Sopenharmony_ci  protected abstract createViewElement(): HTMLElement;
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci  constructor(idOrContainer: string | HTMLElement) {
131cb0ef41Sopenharmony_ci    this.container = typeof idOrContainer == "string" ? document.getElementById(idOrContainer) : idOrContainer;
141cb0ef41Sopenharmony_ci    this.divNode = this.createViewElement();
151cb0ef41Sopenharmony_ci  }
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ci  public show(): void {
181cb0ef41Sopenharmony_ci    this.container.appendChild(this.divNode);
191cb0ef41Sopenharmony_ci  }
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci  public hide(): void {
221cb0ef41Sopenharmony_ci    this.container.removeChild(this.divNode);
231cb0ef41Sopenharmony_ci  }
241cb0ef41Sopenharmony_ci}
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_ciexport abstract class PhaseView extends View {
271cb0ef41Sopenharmony_ci  public abstract initializeContent(data: any, rememberedSelection: Map<string, GNode>): void;
281cb0ef41Sopenharmony_ci  public abstract detachSelection(): Map<string, GNode>;
291cb0ef41Sopenharmony_ci  public abstract onresize(): void;
301cb0ef41Sopenharmony_ci  public abstract searchInputAction(searchInput: HTMLInputElement, e: Event, onlyVisible: boolean): void;
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci  constructor(idOrContainer: string | HTMLElement) {
331cb0ef41Sopenharmony_ci    super(idOrContainer);
341cb0ef41Sopenharmony_ci  }
351cb0ef41Sopenharmony_ci}
36