/
AirSyncBaseAttachment.php
117 lines (110 loc) · 4.1 KB
/
AirSyncBaseAttachment.php
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
<?php
/**
* Horde_ActiveSync_Message_AirSyncBaseAttachment::
*
* Portions of this class were ported from the Z-Push project:
* File : wbxml.php
* Project : Z-Push
* Descr : WBXML mapping file
*
* Created : 01.10.2007
*
* � Zarafa Deutschland GmbH, www.zarafaserver.de
* This file is distributed under GPL-2.0.
* Consult COPYING file for details
*
* @license http://www.horde.org/licenses/gpl GPLv2
* NOTE: According to sec. 8 of the GENERAL PUBLIC LICENSE (GPL),
* Version 2, the distribution of the Horde_ActiveSync module in or
* to the United States of America is excluded from the scope of this
* license.
* @copyright 2011-2016 Horde LLC (http://www.horde.org)
* @author Michael J Rubinsky <mrubinsk@horde.org>
* @package ActiveSync
*/
/**
* Horde_ActiveSync_Message_AirSyncBaseAttachment::
*
* @license http://www.horde.org/licenses/gpl GPLv2
* NOTE: According to sec. 8 of the GENERAL PUBLIC LICENSE (GPL),
* Version 2, the distribution of the Horde_ActiveSync module in or
* to the United States of America is excluded from the scope of this
* license.
* @copyright 2011-2016 Horde LLC (http://www.horde.org)
* @author Michael J Rubinsky <mrubinsk@horde.org>
* @package ActiveSync
*
* @property string $attmethod The attachment method.
* @property integer $attsize The attachment size.
* @property string $displayname The attachment's display name.
* @property string $attname The attachment's name.
* @property boolean $attremoved @todo
* @property string $contentid The Content-Id of the mime part.
* @property string $contentlocation @todo
* @property boolean $isinline Indicates that this part is to be displayed inline.
*/
class Horde_ActiveSync_Message_AirSyncBaseAttachment extends Horde_ActiveSync_Message_Base
{
/* Attachement types */
const ATT_TYPE_NORMAL = 1;
const ATT_TYPE_EMBEDDED = 5;
const ATT_TYPE_OLE = 6;
/**
* Property mappings
*
* @var array
*/
protected $_mapping = array(
Horde_ActiveSync::AIRSYNCBASE_DISPLAYNAME => array (self::KEY_ATTRIBUTE => 'displayname'),
Horde_ActiveSync::AIRSYNCBASE_FILEREFERENCE => array (self::KEY_ATTRIBUTE => 'attname'),
Horde_ActiveSync::AIRSYNCBASE_METHOD => array (self::KEY_ATTRIBUTE => 'attmethod'),
Horde_ActiveSync::AIRSYNCBASE_ESTIMATEDDATASIZE => array (self::KEY_ATTRIBUTE => 'attsize'),
Horde_ActiveSync::AIRSYNCBASE_CONTENTID => array (self::KEY_ATTRIBUTE => 'contentid'),
Horde_ActiveSync::AIRSYNCBASE_CONTENTLOCATION => array (self::KEY_ATTRIBUTE => 'contentlocation'),
Horde_ActiveSync::AIRSYNCBASE_ISINLINE => array (self::KEY_ATTRIBUTE => 'isinline'),
Horde_ActiveSync::AIRSYNCBASE_DATA => array (self::KEY_ATTRIBUTE => '_data'),
);
/**
* Property mapping.
*
* @var array
*/
protected $_properties = array(
'attmethod' => false,
'attsize' => false,
'displayname' => false,
'attname' => false,
'attremoved' => false,
'contentid' => false,
'contentlocation' => false,
'isinline' => false,
'_data' => false
);
/**
* Const'r
*
* @see Horde_ActiveSync_Message_Base::__construct()
*/
public function __construct(array $options = array())
{
parent::__construct($options);
if ($this->_version >= Horde_ActiveSync::VERSION_SIXTEEN) {
$this->_mapping += array(
Horde_ActiveSync::AIRSYNCBASE_CLIENTID=> array(self::KEY_ATTRIBUTE => 'clientid')
);
$this->_properties += array(
'clientid' => false,
'filereference' => false,
);
}
}
/**
* Return the type of message.
*
* @return string
*/
public function getClass()
{
return 'AirSyncBaseAttachment';
}
}