HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]

Class: HTML_Progress

Source Location: /Progress.php

Class Overview


HTML loading bar with only PHP and JS interface.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 The PHP Group

Methods


Inherited Variables

Inherited Methods


Class Details

[line 213]
HTML loading bar with only PHP and JS interface.

The HTML_Progress class allow you to add a loading bar to any of your xhtml document. You should have a browser that accept DHTML feature.




Tags:

link:  http://pear.php.net/package/HTML_Progress
since:  Class available since Release 1.0
version:  Release: @package_version@
license:  PHP License 3.0
copyright:  1997-2005 The PHP Group
author:  Laurent Laville <mailto:pear@laurent-laville.org>


[ Top ]


Class Methods


constructor HTML_Progress [line 388]

HTML_Progress HTML_Progress( object $model, int $orient, int $min, int $max, array $errorPrefs)

Constructor Summary

  • Creates a natural horizontal progress bar that displays ten cells/units with no border and no progress string. The initial and minimum values are 0, and the maximum is 100.

    1 $bar = new HTML_Progress();
  • Creates a natural progress bar with the specified orientation, which can be either HTML_PROGRESS_BAR_HORIZONTAL or HTML_PROGRESS_BAR_VERTICAL By default, no border and no progress string are painted. The initial and minimum values are 0, and the maximum is 100.

    1 $bar = new HTML_Progress($orient);
  • Creates a natural horizontal progress bar with the specified minimum and maximum. Sets the initial value of the progress bar to the specified minimum, and the maximum that the progress bar can reach. By default, no border and no progress string are painted.

    1 $bar = new HTML_Progress($min, $max);
  • Creates a natural horizontal progress bar with the specified orientation, minimum and maximum. Sets the initial value of the progress bar to the specified minimum, and the maximum that the progress bar can reach. By default, no border and no progress string are painted.

    1 $bar = new HTML_Progress($orient, $min, $max);
  • Creates a natural horizontal progress that uses the specified model to hold the progress bar's data. By default, no border and no progress string are painted.

    1 $bar = new HTML_Progress($model);




Tags:



Parameters:

object   $model   (optional) Model that hold the progress bar's data
int   $orient   (optional) Orientation of progress bar
int   $min   (optional) Minimum value of progress bar
int   $max   (optional) Maximum value of progress bar
array   $errorPrefs   (optional) Always last argument of class constructor. hash of params to configure PEAR_ErrorStack and loggers

[ Top ]

method addListener [line 1488]

boolean addListener( object $observer)

Adds a HTML_Progress_Observer instance to the list of observers that are listening for messages emitted by this HTML_Progress instance.



Tags:

return:  True if the observer is successfully attached.
see:  HTML_Progress::getListeners(), HTML_Progress::removeListener()
access:  public
since:  1.0


Parameters:

object   $observer   The HTML_Progress_Observer instance to attach as a listener.

[ Top ]

method apiVersion [line 497]

float apiVersion( )

Returns the current API version



Tags:

access:  public
since:  0.1


[ Top ]

method display [line 1278]

void display( )

Renders the new value of progress bar.



Tags:

access:  public
since:  0.2


[ Top ]

method getAnimSpeed [line 1043]

integer getAnimSpeed( )

Returns delay execution of the progress bar



Tags:

see:  HTML_Progress::setAnimSpeed()
access:  public
since:  1.2.0RC1


[ Top ]

method getDM [line 667]

object &getDM( )

Returns the data model used by this progress bar.



Tags:

see:  HTML_Progress::setDM()
access:  public
since:  1.0


[ Top ]

method getError [line 2234]

false|array getError( )

Pop an error off of the HTML_Progress stack



Tags:

see:  HTML_Progress::hasErrors(), HTML_Progress::raiseError()
static:  
access:  public
since:  1.2.0RC3


[ Top ]

method getIdent [line 1440]

string getIdent( )

Returns the current identification string.



Tags:

return:  current Progress instance's identification string
see:  HTML_Progress::setIdent()
access:  public
since:  1.0


[ Top ]

method getIncrement [line 793]

integer getIncrement( )

Returns the progress bar's increment value stored in the progress bar's data model.

The default value is +1.




Tags:

see:  HTML_Progress::setIncrement(), HTML_Progress_DM::getIncrement()
access:  public
since:  1.0


[ Top ]

method getListeners [line 1471]

array getListeners( )

Returns an array of all the listeners added to this progress bar.



Tags:

see:  HTML_Progress::addListener(), HTML_Progress::removeListener()
access:  public
since:  1.0


[ Top ]

method getMaximum [line 754]

integer getMaximum( )

Returns the progress bar's maximum value stored in the progress bar's data model.

The default value is 100.




Tags:

see:  HTML_Progress::setMaximum(), HTML_Progress_DM::getMaximum()
access:  public
since:  1.0


[ Top ]

method getMinimum [line 715]

integer getMinimum( )

Returns the progress bar's minimum value stored in the progress bar's data model.

The default value is 0.




Tags:

see:  HTML_Progress::setMinimum(), HTML_Progress_DM::getMinimum()
access:  public
since:  1.0


