\Horde_Compress_Tnef_Rtf

Object to parse RTF data encapsulated in a TNEF file.

Summary

Methods
Properties
Constants
__construct()
setTnefAttribute()
setMapiAttribute()
toArray()
__get()
toPlain()
$type
UNCOMPRESSED
COMPRESSED
_getx()
_geti()
_decode()
_decompress()
_rtf2text()
_rtfIsPlain()
$_logger
$_data
$_options
$_content
$_size
N/A
No private methods found
No private properties found
N/A

Constants

UNCOMPRESSED

UNCOMPRESSED

COMPRESSED

COMPRESSED

Properties

$type

$type : string

MIME type.

Type

string

$_logger

$_logger : \Horde_Log_Logger

Type

\Horde_Log_Logger

$_data

$_data : string

Type

string

$_options

$_options : array

Type

array

$_content

$_content : string

RTF content.

Type

string

$_size

$_size : integer

Size of RTF content.

Type

integer

Methods

__construct()

__construct(  $logger,   $data) 

Parameters

$logger
$data

setTnefAttribute()

setTnefAttribute(integer  $attribute, mixed  $value, integer  $size) 

Allow this object to set any TNEF attributes it needs to know about, ignore any it doesn't care about.

Parameters

integer $attribute

The attribute descriptor.

mixed $value

The value from the MAPI stream.

integer $size

The byte length of the data, as reported by the MAPI data.

setMapiAttribute()

setMapiAttribute(integer  $type, integer  $name,   $value) 

Allow this object to set any MAPI attributes it needs to know about, ignore any it doesn't care about.

Parameters

integer $type

The attribute type descriptor.

integer $name

The attribute name descriptor.

$value

toArray()

toArray() : array

Output the data for this object in an array.

Returns

array —
  • type: (string) The MIME type of the content.
    • subtype: (string) The MIME subtype.
    • name: (string) The filename.
    • stream: (string) The file data.

__get()

__get(  $property) 

Parameters

$property

toPlain()

toPlain() : string

Obtain a good-enough-for-our-needs plain text representation of the RTF document.

Returns

string —

The plaintext.

_getx()

_getx(  $data, integer  $bytes) : string

Pop specified number of bytes from the buffer.

Parameters

$data
integer $bytes

How many bytes to retrieve.

Returns

string —

The specified number of bytes from $data.

_geti()

_geti(  $data, integer  $bits) : integer

Pop specified number of bits from the buffer

Parameters

$data
integer $bits

How many bits to retrieve.

Returns

integer —

The value from $data.

_decode()

_decode() 

_decompress()

_decompress() : string

Decompress compressed RTF. Logic taken and adapted from NasMail RTF plugin.

Returns

string

_rtfIsPlain()

_rtfIsPlain(  $s) 

Parameters

$s