Listing of Source ../source/GOF/GofHostFieldIdentifier.java
package se.entra.phantom.server;

import java.util.Vector;

/**
 * This interface must be implemented by classes that are used to create logical host fields, 
 * called GofHostFields, from a screen's host fields. This makes it possible to split original 
 * host fields into two or more logical host fields, which might simplify the identification 
 * of controls.
 * <p>
 * This might be done when a host field wraps from one line to another line, or when several 
 * uneditable list cells are included in one single host field, as is normal on main frames.
 * @author J. Bergström
 */
public interface GofHostFieldIdentifier
{
  /**
   * Constant for specifying a flow layout.
   */
  public static final int FLOW_LAYOUT = 1;

  /**
   * This method must create the GofHostFields from the HostScreen's HostFields. It is up this 
   * method to decide if a HostField should be split up to several GofHostFields. The newly 
   * created GofHostFields must be stored internally in the class, since the method GetHostFields 
   * must be able to return them.
   * @param screen The host screen to process.
   */
  public void identifyHostFields( HostScreen screen );

  /**
   * This method must store a flag indicating what should be done with GofHostFields that are partially 
   * inside, partially outside the area that should be identified. This flag is only meaningful when a 
   * part of the whole screen will be identified.
   * @param flag The value of the flag.
   */
  public void doIdentifyPartialFields( boolean flag );

  /**
   * This method queries if partial fields are identified when GofHostFields that are partially 
   * inside, partially outside the area that should be identified. The returned value is only meaningful 
   * when a part of the whole screen will be identified.
   * @return <code>true</code> if partial fields are identified, <code>false</code> otherwise.
   */
  public boolean isPartialFieldsIdentified( );

  /** 
   * This method retrieves the GofHostFields created in the identifyHostFields method. It should take in 
   * account the value of the flag that was set in the doIdentifyPartialFields method.
   * @param x The start column.
   * @param y The start row.
   * @param w The width.
   * @param h The height.
   * @return The logical host fields.
   */
  public Vector<GofHostField> getHostFields( int x, int y, int w, int h );

  /** 
   * This method retrieves the GofHostFields created in the identifyHostFields method, that are inside 
   * a popup window. It should ignore the value of the flag that was set in the doIdentifyPartialFields 
   * method, since this should only be valid for complete screens.
   * @param x The start column.
   * @param y The start row.
   * @param w The width.
   * @param h The height.
   * @return The logical host fields.
   */
  public Vector<GofHostField> getPopupWindowHostFields( int x, int y, int w, int h );
}