[ Top ]

method getPercentComplete [line 883]

mixed getPercentComplete( [boolean $float = true])

Returns the percent complete for the progress bar. Note that this number is between 0.00 and 1.00 or 0 and 100.



Tags:



Parameters:

boolean   $float   (optional) float or integer format

[ Top ]

method getScript [line 1115]

string getScript( )

Get the javascript code to manage progress bar.



Tags:

return:  JavaScript URL or inline code to manage progress bar
see:  HTML_Progress_UI::getScript()
access:  public
since:  1.0


[ Top ]

method getString [line 631]

string getString( )

Returns the current value of the progress string.

By default, the progress bar displays the value returned by getPercentComplete() method formatted as a percent such as 33%.




Tags:

see:  HTML_Progress::setString(), HTML_Progress::isStringPainted()
access:  public
since:  1.0


[ Top ]

method getStyle [line 1093]

string getStyle( )

Get the cascading style sheet to put inline on HTML document



Tags:

see:  HTML_Progress_UI::getStyle()
access:  public
since:  1.0


[ Top ]

method getUI [line 896]

object &getUI( )

Returns the look-and-feel object that renders the progress bar.



Tags:

see:  HTML_Progress::setUI()
access:  public
since:  1.0


[ Top ]

method getValue [line 826]

integer getValue( )

Returns the progress bar's current value, which is stored in the progress bar's data model. The value is always between the minimum and maximum values, inclusive.

By default, the value is initialized to be equal to the minimum value.




Tags:



[ Top ]

method hasErrors [line 2220]

integer hasErrors( )

Determine whether there are errors into the HTML_Progress stack



Tags:

see:  HTML_Progress::getError(), HTML_Progress::raiseError()
static:  
access:  public
since:  1.2.0RC3


[ Top ]

method hide [line 1324]

void hide( )

Hides the progress bar.



Tags:

access:  public
since:  1.2.0RC3


[ Top ]

method incValue [line 865]

void incValue( )

Updates the progress bar's current value by adding increment value.

All change listeners are notified.




Tags:



[ Top ]

method isBorderPainted [line 551]

boolean isBorderPainted( )

Determines whether the progress bar border is painted or not.

The default is false.




Tags:

see:  HTML_Progress::setBorderPainted()
access:  public
since:  1.0


[ Top ]

method isIndeterminate [line 510]

boolean isIndeterminate( )

Returns mode of the progress bar (determinate or not).



Tags:

see:  HTML_Progress::setIndeterminate()
access:  public
since:  1.0


[ Top ]

method isStringPainted [line 592]

boolean isStringPainted( )

Determines whether the progress bar string is painted or not.

The default is false. The progress bar displays the value returned by getPercentComplete() method formatted as a percent such as 33%.




Tags:

see:  HTML_Progress::setStringPainted(), HTML_Progress::setString()
access:  public
since:  1.0


[ Top ]

method process [line 1396]

void process( )

Performs the progress actions



Tags:

see:  HTML_Progress::sleep()
access:  public
since:  1.2.0RC3


[ Top ]

method raiseError [line 2151]

NULL|PEAR_Error raiseError( integer $code, string $level, array $params)

Add an error to the stack



Tags:

return:  PEAR_Error instance, with context info if PHP 4.3.0+
see:  HTML_Progress::hasErrors(), HTML_Progress::getError()
static:  
access:  public
since:  1.2.0RC1


Parameters:

integer   $code   Error code.
string   $level   The error level of the message.
array   $params   Associative array of error parameters

[ Top ]

method removeListener [line 1509]

boolean removeListener( object $observer)

Removes a HTML_Progress_Observer instance from the list of observers.



Tags:

return:  True if the observer is successfully detached.
see:  HTML_Progress::getListeners(), HTML_Progress::addListener()
access:  public
since:  1.0


Parameters:

object   $observer   The HTML_Progress_Observer instance to detach from the list of listeners.

[ Top ]

method run [line 1416]

void run( )

Runs the progress bar (both modes: indeterminate and determinate), and execute all actions defined in user callback identified by method setProgressHandler.



Tags:

see:  HTML_Progress::process(), HTML_Progress::setProgressHandler()
access:  public
since:  1.2.0RC3


[ Top ]

method setAnimSpeed [line 1059]

void setAnimSpeed( integer $delay)

Set the delays progress bar execution for the given number of miliseconds.



Tags:

see:  HTML_Progress::getAnimSpeed()
throws:  HTML_PROGRESS_ERROR_INVALID_INPUT
access:  public
since:  1.1


Parameters:

integer   $delay   Delay in milisecond.

[ Top ]

method setBorderPainted [line 568]

void setBorderPainted( boolean $paint)

Sets the value of $_paintBorder property, which determines whether the progress bar should paint its border. The default is false.



Tags:

see:  HTML_Progress::isBorderPainted()
throws:  HTML_PROGRESS_ERROR_INVALID_INPUT
access:  public
since:  1.0


Parameters:

boolean   $paint   whether the progress bar should paint its border

[ Top ]

method setDM [line 683]

void setDM( string $model)

