Source

joomla-picasa / site / libraries / Zend / Gdata / Exif / Extension / Tags.php

Full commit
roberto.aloi c45efd2 







































































































































































































































































































































































































































































































  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Gdata
 * @copyright  Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * @see Zend_Gdata_Extension
 */
require_once 'Zend/Gdata/Extension.php';

/**
 * @see Zend_Gdata_Exif
 */
require_once 'Zend/Gdata/Exif.php';

/**
 * @see Zend_Gdata_Exif_Extension_Distance
 */
require_once 'Zend/Gdata/Exif/Extension/Distance.php';

/**
 * @see Zend_Gdata_Exif_Extension_Exposure
 */
require_once 'Zend/Gdata/Exif/Extension/Exposure.php';

/**
 * @see Zend_Gdata_Exif_Extension_Flash
 */
require_once 'Zend/Gdata/Exif/Extension/Flash.php';

/**
 * @see Zend_Gdata_Exif_Extension_FocalLength
 */
require_once 'Zend/Gdata/Exif/Extension/FocalLength.php';

/**
 * @see Zend_Gdata_Exif_Extension_FStop
 */
require_once 'Zend/Gdata/Exif/Extension/FStop.php';

/**
 * @see Zend_Gdata_Exif_Extension_ImageUniqueId
 */
require_once 'Zend/Gdata/Exif/Extension/ImageUniqueId.php';

/**
 * @see Zend_Gdata_Exif_Extension_Iso
 */
require_once 'Zend/Gdata/Exif/Extension/Iso.php';

/**
 * @see Zend_Gdata_Exif_Extension_Make
 */
require_once 'Zend/Gdata/Exif/Extension/Make.php';

/**
 * @see Zend_Gdata_Exif_Extension_Model
 */
require_once 'Zend/Gdata/Exif/Extension/Model.php';

/**
 * @see Zend_Gdata_Exif_Extension_Time
 */
require_once 'Zend/Gdata/Exif/Extension/Time.php';

