Overview

Packages

  • Mime
    • Viewer

Classes

  • Horde_Mime_Viewer
  • Horde_Mime_Viewer_Audio
  • Horde_Mime_Viewer_Base
  • Horde_Mime_Viewer_Deb
  • Horde_Mime_Viewer_Default
  • Horde_Mime_Viewer_Enriched
  • Horde_Mime_Viewer_Exception
  • Horde_Mime_Viewer_Html
  • Horde_Mime_Viewer_Images
  • Horde_Mime_Viewer_Msexcel
  • Horde_Mime_Viewer_Mspowerpoint
  • Horde_Mime_Viewer_Msword
  • Horde_Mime_Viewer_Ooo
  • Horde_Mime_Viewer_Pdf
  • Horde_Mime_Viewer_Plain
  • Horde_Mime_Viewer_Rar
  • Horde_Mime_Viewer_Report
  • Horde_Mime_Viewer_Rfc822
  • Horde_Mime_Viewer_Richtext
  • Horde_Mime_Viewer_Rpm
  • Horde_Mime_Viewer_Rtf
  • Horde_Mime_Viewer_Security
  • Horde_Mime_Viewer_Simple
  • Horde_Mime_Viewer_Smil
  • Horde_Mime_Viewer_Syntaxhighlighter
  • Horde_Mime_Viewer_Tgz
  • Horde_Mime_Viewer_Tnef
  • Horde_Mime_Viewer_Translation
  • Horde_Mime_Viewer_Wordperfect
  • Horde_Mime_Viewer_Zip
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Mime_Viewer_Base

The Horde_Mime_Viewer_Base:: class provides the API for specific viewer drivers to extend.

Copyright 2008-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Direct known subclasses

Horde_Mime_Viewer_Audio, Horde_Mime_Viewer_Deb, Horde_Mime_Viewer_Pdf, Horde_Mime_Viewer_Plain, Horde_Mime_Viewer_Rar, Horde_Mime_Viewer_Report, Horde_Mime_Viewer_Rfc822, Horde_Mime_Viewer_Richtext, Horde_Mime_Viewer_Rpm, Horde_Mime_Viewer_Rtf, Horde_Mime_Viewer_Security, Horde_Mime_Viewer_Simple, Horde_Mime_Viewer_Default, Horde_Mime_Viewer_Smil, Horde_Mime_Viewer_Syntaxhighlighter, Horde_Mime_Viewer_Tgz, Horde_Mime_Viewer_Tnef, Horde_Mime_Viewer_Wordperfect, Horde_Mime_Viewer_Zip, Horde_Mime_Viewer_Enriched, Horde_Mime_Viewer_Html, Horde_Mime_Viewer_Images, Horde_Mime_Viewer_Msexcel, Horde_Mime_Viewer_Mspowerpoint, Horde_Mime_Viewer_Msword, Horde_Mime_Viewer_Ooo
Package: Mime\Viewer
Category: Horde
License: LGPL 2.1
Author: Michael Slusarz slusarz@horde.org
Located at Horde/Mime/Viewer/Base.php
Methods summary
public
# __construct( Horde_Mime_Part $part, array $conf = array() )

Constructor.

Constructor.

Parameters

$part
<p>$mime_part The object with the data to be rendered.</p>
$conf
Configuration: <pre>temp_file - (callback) A callback <span class="php-keyword1">function</span> that returns a temporary filename. Is passed one parameter: a prefix string. <span class="php-keyword1">DEFAULT</span>: Uses Horde_Util::getTempFile(). text_filter - (callback) A callback <span class="php-keyword1">function</span> used to filter text. Is called the same <span class="php-keyword1">as</span> Horde_Text_Filter::filter(). <span class="php-keyword1">DEFAULT</span>: Uses Horde_Text_Filter::filter().</pre>

Throws

InvalidArgumentException
public
# setMimePart( Horde_Mime_Part $mime_part )

Sets the Horde_Mime_Part object for the class.

Sets the Horde_Mime_Part object for the class.

Parameters

$mime_part
<p>The object with the data to be rendered.</p>
public array
# render( string $mode )

Return the rendered version of the Horde_Mime_Part object.

Return the rendered version of the Horde_Mime_Part object.

Parameters

$mode
The mode: <pre><span class="php-quote">'full'</span> - A full representation of the MIME part, <span class="php-keyword1">for</span> <span class="php-keyword1">use</span> in a view where the output to the browser can be set to the value returned in <span class="php-quote">'type'</span>. This mode should only <span class="php-keyword1">return</span> a single MIME ID entry <span class="php-keyword1">for</span> viewing <span class="php-keyword1">and</span> should not <span class="php-keyword1">return</span> any status information. <span class="php-quote">'inline'</span> - A representation of the MIME part that can be viewed inline on a text/html page that may contain other HTML elements. <span class="php-quote">'info'</span> - A representation of the MIME part that can be viewed inline on an text/html page that may contain other HTML elements. This view is not a full view, but rather a condensed view of the contents of the MIME part. This view is intended to be displayed to the user with the intention that this MIME part<span class="php-quote">'s subparts may also independently be viewed inline. '</span>raw<span class="php-quote">' - The raw data of the MIME part, generally useful for downloading a part. This view exists in case this raw data needs to be altered in any way.</span></pre>

Returns

array

An array. The keys are the MIME parts that were handled by the driver. The values are either null (which indicates the driver is recommending that this particular MIME ID should not be displayed) or an array with the following keys:

'data' - (string) The rendered data.
'status' - (array) An array of status information to be displayed to
           the user.  Consists of arrays with the following keys:
           'class' - (string) The class to use for display.
           'img' - (string) An image to display.
           'text' - (array) The text to display.
'type' - (string) The MIME type of the rendered data.
public boolean
# canRender( string $mode )

Can this driver render the the data?

Can this driver render the the data?

Parameters

$mode
<p>The mode. Either 'full', 'inline', 'info', or 'raw'.</p>

Returns

boolean

True if the driver can render the data for the given view.

public boolean
# embeddedMimeParts( )

Does this MIME part possibly contain embedded MIME parts?

Does this MIME part possibly contain embedded MIME parts?

Returns

boolean

True if this driver supports parsing embedded MIME parts.

public mixed
# getEmbeddedMimeParts( )

If this MIME part can contain embedded MIME part(s), and those part(s) exist, return a representation of that data.

If this MIME part can contain embedded MIME part(s), and those part(s) exist, return a representation of that data.

Returns

mixed

A Horde_Mime_Part object representing the embedded data. Returns null if no embedded MIME part(s) exist.

public mixed
# getConfigParam( string $param )

Return a configuration parameter for the current viewer.

Return a configuration parameter for the current viewer.

Parameters

$param
The parameter name.

Returns

mixed

The value of the parameter; returns null if the parameter doesn't exist.

public
# setConfigParam( string $param, mixed $value )

Sets a configuration parameter for the current viewer.

Sets a configuration parameter for the current viewer.

Parameters

$param
The parameter name.
$value
The parameter value.
public string
# getDriver( )

Returns the driver name for the current object.

Returns the driver name for the current object.

Returns

string
The driver name.
public mixed
# getMetadata( string $data )

Returns metadata information on the viewer/data.

Returns metadata information on the viewer/data.

Parameters

$data
The metadata key.

Returns

mixed

The requested information, or null if the key doesn't exist.

API documentation generated by ApiGen