3 * This class represents a sinlge caption and all the allowed features (time, text styles, etc.)
\r
11 public $textStyles = array(); //
\r
14 * Class Constructor:
\r
15 * @param String $theInTime
\r
16 * @param String $theOutTime
\r
17 * @param String $theCaption
\r
18 * @param Array $theTextStyles as a reference
\r
21 function __construct($theInTime, $theOutTime, $theCaption,$theTextStyles)
\r
23 $this->inTime = $theInTime;
\r
24 $this->outTime = $theOutTime;
\r
25 $this->caption = $theCaption;
\r
26 $this->textStyles= $theTextStyles;
\r
27 } // __construct() end
\r
32 * Sets value of caption IN time
\r
33 * @param String $theInTime
\r
36 public function setInTime($theInTime)
\r
38 $this->inTime = $theInTime;
\r
42 * Sets value of caption OUT time
\r
43 * @param String $theOutTime
\r
46 public function setOutTime($theOutTime)
\r
48 $this->outTime = $theOutTime;
\r
52 * Sets value of a caption (multiple lines allowed)
\r
53 * @param String $theCaption
\r
56 public function setCaption($theCaption)
\r
58 $this->caption = $theCaption;
\r
62 * Sets value of Caption text style attribute
\r
63 * @param String $theAtt Attribute name
\r
64 * @param String $theValue Attribute Value
\r
66 public function setTextAtribute($theAtt,$theValue)
\r
68 $this->textStyles[$theAtt]=$theValue;
\r
74 * Gets value of Caption IN Time
\r
75 * @return String inTime Caption
\r
77 public function getInTime()
\r
79 return $this->inTime;
\r
83 * Gets value of Caption OUT Time
\r
84 * @return String outTime Caption
\r
86 public function getOutTime()
\r
88 return $this->outTime;
\r
93 * Gets value of Caption text
\r
94 * @return String inTime Caption text
\r
96 public function getCaption()
\r
98 return $this->caption;
\r
102 * Gets text style array
\r
103 * @return Array $theTextStyles Txt Styles Array
\r
105 public function getTextStyles()
\r
107 return $this->textStyles;
\r
112 * Gets value of Caption text style attribute
\r
113 * @param String $theAtt Attribute name
\r
114 * @return String $Value Attribute Value
\r
116 public function getTextAtribute($theAtt)
\r
118 return $this->textStyles[$theAtt];
\r
122 * Print all values of the Caption as a String
\r
124 public function toString()
\r
126 echo "<br/><b>In Time: </b>". $this->getInTime()."";
\r
127 echo "<br/><b>Out Time: </b>". $this->getOutTime()."";
\r
128 echo "<br/><b>Caption: </b>". $this->getCaption()."";
\r
130 if (count($this->textStyles!=0))
\r
132 if (count($this->textStyles)==0)
\r
134 //echo '<br/>----(NO text styles found)';
\r
137 echo '<br/><b>------[Caption] Styles: </b>';
\r
139 // Display all text attributes in the caption
\r
140 foreach ($this->textStyles as $styleName=>$styleValue)
\r
142 echo '<br/> -----'.$styleName.' = '.$styleValue;
\r
148 }// toString() end
\r
150 // return this caption object
\r
151 public function getThisCaption()
\r
155 } // end class Caption
\r