/**
 * Represents the exif:tags element used by the Gdata Exif extensions.
 *
 * @category   Zend
 * @package    Zend_Gdata
 * @copyright  Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Gdata_Exif_Extension_Tags extends Zend_Gdata_Extension
{

    protected $_rootNamespace = 'exif';
    protected $_rootElement = 'tags';
    
    protected $_distance = null;
    protected $_exposure = null;
    protected $_flash = null;
    protected $_focalLength = null;
    protected $_fStop = null;
    protected $_imageUniqueId = null;
    protected $_iso = null;
    protected $_make = null;
    protected $_model = null;
    protected $_time = null;
    
    /**
     * Constructs a new Zend_Gdata_Exif_Extension_Tags object.
     * @param string $distance (optional) The exif:distance value to be set 
     *          in the constructed object.
     * @param string $exposure (optional) The exif:exposure value to be set 
     *          in the constructed object.
     * @param string $flash (optional) The exif:flash value to be set 
     *          in the constructed object.
     * @param string $focalLength (optional) The exif:focallength value to be set 
     *          in the constructed object.
     * @param string $fStop (optional) The exif:fstop value to be set 
     *          in the constructed object.
     * @param string $imageUniqueId (optional) The exif:imageUniqueID value to be set 
     *          in the constructed object.
     * @param string $iso (optional) The exif:iso value to be set 
     *          in the constructed object.
     * @param string $make (optional) The exif:make value to be set 
     *          in the constructed object.
     * @param string $model (optional) The exif:model value to be set 
     *          in the constructed object.
     * @param string $time (optional) The exif:time value to be set 
     *          in the constructed object.
     */
    public function __construct($distance = null, $exposure = null,
            $flash = null, $focalLength = null, $fStop = null,
            $imageUniqueId = null, $iso = null, $make = null,
            $model = null, $time = null) 
    {
        foreach (Zend_Gdata_Exif::$namespaces as $nsPrefix => $nsUri) {
            $this->registerNamespace($nsPrefix, $nsUri);
        }
        parent::__construct();
        $this->setDistance($distance);
        $this->setExposure($exposure);
        $this->setFlash($flash);
        $this->setFocalLength($focalLength);
        $this->setFStop($fStop);
        $this->setImageUniqueId($imageUniqueId);
        $this->setIso($iso);
        $this->setMake($make);
        $this->setModel($model);
        $this->setTime($time);
    }
    
    /**
     * Retrieves a DOMElement which corresponds to this element and all
     * child properties.  This is used to build an entry back into a DOM
     * and eventually XML text for application storage/persistence.
     *
     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
     * @return DOMElement The DOMElement representing this element and all
     *          child properties.
     */
    public function getDOM($doc = null)
    {
        $element = parent::getDOM($doc);
        if ($this->_distance !== null) {
            $element->appendChild($this->_distance->getDOM($element->ownerDocument));
        }
        if ($this->_exposure !== null) {
            $element->appendChild($this->_exposure->getDOM($element->ownerDocument));
        }
        if ($this->_flash !== null) {
            $element->appendChild($this->_flash->getDOM($element->ownerDocument));
        }
        if ($this->_focalLength !== null) {
            $element->appendChild($this->_focalLength->getDOM($element->ownerDocument));
        }
        if ($this->_fStop !== null) {
            $element->appendChild($this->_fStop->getDOM($element->ownerDocument));
        }
        if ($this->_imageUniqueId !== null) {
            $element->appendChild($this->_imageUniqueId->getDOM($element->ownerDocument));
        }
        if ($this->_iso !== null) {
            $element->appendChild($this->_iso->getDOM($element->ownerDocument));
        }
        if ($this->_make !== null) {
            $element->appendChild($this->_make->getDOM($element->ownerDocument));
        }
        if ($this->_model !== null) {
            $element->appendChild($this->_model->getDOM($element->ownerDocument));
        }
        if ($this->_time !== null) {
            $element->appendChild($this->_time->getDOM($element->ownerDocument));
        }
        return $element;
    }

    /**
     * Creates individual Entry objects of the appropriate type and
     * stores them as members of this entry based upon DOM data.
     *
     * @param DOMNode $child The DOMNode to process
     */
    protected function takeChildFromDOM($child)
    {
        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
        
        switch ($absoluteNodeName) {
            case $this->lookupNamespace('exif') . ':' . 'distance'; 
                $distance = new Zend_Gdata_Exif_Extension_Distance();
                $distance->transferFromDOM();
                $this->_distance = $distance;
                break;
            case $this->lookupNamespace('exif') . ':' . 'exposure'; 
                $exposure = new Zend_Gdata_Exif_Extension_Exposure();
                $exposure->transferFromDOM();
                $this->_exposure = $exposure;
                break;
            case $this->lookupNamespace('exif') . ':' . 'flash'; 
                $flash = new Zend_Gdata_Exif_Extension_Flash();
                $flash->transferFromDOM();
                $this->_flash = $flash;
                break;
            case $this->lookupNamespace('exif') . ':' . 'focallength'; 
                $focalLength = new Zend_Gdata_Exif_Extension_FocalLength();
                $focalLength->transferFromDOM();
                $this->_focalLength = $focalLength;
                break;
            case $this->lookupNamespace('exif') . ':' . 'fstop'; 
                $fStop = new Zend_Gdata_Exif_Extension_FStop();
                $fStop->transferFromDOM();
                $this->_fStop = $fStop;
                break;
            case $this->lookupNamespace('exif') . ':' . 'imageUniqueId'; 
                $imageUniqueId = new Zend_Gdata_Exif_Extension_ImageUniqueId();
                $imageUniqueId->transferFromDOM();
                $this->_imageUniqueId = $imageUniqueId;
                break;
            case $this->lookupNamespace('exif') . ':' . 'iso'; 
                $iso = new Zend_Gdata_Exif_Extension_Iso();
                $iso->transferFromDOM();
                $this->_iso = $iso;
                break;
            case $this->lookupNamespace('exif') . ':' . 'make'; 
                $make = new Zend_Gdata_Exif_Extension_Make();
                $make->transferFromDOM();
                $this->_make = $make;
                break;
            case $this->lookupNamespace('exif') . ':' . 'model'; 
                $model = new Zend_Gdata_Exif_Extension_Model();
                $model->transferFromDOM();
                $this->_model = $model;
                break;
            case $this->lookupNamespace('exif') . ':' . 'time'; 
                $time = new Zend_Gdata_Exif_Extension_Time();
                $time->transferFromDOM();
                $this->_time = $time;
                break;
        }
    }
    
    /**
     * Get the value for this element's distance attribute.
     *
     * @see setDistance
     * @return string The requested attribute.
     */
    public function getDistance()
    {
        return $this->_distance;
    }
    
    /**
     * Set the value for this element's distance attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_Distance The element being modified.
     */
    public function setDistance($value)
    {
        $this->_distance = $value;
        return $this;
    }
    
    /**
     * Get the value for this element's exposure attribute.
     *
     * @see setExposure
     * @return string The requested attribute.
     */
    public function getExposure()
    {
        return $this->_exposure;
    }
    
    /**
     * Set the value for this element's exposure attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_Exposure The element being modified.
     */
    public function setExposure($value)
    {
        $this->_exposure = $value;
        return $this;
    }
    
    /**
     * Get the value for this element's flash attribute.
     *
     * @see setFlash
     * @return string The requested attribute.
     */
    public function getFlash()
    {
        return $this->_flash;
    }
    
    /**
     * Set the value for this element's flash attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_Flash The element being modified.
     */
    public function setFlash($value)
    {
        $this->_flash = $value;
        return $this;
    }
    
    /**
     * Get the value for this element's name attribute.
     *
     * @see setName
     * @return string The requested attribute.
     */
    public function getFocalLength()
    {
        return $this->_focalLength;
    }
    
    /**
     * Set the value for this element's focalLength attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_FocalLength The element being modified.
     */
    public function setFocalLength($value)
    {
        $this->_focalLength = $value;
        return $this;
    }
    
    /**
     * Get the value for this element's fStop attribute.
     *
     * @see setFStop
     * @return string The requested attribute.
     */
    public function getFStop()
    {
        return $this->_fStop;
    }
    
    /**
     * Set the value for this element's fStop attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_FStop The element being modified.
     */
    public function setFStop($value)
    {
        $this->_fStop = $value;
        return $this;
    }
    
    /**
     * Get the value for this element's imageUniqueId attribute.
     *
     * @see setImageUniqueId
     * @return string The requested attribute.
     */
    public function getImageUniqueId()
    {
        return $this->_imageUniqueId;
    }

    /**
     * Set the value for this element's imageUniqueId attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_ImageUniqueId The element being modified.
     */
    public function setImageUniqueId($value)
    {
        $this->_imageUniqueId = $value;
        return $this;
    }
    
    /**
     * Get the value for this element's iso attribute.
     *
     * @see setIso
     * @return string The requested attribute.
     */
    public function getIso()
    {
        return $this->_iso;
    }

    /**
     * Set the value for this element's iso attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_Iso The element being modified.
     */
    public function setIso($value)
    {
        $this->_iso = $value;
        return $this;
    }
    /**
     * Get the value for this element's make attribute.
     *
     * @see setMake
     * @return string The requested attribute.
     */
    public function getMake()
    {
        return $this->_make;
    }

    /**
     * Set the value for this element's make attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_Make The element being modified.
     */
    public function setMake($value)
    {
        $this->_make = $value;
        return $this;
    }
    
    /**
     * Get the value for this element's model attribute.
     *
     * @see setModel
     * @return string The requested attribute.
     */
    public function getModel()
    {
        return $this->_model;
    }

    /**
     * Set the value for this element's model attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_Model The element being modified.
     */
    public function setModel($value)
    {
        $this->_model = $value;
        return $this;
    }
    
    /**
     * Get the value for this element's time attribute.
     *
     * @see setTime
     * @return string The requested attribute.
     */
    public function getTime()
    {
        return $this->_time;
    }

    /**
     * Set the value for this element's time attribute.
     *
     * @param string $value The desired value for this attribute.
     * @return Zend_Gdata_Exif_Extension_Time The element being modified.
     */
    public function setTime($value)
    {
        $this->_time = $value;
        return $this;
    }

}