PHP Class gui\Application

This class is used to manipulate the application
Since: 0.1
Author: Gabriel Couto @gabrielrcouto
Mostrar archivo Open project: gabrielrcouto/php-gui Class Usage Examples

Public Properties

Property Type Description
$defaultApplication Application The application object
$process React\ChildProcess\Process The object responsible to manage the lazarus process

Protected Properties

Property Type Description
$eventHandlers array The internal array of all callbacks
$loop React\EventLoop\LoopInterface The application loop
$objectId integer The next object ID available
$objects array The internal array of all Components Objects in this application
$receiver Gui\Ipc\Receiver The responsible object to receive the communication messages
$running boolean Defines if the application is running
$sender Gui\Ipc\Sender The responsible object to sent the communication messages
$verboseLevel integer The verbose level
$window Gui\Components\Window The 1st Window of the Application

Public Methods

Method Description
__construct ( array $defaultAttributes = [], React\EventLoop\LoopInterface $loop = null ) : void The constructor method
__unset ( $objectId ) : void Unset the object referency from the stack
addObject ( Object $object ) : void Put a object to the internal objects array
alert ( mixed $message, string $title = '' ) : void Shows an alert dialog
destroyObject ( Object $object ) : void Destroy a object
fire ( string $eventName ) : void Fire an application event
getLoop ( ) : React\EventLoop\LoopInterface Get the event loop
getNextObjectId ( ) : integer Returns the next avaible object ID
getObject ( integer $id ) : Object Get a object from the internal objects array
getVerboseLevel ( ) : integer Returns the verbose level
getWindow ( ) : Window Returns the 1st Window of the Application
on ( string $eventName, callable $eventHandler ) : void Returns the next avaible object ID
ping ( ) : float Returns the communication time between php and lazarus
run ( ) : void Runs the application
sendCommand ( string $method, array $params, callable $callback ) : void Send a command
sendEvent ( string $method, array $params ) : void Send an event
setVerboseLevel ( integer $verboseLevel ) : void Set the verbose level
waitCommand ( string $method, array $params ) : mixed Send a command and wait the return

Method Details

__construct() public method

The constructor method
public __construct ( array $defaultAttributes = [], React\EventLoop\LoopInterface $loop = null ) : void
$defaultAttributes array
$loop React\EventLoop\LoopInterface
return void

__unset() public method

Unset the object referency from the stack
public __unset ( $objectId ) : void
$objectId
return void

addObject() public method

Put a object to the internal objects array
public addObject ( Object $object ) : void
$object Gui\Components\Object Component Object
return void

alert() public method

Shows an alert dialog
public alert ( mixed $message, string $title = '' ) : void
$message mixed Array or String message to display
$title string Title of the alert
return void

destroyObject() public method

Destroy a object
public destroyObject ( Object $object ) : void
$object Gui\Components\Object Component Object
return void

fire() public method

Fire an application event
public fire ( string $eventName ) : void
$eventName string Event Name
return void

getLoop() public method

Get the event loop
public getLoop ( ) : React\EventLoop\LoopInterface
return React\EventLoop\LoopInterface

getNextObjectId() public method

Returns the next avaible object ID
public getNextObjectId ( ) : integer
return integer

getObject() public method

Get a object from the internal objects array
public getObject ( integer $id ) : Object
$id integer Object ID
return Gui\Components\Object

getVerboseLevel() public method

Returns the verbose level
public getVerboseLevel ( ) : integer
return integer

getWindow() public method

Returns the 1st Window of the Application
public getWindow ( ) : Window
return Gui\Components\Window

on() public method

Returns the next avaible object ID
public on ( string $eventName, callable $eventHandler ) : void
$eventName string the name of the event
$eventHandler callable the callback
return void

ping() public method

Returns the communication time between php and lazarus
public ping ( ) : float
return float

run() public method

Runs the application
public run ( ) : void
return void

sendCommand() public method

Send a command
public sendCommand ( string $method, array $params, callable $callback ) : void
$method string the method name
$params array the method params
$callback callable the callback
return void

sendEvent() public method

Send an event
public sendEvent ( string $method, array $params ) : void
$method string the method name
$params array the method params
return void

setVerboseLevel() public method

Set the verbose level
public setVerboseLevel ( integer $verboseLevel ) : void
$verboseLevel integer
return void

waitCommand() public method

Send a command and wait the return
public waitCommand ( string $method, array $params ) : mixed
$method string the method name
$params array the method params
return mixed

Property Details

$defaultApplication public_oe static_oe property

The application object
public static Application,gui $defaultApplication
return Application

$eventHandlers protected_oe property

The internal array of all callbacks
protected array $eventHandlers
return array

$loop protected_oe property

The application loop
protected LoopInterface,React\EventLoop $loop
return React\EventLoop\LoopInterface

$objectId protected_oe property

The next object ID available
protected int $objectId
return integer

$objects protected_oe property

The internal array of all Components Objects in this application
protected array $objects
return array

$process public_oe property

The object responsible to manage the lazarus process
public Process,React\ChildProcess $process
return React\ChildProcess\Process

$receiver protected_oe property

The responsible object to receive the communication messages
protected Receiver,Gui\Ipc $receiver
return Gui\Ipc\Receiver

$running protected_oe property

Defines if the application is running
protected bool $running
return boolean

$sender protected_oe property

The responsible object to sent the communication messages
protected Sender,Gui\Ipc $sender
return Gui\Ipc\Sender

$verboseLevel protected_oe property

The verbose level
protected int $verboseLevel
return integer

$window protected_oe property

The 1st Window of the Application
protected Window,Gui\Components $window
return Gui\Components\Window