Documentation

Horde_Compress_Tnef_Rtf extends Horde_Compress_Tnef_Object
in package

Object to parse RTF data encapsulated in a TNEF file.

Tags
author

Michael J Rubinsky mrubinsk@horde.org

category

Horde

copyright

2002-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

COMPRESSED  = 0x75465a4c
UNCOMPRESSED  = 0x414c454d
$type  : string
MIME type.
$_content  : string
RTF content.
$_data  : string
$_logger  : Horde_Log_Logger
$_options  : array<string|int, mixed>
$_size  : int
Size of RTF content.
__construct()  : mixed
__get()  : mixed
setMapiAttribute()  : mixed
Allow this object to set any MAPI attributes it needs to know about, ignore any it doesn't care about.
setTnefAttribute()  : mixed
Allow this object to set any TNEF attributes it needs to know about, ignore any it doesn't care about.
toArray()  : array<string|int, mixed>
Output the data for this object in an array.
toPlain()  : string
Obtain a good-enough-for-our-needs plain text representation of the RTF document.
_decode()  : mixed
_decompress()  : string
Decompress compressed RTF. Logic taken and adapted from NasMail RTF plugin.
_geti()  : int
Pop specified number of bits from the buffer
_getx()  : string
Pop specified number of bytes from the buffer.
_rtf2text()  : string
Parse RTF data and return the best plaintext representation we can.
_rtfIsPlain()  : mixed

Constants

COMPRESSED

public mixed COMPRESSED = 0x75465a4c

UNCOMPRESSED

public mixed UNCOMPRESSED = 0x414c454d

Properties

$type

MIME type.

public string $type = 'application/rtf'

$_content

RTF content.

protected string $_content = ''

$_logger

protected Horde_Log_Logger $_logger

$_options

protected array<string|int, mixed> $_options

$_size

Size of RTF content.

protected int $_size = 0

Methods

__construct()

public __construct(mixed $logger, mixed $data) : mixed
Parameters
$logger : mixed
$data : mixed
Return values
mixed

__get()

public __get(mixed $property) : mixed
Parameters
$property : mixed
Return values
mixed

setMapiAttribute()

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

public setMapiAttribute(int $type, int $name, mixed $value) : mixed
Parameters
$type : int

The attribute type descriptor.

$name : int

The attribute name descriptor.

$value : mixed
Return values
mixed

setTnefAttribute()

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

public setTnefAttribute(int $attribute, mixed $value, int $size) : mixed
Parameters
$attribute : int

The attribute descriptor.

$value : mixed

The value from the MAPI stream.

$size : int

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

Return values
mixed

toArray()

Output the data for this object in an array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>
  • type: (string) The MIME type of the content.
  • subtype: (string) The MIME subtype.
  • name: (string) The filename.
  • stream: (string) The file data.

toPlain()

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

public toPlain() : string
Return values
string

The plaintext.

_decode()

protected _decode() : mixed
Return values
mixed

_decompress()

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

protected _decompress() : string
Return values
string

_geti()

Pop specified number of bits from the buffer

protected _geti(string &$data, int $bits) : int
Parameters
$data : string

The data string.

$bits : int

How many bits to retrieve.

Return values
int

The value from $data.

_getx()

Pop specified number of bytes from the buffer.

protected _getx(string &$data, int $bytes) : string
Parameters
$data : string

The data string.

$bytes : int

How many bytes to retrieve.

Return values
string

The specified number of bytes from $data.

_rtf2text()

Parse RTF data and return the best plaintext representation we can.

protected _rtf2text(string $text) : string

Adapted from: http://webcheatsheet.com/php/reading_the_clean_text_from_rtf.php

Parameters
$text : string

The RTF text.

Return values
string

The plaintext.

_rtfIsPlain()

protected _rtfIsPlain(mixed $s) : mixed
Parameters
$s : mixed
Return values
mixed

Search results