// File generated by CPPExt (Transient)
//
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _Message_ProgressIndicator_HeaderFile
#define _Message_ProgressIndicator_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_Message_ProgressIndicator_HeaderFile
#include <Handle_Message_ProgressIndicator.hxx>
#endif

#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Message_SequenceOfProgressScale_HeaderFile
#include <Message_SequenceOfProgressScale.hxx>
#endif
#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Handle_TCollection_HAsciiString_HeaderFile
#include <Handle_TCollection_HAsciiString.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class TCollection_HAsciiString;
class Message_ProgressScale;


//! Defines abstract interface from program to the "user". <br>
//!          That includes progress indication and user break mechanisms <br>
class Message_ProgressIndicator : public MMgt_TShared {

public:
 // Methods PUBLIC
 // 

//! Drops all scopes and sets scale from 0 to 100, step 1 <br>
//!          This scale has name "Step" <br>
Standard_EXPORT virtual  void Reset() ;

  void SetName(const Standard_CString name) ;
//! Set (optional) name for scale <br>
  void SetName(const Handle(TCollection_HAsciiString)& name) ;
//! Set range for current scale <br>
  void SetRange(const Standard_Real min,const Standard_Real max) ;
//! Set step for current scale <br>
  void SetStep(const Standard_Real step) ;
//! Set or drop infinite mode for the current scale <br>
  void SetInfinite(const Standard_Boolean isInf = Standard_True) ;

  void SetScale(const Standard_CString name,const Standard_Real min,const Standard_Real max,const Standard_Real step,const Standard_Boolean isInf = Standard_False) ;

//! Set all parameters for current scale <br>
Standard_EXPORT   void SetScale(const Standard_Real min,const Standard_Real max,const Standard_Real step,const Standard_Boolean isInf = Standard_False) ;

//! Returns all parameters for current scale <br>
Standard_EXPORT   void GetScale(Standard_Real& min,Standard_Real& max,Standard_Real& step,Standard_Boolean& isInf) const;


Standard_EXPORT   void SetValue(const Standard_Real val) ;

//! Set and get progress value at current scale <br>
//!          If the value to be set is more than currently set one, or out <br>
//!          of range for the current scale, it is limited by that range <br>
Standard_EXPORT   Standard_Real GetValue() const;

  void Increment() ;
//! Increment the progress value by the default of specified step <br>
  void Increment(const Standard_Real step) ;

  Standard_Boolean NewScope(const Standard_CString name = 0) ;

  Standard_Boolean NewScope(const Handle(TCollection_HAsciiString)& name) ;

  Standard_Boolean NewScope(const Standard_Real span,const Standard_CString name = 0) ;

//! Creates new scope on a part of a current scale from current <br>
//!          position with span either equal to default step, or specified <br>
//!          The scale for the new scope will have specified name and <br>
//!          ranged from 0 to 100 with step 1 <br>
//!          Returns False if something is wrong in arguments or in current <br>
//!          position of progress indicator; scope is opened anyway <br>
Standard_EXPORT   Standard_Boolean NewScope(const Standard_Real span,const Handle(TCollection_HAsciiString)& name) ;

//! Close the current scope and thus return to previous scale <br>
//!          Updates position to be at the end of the closing scope <br>
//!          Returns False if no scope is opened <br>
Standard_EXPORT   Standard_Boolean EndScope() ;

  Standard_Boolean NextScope(const Standard_CString name = 0) ;

//! Optimized version of { return EndScope() && NewScope(); } <br>
Standard_EXPORT   Standard_Boolean NextScope(const Standard_Real span,const Standard_CString name = 0) ;

//! Should return True if user has send a break signal. <br>
//!          Default implementation returns False. <br>
Standard_EXPORT virtual  Standard_Boolean UserBreak() ;

//! Update presentation of the progress indicator <br>
//!          Called when progress position is changed <br>
//!          Flag force is intended for forcing update in case if it is <br>
//!          optimized; all internal calls from ProgressIndicator are <br>
//!          done with this flag equal to False <br>
Standard_EXPORT virtual  Standard_Boolean Show(const Standard_Boolean force = Standard_True)  = 0;
//! Returns total progress position on the basic scale <br>
//!          ranged from 0. to 1. <br>
  Standard_Real GetPosition() const;

//! Returns current number of opened scopes <br>
//!          This number is always >=1 as top-level scale is always present <br>
Standard_EXPORT   Standard_Integer GetNbScopes() const;

//! Returns data for scale of index-th scope <br>
//!          The first scope is current one, the last is the top-level one <br>
Standard_EXPORT  const Message_ProgressScale& GetScope(const Standard_Integer index) const;
//Standard_EXPORT ~Message_ProgressIndicator();




 // Type management
 //
 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
 //Standard_EXPORT Standard_Boolean	       IsKind(const Handle(Standard_Type)&) const;

protected:

 // Methods PROTECTED
 // 

//! Constructor, just calls own Reset() (not yet redefined) <br>
Standard_EXPORT Message_ProgressIndicator();


 // Fields PROTECTED
 //


private: 

 // Methods PRIVATE
 // 


 // Fields PRIVATE
 //
Standard_Real myPosition;
Message_SequenceOfProgressScale myScopes;


};


#include <Message_ProgressIndicator.lxx>



// other Inline functions and methods (like "C++: function call" methods)
//


#endif