Sets the data model used by this progress bar.



Tags:

see:  HTML_Progress::getDM()
throws:  HTML_PROGRESS_ERROR_INVALID_INPUT
access:  public
since:  1.0


Parameters:

string   $model   class name of a html_progress_dm extends object

[ Top ]

method setIdent [line 1454]

void setIdent( [mixed $ident = null])

Sets this Progress instance's identification string.



Tags:

see:  HTML_Progress::getIdent()
access:  public
since:  1.0


Parameters:

mixed   $ident   (optional) the new identification string.

[ Top ]

method setIncrement [line 809]

void setIncrement( integer $inc)

Sets the progress bar's increment value stored in the progress bar's data model.



Tags:

see:  HTML_Progress::getIncrement(), HTML_Progress_DM::setIncrement()
access:  public
since:  1.0


Parameters:

integer   $inc   progress bar's increment value

[ Top ]

method setIndeterminate [line 530]

void setIndeterminate( boolean $continuous)

Sets the $_indeterminate property of the progress bar, which determines whether the progress bar is in determinate or indeterminate mode.

An indeterminate progress bar continuously displays animation indicating that an operation of unknown length is occuring. By default, this property is false.




Tags:

see:  HTML_Progress::isIndeterminate()
throws:  HTML_PROGRESS_ERROR_INVALID_INPUT
access:  public
since:  1.0


Parameters:

boolean   $continuous   whether countinuously displays animation

[ Top ]

method setMaximum [line 772]

void setMaximum( integer $max)

Sets the progress bar's maximum value stored in the progress bar's data model.

If the maximum value is different from previous maximum, all change listeners are notified.




Tags:

see:  HTML_Progress::getMaximum(), HTML_Progress_DM::setMaximum()
access:  public
since:  1.0


Parameters:

integer   $max   progress bar's maximal value

[ Top ]

method setMinimum [line 733]

void setMinimum( integer $min)

Sets the progress bar's minimum value stored in the progress bar's data model.

If the minimum value is different from previous minimum, all change listeners are notified.




Tags:

see:  HTML_Progress::getMinimum(), HTML_Progress_DM::setMinimum()
access:  public
since:  1.0


Parameters:

integer   $min   progress bar's minimal value

[ Top ]

method setModel [line 946]

void setModel( string $file, string $type)

Sets the look-and-feel model that renders the progress bar.



Tags:

see:  HTML_Progress::setUI()
throws:  HTML_PROGRESS_ERROR_INVALID_INPUT
access:  public
since:  1.0


Parameters:

string   $file   file name of model properties
string   $type   type of external ressource (phpArray, iniFile, XML ...)

[ Top ]

method setProgressHandler [line 1376]

void setProgressHandler( mixed $handler)

Sets the user callback function that execute all actions pending progress



Tags:

see:  HTML_Progress::process()
throws:  HTML_PROGRESS_ERROR_INVALID_CALLBACK
access:  public
since:  1.2.0RC3


Parameters:

mixed   $handler   Name of function or a class-method.

[ Top ]

method setString [line 654]

void setString( string $str)

Sets the current value of the progress string. By default, this string is null. If you have provided a custom progress string and want to revert to the built-in-behavior, set the string back to null.

The progress string is painted only if the isStringPainted() method returns true.




Tags:



Parameters:

string   $str   progress string

[ Top ]

method setStringPainted [line 609]

void setStringPainted( boolean $paint)

Sets the value of $_paintString property, which determines whether the progress bar should render a progress string. The default is false.



Tags:

see:  HTML_Progress::isStringPainted(), HTML_Progress::setString()
throws:  HTML_PROGRESS_ERROR_INVALID_INPUT
access:  public
since:  1.0


Parameters:

boolean   $paint   whether the progress bar should render a string

[ Top ]

method setUI [line 912]

void setUI( string $ui)

Sets the look-and-feel object that renders the progress bar.



Tags:

see:  HTML_Progress::getUI()
throws:  HTML_PROGRESS_ERROR_INVALID_INPUT
access:  public
since:  1.0


Parameters:

string   $ui   class name of a html_progress_ui extends object

[ Top ]

method setValue [line 844]

void setValue( integer $val)

Sets the progress bar's current value stored in the progress bar's data model.

If the new value is different from previous value, all change listeners are notified.




Tags:



Parameters:

integer   $val   progress bar's current value

[ Top ]

method sleep [line 1353]

void sleep( )

Default user callback when none are defined.

Delay execution of progress meter for the given number of milliseconds.

NOTE: The function http://www.php.net/manual/en/function.usleep.php did not work on Windows systems until PHP 5.0.0




Tags:



[ Top ]

method toArray [line 1129]

array toArray( )

Returns the progress bar structure in an array.



Tags:

return:  of progress bar properties
access:  public
since:  1.0


[ Top ]

method toHtml [line 1167]

string toHtml( )

Returns the progress structure as HTML.



Tags:

return:  HTML Progress bar
access:  public
since:  0.2


[ Top ]


Documentation generated on Sun, 25 Sep 2005 17:25:39 +0200 by phpDocumentor 1.2.3