This class contains code related to generating and handling a mailbox
message list.
Copyright 2002-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (GPL). If you
did not receive this file, see http://www.horde.org/licenses/gpl.
Methods summary
public
|
#
__construct( string $mbox )
Constructor.
Parameters
- $mbox
- The mailbox to work with.
|
public
array
|
#
getMailboxArray( array $msgnum, array $options = array() )
Build the array of message information.
Build the array of message information.
Parameters
- $msgnum
- An array of message sequence numbers.
- $options
- Additional options:
<pre>headers - (boolean) <span class="php-keyword1">Return</span> info on the non-envelope headers
<span class="php-quote">'Importance'</span>, <span class="php-quote">'List-Post'</span>, <span class="php-keyword1">and</span> <span class="php-quote">'X-Priority'</span>.
<span class="php-keyword1">DEFAULT</span>: <span class="php-keyword1">false</span> (only envelope headers returned)
preview - (mixed) <span class="php-keyword1">Include</span> preview information? <span class="php-keyword1">If</span> <span class="php-keyword1">empty</span>, add no
preview information. <span class="php-keyword1">If</span> <span class="php-num">1</span>, uses value from prefs.
<span class="php-keyword1">If</span> <span class="php-num">2</span>, forces addition of preview info.
<span class="php-keyword1">DEFAULT</span>: No preview information.
type - (boolean) <span class="php-keyword1">Return</span> info on the MIME Content-Type of the base
message part (<span class="php-quote">'Content-Type'</span> <span class="php-keyword2">header</span>).
<span class="php-keyword1">DEFAULT</span>: <span class="php-keyword1">false</span></pre>
Returns
array An array with the following keys:
overview - (array) The overview information. Contains the following:
envelope - (Horde_Imap_Client_Data_Envelope) Envelope information
returned from the IMAP server.
flags - (array) The list of IMAP flags returned from the server.
headers - (array) Horde_Mime_Headers objects containing header data
if either $options['headers'] or $options['type'] are
true.
mailbox - (string) The mailbox containing the message.
preview - (string) If requested in $options['preview'], the preview
text.
previewcut - (boolean) Has the preview text been cut?
size - (integer) The size of the message in bytes.
uid - (string) The unique ID of the message.
uids - (IMP_Indices) An indices object.
|
public
boolean
|
#
isBuilt( )
Returns true if the mailbox data has been built.
Returns true if the mailbox data has been built.
Returns
boolean True if the mailbox has been built.
|
public
mixed
|
#
newMessages( integer $results, boolean $uid = false )
Get the list of new messages in the mailbox (IMAP RECENT flag, with
UNDELETED if we're hiding deleted messages).
Get the list of new messages in the mailbox (IMAP RECENT flag, with
UNDELETED if we're hiding deleted messages).
Parameters
- $results
- <p>A Horde_Imap_Client::SORT_* constant that
indicates the desired return type.</p>
- $uid
- <p>Return UIDs instead of sequence numbers (for
$results queries that return message lists).</p>
Returns
mixed Whatever is requested in $results.
|
public
mixed
|
#
unseenMessages( integer $results, boolean $uid = false )
Get the list of unseen messages in the mailbox (IMAP UNSEEN flag, with
UNDELETED if we're hiding deleted messages).
Get the list of unseen messages in the mailbox (IMAP UNSEEN flag, with
UNDELETED if we're hiding deleted messages).
Parameters
- $results
- <p>A Horde_Imap_Client::SORT_RESULTS_* constant
that indicates the desired return type.</p>
- $uid
- <p>Return UIDs instead of sequence numbers (for
$results queries that return message lists).</p>
Returns
mixed Whatever is requested in $results.
|
public
array
|
#
buildMailboxPage( integer $page = 0, integer $start = 0, mixed $opts = array() )
Using the preferences and the current mailbox, determines the messages
to view on the current page.
Using the preferences and the current mailbox, determines the messages
to view on the current page.
Parameters
- $page
- The page number currently being displayed.
- $start
- The starting message number.
- $opts
-
Returns
array An array with the following fields:
anymsg: (boolean) Are there any messages at all in mailbox? E.g. If
'msgcount' is 0, there may still be hidden deleted messages.
begin: (integer) The beginning message sequence number of the page.
end: (integer) The ending message sequence number of the page.
index: (integer) The index of the starting message.
msgcount: (integer) The number of viewable messages in the current
mailbox.
page: (integer) The current page number.
pagecount: (integer) The number of pages in this mailbox.
|
public
integer
|
#
mailboxStart( integer $total )
Determines the sequence number of the first message to display, based
on the user's preferences.
Determines the sequence number of the first message to display, based
on the user's preferences.
Parameters
- $total
- The total number of messages in the mailbox.
Returns
integer The sequence number in the sorted mailbox.
|
public
Horde_Imap_Client_Data_Thread
|
#
getThreadOb( )
Get the thread object for the current mailbox.
Get the thread object for the current mailbox.
Returns
Horde_Imap_Client_Data_Thread The thread object for the
current mailbox.
|
public
|
|
public
mixed
|
#
getArrayIndex( integer $uid, integer $mbox = null )
Returns the array index of the given message UID.
Returns the array index of the given message UID.
Parameters
- $uid
- The message UID.
- $mbox
- <p>The message mailbox (defaults to the current
mailbox).</p>
Returns
mixed The array index of the location of the message UID in
the current mailbox. Returns null if not found.
|
public
IMP_Indices
|
#
getIndicesOb( )
Generate an IMP_Indices object out of the contents of this mailbox.
Generate an IMP_Indices object out of the contents of this mailbox.
Returns
|
public
boolean
|
#
removeMsgs( mixed $indices )
Removes messages from the mailbox.
Removes messages from the mailbox.
Parameters
- $indices
- <p>An IMP_Indices object or true to remove all
messages in the mailbox.</p>
Returns
boolean True if the message was removed from the mailbox.
|
public
|
#
offsetExists( integer $offset )
Parameters
- $offset
- Sequence number of message.
Implementation of
ArrayAccess::offsetExists()
|
public
array
|
#
offsetGet( integer $offset )
Parameters
- $offset
- Sequence number of message.
Returns
array Two-element array:
- m: (IMP_Mailbox) Mailbox of message.
- u: (string) UID of message.
Implementation of
ArrayAccess::offsetGet()
|
public
|
#
offsetSet( mixed $offset, mixed $value )
Throws
BadMethodCallException
Implementation of
ArrayAccess::offsetSet()
|
public
|
#
offsetUnset( mixed $offset )
Throws
BadMethodCallException
Implementation of
ArrayAccess::offsetUnset()
|
public
integer
|
#
count( )
Returns the current message count of the mailbox.
Returns the current message count of the mailbox.
Returns
integer The mailbox message count.
Implementation of
Countable::count()
|
public
array
|
#
current( )
Returns
array Two-element array:
- m: (IMP_Mailbox) Mailbox of message.
- u: (string) UID of message.
Implementation of
Iterator::current()
|
public
integer
|
#
key( )
Returns
integer Sequence number of message.
Implementation of
Iterator::key()
|
public
|
#
next( )
Implementation of
Iterator::next()
|
public
|
#
rewind( )
Implementation of
Iterator::rewind()
|
public
|
#
valid( )
Implementation of
Iterator::valid()
|
public
string
|
#
serialize( )
Serialization.
Returns
string Serialized data.
Implementation of
Serializable::serialize()
|
public
|
#
unserialize( string $data )
Unserialization.
Parameters
Throws
Exception
Implementation of
Serializable::unserialize()
|