Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions | Static Protected Member Functions
Zend_Pdf_Action_URI Class Reference
Inheritance diagram for Zend_Pdf_Action_URI:
Zend_Pdf_Action Zend_Pdf_Target

Public Member Functions

 __construct (Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions)
 
 setUri ($uri)
 
 getUri ()
 
 setIsMap ($isMap)
 
 getIsMap ()
 
- Public Member Functions inherited from Zend_Pdf_Action
 __construct (Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions)
 
 getResource ()
 
 dumpAction (Zend_Pdf_ElementFactory_Interface $factory, SplObjectStorage $processedActions=null)
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 
 getChildren ()
 
 hasChildren ()
 
 count ()
 
- Public Member Functions inherited from Zend_Pdf_Target
 getResource ()
 

Static Public Member Functions

static create ($uri, $isMap=false)
 
- Static Public Member Functions inherited from Zend_Pdf_Action
static load (Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions=null)
 
- Static Public Member Functions inherited from Zend_Pdf_Target
static load (Zend_Pdf_Element $resource)
 

Static Protected Member Functions

static _validateUri ($uri)
 

Additional Inherited Members

- Data Fields inherited from Zend_Pdf_Action
 $next = array()
 
- Protected Attributes inherited from Zend_Pdf_Action
 $_actionDictionary
 
 $_originalNextList
 

Detailed Description

Definition at line 44 of file URI.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Zend_Pdf_Element  $dictionary,
SplObjectStorage  $processedActions 
)

Object constructor

Parameters
Zend_Pdf_Element_Dictionary$dictionary
SplObjectStorage$processedActionslist of already processed action dictionaries, used to avoid cyclic references
Exceptions
Zend_Pdf_Exception

Definition at line 53 of file URI.php.

54  {
55  parent::__construct($dictionary, $processedActions);
56 
57  if ($dictionary->URI === null) {
58  #require_once 'Zend/Pdf/Exception.php';
59  throw new Zend_Pdf_Exception('URI action dictionary entry is required');
60  }
61  }

Member Function Documentation

◆ _validateUri()

static _validateUri (   $uri)
staticprotected

Validate URI

Parameters
string$uri
Returns
true
Exceptions
Zend_Pdf_Exception

Definition at line 70 of file URI.php.

71  {
72  $scheme = parse_url((string)$uri, PHP_URL_SCHEME);
73  if ($scheme === false || $scheme === null) {
74  #require_once 'Zend/Pdf/Exception.php';
75  throw new Zend_Pdf_Exception('Invalid URI');
76  }
77  }

◆ create()

static create (   $uri,
  $isMap = false 
)
static

Create new Zend_Pdf_Action_URI object using specified uri

Parameters
string$uriThe URI to resolve, encoded in 7-bit ASCII
boolean$isMapA flag specifying whether to track the mouse position when the URI is resolved
Returns
Zend_Pdf_Action_URI

Definition at line 86 of file URI.php.

87  {
88  self::_validateUri($uri);
89 
90  $dictionary = new Zend_Pdf_Element_Dictionary();
91  $dictionary->Type = new Zend_Pdf_Element_Name('Action');
92  $dictionary->S = new Zend_Pdf_Element_Name('URI');
93  $dictionary->Next = null;
94  $dictionary->URI = new Zend_Pdf_Element_String($uri);
95  if ($isMap) {
96  $dictionary->IsMap = new Zend_Pdf_Element_Boolean(true);
97  }
98 
99  return new Zend_Pdf_Action_URI($dictionary, new SplObjectStorage());
100  }
static _validateUri($uri)
Definition: URI.php:70

◆ getIsMap()

getIsMap ( )

Get IsMap property

If the IsMap flag is true and the user has triggered the URI action by clicking an annotation, the coordinates of the mouse position at the time the action is performed should be transformed from device space to user space and then offset relative to the upper-left corner of the annotation rectangle.

Returns
boolean

Definition at line 162 of file URI.php.

163  {
164  return $this->_actionDictionary->IsMap !== null &&
165  $this->_actionDictionary->IsMap->value;
166  }

◆ getUri()

getUri ( )

Get URI to resolve

Returns
string

Definition at line 123 of file URI.php.

124  {
125  return $this->_actionDictionary->URI->value;
126  }

◆ setIsMap()

setIsMap (   $isMap)

Set IsMap property

If the IsMap flag is true and the user has triggered the URI action by clicking an annotation, the coordinates of the mouse position at the time the action is performed should be transformed from device space to user space and then offset relative to the upper-left corner of the annotation rectangle.

Parameters
boolean$isMapA flag specifying whether to track the mouse position when the URI is resolved
Returns
Zend_Pdf_Action_URI

Definition at line 139 of file URI.php.

140  {
141  $this->_actionDictionary->touch();
142 
143  if ($isMap) {
144  $this->_actionDictionary->IsMap = new Zend_Pdf_Element_Boolean(true);
145  } else {
146  $this->_actionDictionary->IsMap = null;
147  }
148 
149  return $this;
150  }

◆ setUri()

setUri (   $uri)

Set URI to resolve

Parameters
string$uriThe uri to resolve, encoded in 7-bit ASCII.
Returns
Zend_Pdf_Action_URI

Definition at line 108 of file URI.php.

109  {
110  $this->_validateUri($uri);
111 
112  $this->_actionDictionary->touch();
113  $this->_actionDictionary->URI = new Zend_Pdf_Element_String($uri);
114 
115  return $this;
116  }
static _validateUri($uri)
Definition: URI.php:70

The documentation for this class was generated from the following file: