source: trunk/www.guidonia.net/wp/wp-content/plugins/webtv/Drivers/Zend/Gdata/Exif/Extension/Tags.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 16.4 KB
Line 
1<?php
2
3/**
4 * Zend Framework
5 *
6 * LICENSE
7 *
8 * This source file is subject to the new BSD license that is bundled
9 * with this package in the file LICENSE.txt.
10 * It is also available through the world-wide-web at this URL:
11 * http://framework.zend.com/license/new-bsd
12 * If you did not receive a copy of the license and are unable to
13 * obtain it through the world-wide-web, please send an email
14 * to license@zend.com so we can send you a copy immediately.
15 *
16 * @category Zend
17 * @package Zend_Gdata
18 * @subpackage Exif
19 * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 */
22
23/**
24 * @see Zend_Gdata_Extension
25 */
26require_once 'Zend/Gdata/Extension.php';
27
28/**
29 * @see Zend_Gdata_Exif
30 */
31require_once 'Zend/Gdata/Exif.php';
32
33/**
34 * @see Zend_Gdata_Exif_Extension_Distance
35 */
36require_once 'Zend/Gdata/Exif/Extension/Distance.php';
37
38/**
39 * @see Zend_Gdata_Exif_Extension_Exposure
40 */
41require_once 'Zend/Gdata/Exif/Extension/Exposure.php';
42
43/**
44 * @see Zend_Gdata_Exif_Extension_Flash
45 */
46require_once 'Zend/Gdata/Exif/Extension/Flash.php';
47
48/**
49 * @see Zend_Gdata_Exif_Extension_FocalLength
50 */
51require_once 'Zend/Gdata/Exif/Extension/FocalLength.php';
52
53/**
54 * @see Zend_Gdata_Exif_Extension_FStop
55 */
56require_once 'Zend/Gdata/Exif/Extension/FStop.php';
57
58/**
59 * @see Zend_Gdata_Exif_Extension_ImageUniqueId
60 */
61require_once 'Zend/Gdata/Exif/Extension/ImageUniqueId.php';
62
63/**
64 * @see Zend_Gdata_Exif_Extension_Iso
65 */
66require_once 'Zend/Gdata/Exif/Extension/Iso.php';
67
68/**
69 * @see Zend_Gdata_Exif_Extension_Make
70 */
71require_once 'Zend/Gdata/Exif/Extension/Make.php';
72
73/**
74 * @see Zend_Gdata_Exif_Extension_Model
75 */
76require_once 'Zend/Gdata/Exif/Extension/Model.php';
77
78/**
79 * @see Zend_Gdata_Exif_Extension_Time
80 */
81require_once 'Zend/Gdata/Exif/Extension/Time.php';
82
83/**
84 * Represents the exif:tags element used by the Gdata Exif extensions.
85 *
86 * @category Zend
87 * @package Zend_Gdata
88 * @subpackage Exif
89 * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
90 * @license http://framework.zend.com/license/new-bsd New BSD License
91 */
92class Zend_Gdata_Exif_Extension_Tags extends Zend_Gdata_Extension
93{
94
95 protected $_rootNamespace = 'exif';
96 protected $_rootElement = 'tags';
97
98 /**
99 * exif:distance value
100 *
101 * @var Zend_Gdata_Exif_Extension_Distance
102 */
103 protected $_distance = null;
104
105 /**
106 * exif:exposure value
107 *
108 * @var Zend_Gdata_Exif_Extension_Exposure
109 */
110 protected $_exposure = null;
111
112 /**
113 * exif:flash value
114 *
115 * @var Zend_Gdata_Exif_Extension_Flash
116 */
117 protected $_flash = null;
118
119 /**
120 * exif:focalLength value
121 *
122 * @var Zend_Gdata_Exif_Extension_FocalLength
123 */
124 protected $_focalLength = null;
125
126 /**
127 * exif:fStop value
128 *
129 * @var Zend_Gdata_Exif_Extension_FStop
130 */
131 protected $_fStop = null;
132
133 /**
134 * exif:imageUniqueID value
135 *
136 * @var Zend_Gdata_Exif_Extension_ImageUniqueId
137 */
138 protected $_imageUniqueId = null;
139
140 /**
141 * exif:iso value
142 *
143 * @var Zend_Gdata_Exif_Extension_Iso
144 */
145 protected $_iso = null;
146
147 /**
148 * exif:make value
149 *
150 * @var Zend_Gdata_Exif_Extension_Make
151 */
152 protected $_make = null;
153
154 /**
155 * exif:model value
156 *
157 * @var Zend_Gdata_Exif_Extension_Model
158 */
159 protected $_model = null;
160
161 /**
162 * exif:time value
163 *
164 * @var Zend_Gdata_Exif_Extension_Time
165 */
166 protected $_time = null;
167
168 /**
169 * Constructs a new Zend_Gdata_Exif_Extension_Tags object.
170 *
171 * @param Zend_Gdata_Exif_Extension_Distance $distance (optional) The exif:distance
172 * value to be set in the constructed object.
173 * @param Zend_Gdata_Exif_Extension_Exposure $exposure (optional) The exif:exposure
174 * value to be set in the constructed object.
175 * @param Zend_Gdata_Exif_Extension_Flash $flash (optional) The exif:flash
176 * value to be set in the constructed object.
177 * @param Zend_Gdata_Exif_Extension_FocalLength$focalLength (optional) The exif:focallength
178 * value to be set in the constructed object.
179 * @param Zend_Gdata_Exif_Extension_FStop $fStop (optional) The exif:fstop
180 * value to be set in the constructed object.
181 * @param Zend_Gdata_Exif_Extension_ImageUniqueId $imageUniqueId (optional) The exif:imageUniqueID
182 * value to be set in the constructed object.
183 * @param Zend_Gdata_Exif_Extension_Iso $iso (optional) The exif:iso
184 * value to be set in the constructed object.
185 * @param Zend_Gdata_Exif_Extension_Make $make (optional) The exif:make
186 * value to be set in the constructed object.
187 * @param Zend_Gdata_Exif_Extension_Model $model (optional) The exif:model
188 * value to be set in the constructed object.
189 * @param Zend_Gdata_Exif_Extension_Time $time (optional) The exif:time
190 * value to be set in the constructed object.
191 */
192 public function __construct($distance = null, $exposure = null,
193 $flash = null, $focalLength = null, $fStop = null,
194 $imageUniqueId = null, $iso = null, $make = null,
195 $model = null, $time = null)
196 {
197 $this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
198 parent::__construct();
199 $this->setDistance($distance);
200 $this->setExposure($exposure);
201 $this->setFlash($flash);
202 $this->setFocalLength($focalLength);
203 $this->setFStop($fStop);
204 $this->setImageUniqueId($imageUniqueId);
205 $this->setIso($iso);
206 $this->setMake($make);
207 $this->setModel($model);
208 $this->setTime($time);
209 }
210
211 /**
212 * Retrieves a DOMElement which corresponds to this element and all
213 * child properties. This is used to build an entry back into a DOM
214 * and eventually XML text for application storage/persistence.
215 *
216 * @param DOMDocument $doc The DOMDocument used to construct DOMElements
217 * @return DOMElement The DOMElement representing this element and all
218 * child properties.
219 */
220 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
221 {
222 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
223 if ($this->_distance !== null) {
224 $element->appendChild($this->_distance->getDOM($element->ownerDocument));
225 }
226 if ($this->_exposure !== null) {
227 $element->appendChild($this->_exposure->getDOM($element->ownerDocument));
228 }
229 if ($this->_flash !== null) {
230 $element->appendChild($this->_flash->getDOM($element->ownerDocument));
231 }
232 if ($this->_focalLength !== null) {
233 $element->appendChild($this->_focalLength->getDOM($element->ownerDocument));
234 }
235 if ($this->_fStop !== null) {
236 $element->appendChild($this->_fStop->getDOM($element->ownerDocument));
237 }
238 if ($this->_imageUniqueId !== null) {
239 $element->appendChild($this->_imageUniqueId->getDOM($element->ownerDocument));
240 }
241 if ($this->_iso !== null) {
242 $element->appendChild($this->_iso->getDOM($element->ownerDocument));
243 }
244 if ($this->_make !== null) {
245 $element->appendChild($this->_make->getDOM($element->ownerDocument));
246 }
247 if ($this->_model !== null) {
248 $element->appendChild($this->_model->getDOM($element->ownerDocument));
249 }
250 if ($this->_time !== null) {
251 $element->appendChild($this->_time->getDOM($element->ownerDocument));
252 }
253 return $element;
254 }
255
256 /**
257 * Creates individual Entry objects of the appropriate type and
258 * stores them as members of this entry based upon DOM data.
259 *
260 * @param DOMNode $child The DOMNode to process
261 */
262 protected function takeChildFromDOM($child)
263 {
264 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
265 switch ($absoluteNodeName) {
266 case $this->lookupNamespace('exif') . ':' . 'distance';
267 $distance = new Zend_Gdata_Exif_Extension_Distance();
268 $distance->transferFromDOM($child);
269 $this->_distance = $distance;
270 break;
271 case $this->lookupNamespace('exif') . ':' . 'exposure';
272 $exposure = new Zend_Gdata_Exif_Extension_Exposure();
273 $exposure->transferFromDOM($child);
274 $this->_exposure = $exposure;
275 break;
276 case $this->lookupNamespace('exif') . ':' . 'flash';
277 $flash = new Zend_Gdata_Exif_Extension_Flash();
278 $flash->transferFromDOM($child);
279 $this->_flash = $flash;
280 break;
281 case $this->lookupNamespace('exif') . ':' . 'focallength';
282 $focalLength = new Zend_Gdata_Exif_Extension_FocalLength();
283 $focalLength->transferFromDOM($child);
284 $this->_focalLength = $focalLength;
285 break;
286 case $this->lookupNamespace('exif') . ':' . 'fstop';
287 $fStop = new Zend_Gdata_Exif_Extension_FStop();
288 $fStop->transferFromDOM($child);
289 $this->_fStop = $fStop;
290 break;
291 case $this->lookupNamespace('exif') . ':' . 'imageUniqueID';
292 $imageUniqueId = new Zend_Gdata_Exif_Extension_ImageUniqueId();
293 $imageUniqueId->transferFromDOM($child);
294 $this->_imageUniqueId = $imageUniqueId;
295 break;
296 case $this->lookupNamespace('exif') . ':' . 'iso';
297 $iso = new Zend_Gdata_Exif_Extension_Iso();
298 $iso->transferFromDOM($child);
299 $this->_iso = $iso;
300 break;
301 case $this->lookupNamespace('exif') . ':' . 'make';
302 $make = new Zend_Gdata_Exif_Extension_Make();
303 $make->transferFromDOM($child);
304 $this->_make = $make;
305 break;
306 case $this->lookupNamespace('exif') . ':' . 'model';
307 $model = new Zend_Gdata_Exif_Extension_Model();
308 $model->transferFromDOM($child);
309 $this->_model = $model;
310 break;
311 case $this->lookupNamespace('exif') . ':' . 'time';
312 $time = new Zend_Gdata_Exif_Extension_Time();
313 $time->transferFromDOM($child);
314 $this->_time = $time;
315 break;
316 }
317 }
318
319 /**
320 * Get the value for this element's distance attribute.
321 *
322 * @see setDistance
323 * @return Zend_Gdata_Exif_Extension_Distance The requested attribute.
324 */
325 public function getDistance()
326 {
327 return $this->_distance;
328 }
329
330 /**
331 * Set the value for this element's distance attribute.
332 *
333 * @param Zend_Gdata_Exif_Extension_Distance $value The desired value for this attribute.
334 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
335 */
336 public function setDistance($value)
337 {
338 $this->_distance = $value;
339 return $this;
340 }
341
342 /**
343 * Get the value for this element's exposure attribute.
344 *
345 * @see setExposure
346 * @return Zend_Gdata_Exif_Extension_Exposure The requested attribute.
347 */
348 public function getExposure()
349 {
350 return $this->_exposure;
351 }
352
353 /**
354 * Set the value for this element's exposure attribute.
355 *
356 * @param Zend_Gdata_Exif_Extension_Exposure $value The desired value for this attribute.
357 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
358 */
359 public function setExposure($value)
360 {
361 $this->_exposure = $value;
362 return $this;
363 }
364
365 /**
366 * Get the value for this element's flash attribute.
367 *
368 * @see setFlash
369 * @return Zend_Gdata_Exif_Extension_Flash The requested attribute.
370 */
371 public function getFlash()
372 {
373 return $this->_flash;
374 }
375
376 /**
377 * Set the value for this element's flash attribute.
378 *
379 * @param Zend_Gdata_Exif_Extension_Flash $value The desired value for this attribute.
380 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
381 */
382 public function setFlash($value)
383 {
384 $this->_flash = $value;
385 return $this;
386 }
387
388 /**
389 * Get the value for this element's name attribute.
390 *
391 * @see setFocalLength
392 * @return Zend_Gdata_Exif_Extension_FocalLength The requested attribute.
393 */
394 public function getFocalLength()
395 {
396 return $this->_focalLength;
397 }
398
399 /**
400 * Set the value for this element's focalLength attribute.
401 *
402 * @param Zend_Gdata_Exif_Extension_FocalLength $value The desired value for this attribute.
403 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
404 */
405 public function setFocalLength($value)
406 {
407 $this->_focalLength = $value;
408 return $this;
409 }
410
411 /**
412 * Get the value for this element's fStop attribute.
413 *
414 * @see setFStop
415 * @return Zend_Gdata_Exif_Extension_FStop The requested attribute.
416 */
417 public function getFStop()
418 {
419 return $this->_fStop;
420 }
421
422 /**
423 * Set the value for this element's fStop attribute.
424 *
425 * @param Zend_Gdata_Exif_Extension_FStop $value The desired value for this attribute.
426 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
427 */
428 public function setFStop($value)
429 {
430 $this->_fStop = $value;
431 return $this;
432 }
433
434 /**
435 * Get the value for this element's imageUniqueId attribute.
436 *
437 * @see setImageUniqueId
438 * @return Zend_Gdata_Exif_Extension_ImageUniqueId The requested attribute.
439 */
440 public function getImageUniqueId()
441 {
442 return $this->_imageUniqueId;
443 }
444
445 /**
446 * Set the value for this element's imageUniqueId attribute.
447 *
448 * @param Zend_Gdata_Exif_Extension_ImageUniqueId $value The desired value for this attribute.
449 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
450 */
451 public function setImageUniqueId($value)
452 {
453 $this->_imageUniqueId = $value;
454 return $this;
455 }
456
457 /**
458 * Get the value for this element's iso attribute.
459 *
460 * @see setIso
461 * @return Zend_Gdata_Exif_Extension_Iso The requested attribute.
462 */
463 public function getIso()
464 {
465 return $this->_iso;
466 }
467
468 /**
469 * Set the value for this element's iso attribute.
470 *
471 * @param Zend_Gdata_Exif_Extension_Iso $value The desired value for this attribute.
472 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
473 */
474 public function setIso($value)
475 {
476 $this->_iso = $value;
477 return $this;
478 }
479 /**
480 * Get the value for this element's make attribute.
481 *
482 * @see setMake
483 * @return Zend_Gdata_Exif_Extension_Make The requested attribute.
484 */
485 public function getMake()
486 {
487 return $this->_make;
488 }
489
490 /**
491 * Set the value for this element's make attribute.
492 *
493 * @param Zend_Gdata_Exif_Extension_Make $value The desired value for this attribute.
494 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
495 */
496 public function setMake($value)
497 {
498 $this->_make = $value;
499 return $this;
500 }
501
502 /**
503 * Get the value for this element's model attribute.
504 *
505 * @see setModel
506 * @return Zend_Gdata_Exif_Extension_Model The requested attribute.
507 */
508 public function getModel()
509 {
510 return $this->_model;
511 }
512
513 /**
514 * Set the value for this element's model attribute.
515 *
516 * @param Zend_Gdata_Exif_Extension_Model $value The desired value for this attribute.
517 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
518 */
519 public function setModel($value)
520 {
521 $this->_model = $value;
522 return $this;
523 }
524
525 /**
526 * Get the value for this element's time attribute.
527 *
528 * @see setTime
529 * @return Zend_Gdata_Exif_Extension_Time The requested attribute.
530 */
531 public function getTime()
532 {
533 return $this->_time;
534 }
535
536 /**
537 * Set the value for this element's time attribute.
538 *
539 * @param Zend_Gdata_Exif_Extension_Time $value The desired value for this attribute.
540 * @return Zend_Gdata_Exif_Extension_Tags Provides a fluent interface
541 */
542 public function setTime($value)
543 {
544 $this->_time = $value;
545 return $this;
546 }
547
548}
Note: See TracBrowser for help on using the repository browser.