/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2003-2012, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2003-2012 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////

#ifndef _ExBaseIO_h_Included_
#define _ExBaseIO_h_Included_

#include "RxObject.h"
#include "Ed/EdUserIO.h"
#include "Ge/GePoint3d.h"


/** Description:
    This class implements the base user I/O for custom commands.
    {group:ExServices_Classes} 
    Library: Source *code* provided. 
*/
class OdEdBaseIO : public OdRxObject
{
public:
  /** Description:
    Returns user input of a string.
 
    Arguments:
    options (I) Combination of OdEd::CommonInputOptions and OdEd::GetStringOptions enum values.
    prompt (I) Prompt output before pausing for user input.
    pTracker (I) Pointer to an IO Tracker for this user input.
    
    Remarks:
    If prompt is empty, a default *prompt* is used.    
    
    This function uses the underlying OdEdBaseIO function putString for low
    level output.  
  */
  virtual OdString getString(const OdString& prompt, int options = OdEd::kInpDefault, OdEdStringTracker* pTracker = 0) = 0;

  /** Description:
    Writes the specified *string*.
    Arguments:
    string (O) Output *string*.
  */
  virtual void putString(const OdString& string) = 0;
  
  /** Description:
    Returns user input of a point.

    Arguments:
    prompt (I) Message displayed to *prompt* the user.
    options (I) Combination of OdEd::GetPointOptions enum values. 
    pTracker (I) Pointer to a User IO tracker.

    Remarks:
    This function uses the underlying OdEdBaseIO functions putString and getString for low
    level output and input.
    
    If *prompt* is an empty string, a default *prompt* string is used.  
  */
  virtual OdGePoint3d getPoint(const OdString& prompt, int options = OdEd::kInpDefault, OdEdPointTracker* pTracker = 0)
  {
    throw OdEdOtherInput(getString(prompt, OdEd::kGstDefault, 0));
  }

  enum MouseEventFlags
  {
    kLeftButtonIsDown   = 0x0001,
    kRightButtonIsDown  = 0x0002,
    kShiftIsDown        = 0x0004,
    kControlIsDown      = 0x0008,
    kMiddleButtonIsDown = 0x0010
  };

  /** Description:
  Returns combination of "MouseEventFlags" representing currently pressed functional keys
  Currently used are:
  Shift = 4 (MK_SHIFT)
  Ctrl = 8 (MK_CONTROL)
  */
  virtual OdUInt32 getKeyState() = 0;
};

#endif // _ExBaseIO_h_Included_
