The nsIMsgDBView
interface handles the display of mail in the threadpane and preview pane of Thunderbird and other XPCOM based mail cients.
Inherits from: nsISupports
Implemented by: @mozilla.org/messenger/msgdbview;1
. To create an instance, use:
var dbView = Components.classes[@mozilla.org/messenger/msgdbview;1?type=] .createInstance(Components.interfaces.nsIMsgDBView);
where type
designates different types of view's available. Available in the mozilla codebase are types "quicksearch", "threadswithunread", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsIMsgDBView that provides a different sorting/view of the data.
void open(in nsIMsgFolder folder, in nsMsgViewSortTypeValue sortType, in nsMsgViewSortOrderValue sortOrder, in nsMsgViewFlagsTypeValue viewFlags, out long count); |
void openWithHdrs(in nsISimpleEnumerator aHeaders, in nsMsgViewSortTypeValue aSortType, in nsMsgViewSortOrderValue aSortOrder, in nsMsgViewFlagsTypeValue aViewFlags, out long aCount); |
void close(); |
void init(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater); |
void sort(in nsMsgViewSortTypeValue sortType, in nsMsgViewSortOrderValue sortOrder); |
void doCommand(in nsMsgViewCommandTypeValue command); |
void doCommandWithFolder(in nsMsgViewCommandTypeValue command, in nsIMsgFolder destFolder); |
void getCommandStatus(in nsMsgViewCommandTypeValue command, out boolean selectable_p, out nsMsgViewCommandCheckStateValue selected_p); |
void viewNavigate(in nsMsgNavigationTypeValue motion, out nsMsgKey resultId, out nsMsgViewIndex resultIndex, out nsMsgViewIndex threadIndex, in boolean wrap); |
boolean navigateStatus(in nsMsgNavigationTypeValue motion); |
nsMsgKey getKeyAt(in nsMsgViewIndex index); |
nsIMsgDBHdr getMsgHdrAt(in nsMsgViewIndex index); |
nsIMsgFolder getFolderForViewIndex(in nsMsgViewIndex index); |
ACString getURIForViewIndex(in nsMsgViewIndex index); |
nsIMsgDBView cloneDBView(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater); |
void getURIsForSelection([array, size_is(count)] out string uris, out unsigned long count); |
void getIndicesForSelection([array, size_is(count)] out nsMsgViewIndex indices, out unsigned long count); |
void loadMessageByMsgKey(in nsMsgKey aMsgKey); |
void loadMessageByViewIndex(in nsMsgViewIndex aIndex); |
void loadMessageByUrl(in string aUrl); |
void reloadMessage(); |
void reloadMessageWithAllParts(); |
void selectMsgByKey(in nsMsgKey key); |
void selectFolderMsgByKey(in nsIMsgFolder aFolder, in nsMsgKey aKey); |
void onDeleteCompleted(in boolean succeeded); |
nsMsgViewIndex findIndexFromKey(in nsMsgKey aMsgKey, in boolean aExpand); |
void ExpandAndSelectThreadByIndex(in nsMsgViewIndex aIndex, in boolean aAugment); |
void addColumnHandler(in AString aColumn, in nsIMsgCustomColumnHandler aHandler); |
void removeColumnHandler(in AString aColumn); |
nsIMsgCustomColumnHandler getColumnHandler(in AString aColumn); |
Attribute | Type | Description |
viewType |
nsMsgViewTypeValue |
Readonly: Type of view. Constants are defined in nsMsgViewType . |
viewFlags |
nsMsgViewFlagsTypeValue |
Constants are defined in nsMsgViewFlagsType . |
sortType |
nsMsgViewSortTypeValue |
The type of sort being used (i.e. author, date, status, etc). Sort types are defined in nsMsgViewSortType . |
sortOrder |
nsMsgViewSortOrderValue |
Readonly: Constants are defined in nsMsgViewSortOrder . |
keyForFirstSelectedMessage |
nsMsgKey |
Readonly: The key of the first message in the current selection. nsMsgKey is defined as an unsigned long in MailNewsTypes2.idl. |
viewIndexForFirstSelectedMsg |
nsMsgViewIndex |
Readonly: The index of the first selected message. nsMsgViewIndex is defined as a unsigned long in MailNewsTypes2.idl. |
msgFolder |
|
Readonly: The current folder. |
viewFolder |
|
|
URIForFirstSelectedMessage |
|
Readonly: URL of the first selected message. |
hdrForFirstSelectedMessage |
|
Readonly: Header of the first selected message. |
numSelected |
long |
Readonly: The number of messages currently selected. |
msgToSelectAfterDelete |
nsMsgViewIndex |
Readonly: The index of the message to select after the current one is deleted. nsMsgViewIndex is defined as a unsigned long in MailNewsTypes2.idl. |
currentlyDisplayedMessage |
nsMsgViewIndex |
Readonly: The index of the currently displayed message. nsMsgViewIndex is defined as a unsigned long in MailNewsTypes2.idl. |
suppressMsgDisplay |
boolean |
Suppress displaying messages. Used when the message pane is collapsed. |
suppressCommandUpdating |
boolean |
Suppress command updating. Used during folder loading. |
db |
|
Readonly: The current database of messages. |
supportsThreading |
boolean |
Readonly: Does the current database support threading? |
searchSession |
|
The current search session. |
removeRowOnMoveOrDelete |
boolean |
Readonly: |
usingLines |
boolean |
Readonly: Use lines for size. If false kB are used. |
Opens a folder in the database.
void open(in nsIMsgFolder folder, in nsMsgViewSortTypeValue sortType, in nsMsgViewSortOrderValue sortOrder, in nsMsgViewFlagsTypeValue viewFlags, out long count);
folder
nsIMsgFolder
to open.sortType
nsMsgViewSortTypeValue
designating the sort type used for the folder. Defined in the interface: nsMsgViewSortType
.sortOrder
nsMsgViewSortOrder
.viewFlags
nsMsgViewFlagsType
.count
Opens the view with a set of specified headers.
void openWithHdrs(in nsISimpleEnumerator aHeaders, in nsMsgViewSortTypeValue aSortType, in nsMsgViewSortOrderValue aSortOrder, in nsMsgViewFlagsTypeValue aViewFlags, out long aCount);
aHeaders
nsISimpleEnumerator
.aSortType
nsMsgViewSortTypeValue
designating the sort type used for the folder. Defined in the interface: nsMsgViewSortType
.sortOrder
nsMsgViewSortOrder
.viewFlags
nsMsgViewFlagsType
.aCount
Close the current list of messages.
void close();
Initializes the database view for use.
void init(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater);
aMessengerInstance
aMsgWindow
aCommandUpdater
Sorts the currently loaded messages.
void sort(in nsMsgViewSortTypeValue sortType, in nsMsgViewSortOrderValue sortOrder);
sortType
nsMsgViewSortTypeValue
designating the sort type used. Defined in the interface: nsMsgViewSortType
.sortOrder
nsMsgViewSortOrder
.Perform a command on the currently loaded messages.
void doCommand(in nsMsgViewCommandTypeValue command);
command
nsMsgViewCommandTypeValue
to perform. Defined in the interface: nsMsgViewCommandType
.Perform a command that requires a folder. Typical examples are move
or copy
commands.
void doCommandWithFolder(in nsMsgViewCommandTypeValue command, in nsIMsgFolder destFolder);
command
nsMsgViewCommandTypeValue
to perform. Defined in the interface: nsMsgViewCommandType
.destFolder
Gets the status of a particular command. Used by the Thunderbird UI to determine if the command is available.
void getCommandStatus(in nsMsgViewCommandTypeValue command, out boolean selectable_p, out nsMsgViewCommandCheckStateValue selected_p);
command
nsMsgViewCommandTypeValue
to perform. Defined in the interface: nsMsgViewCommandType
.selectable_p
true
if it is enabled. false
if it is disabled.selected_p
nsMsgViewCommandCheckState
. This is not used for all commands and will return the notUsed
value most of the time.Change the view to show a particular message. This method will automatically expand the destination thread.
void viewNavigate(in nsMsgNavigationTypeValue motion, out nsMsgKey resultId, out nsMsgViewIndex resultIndex, out nsMsgViewIndex threadIndex, in boolean wrap);
motion
nsMsgNavigationTypeValue
. Defined in the interface: nsMsgNavigationType
.wrap
resultId
nsMsgKey
is defined as an unsigned long
in MailNewsTypes2.idl.resultIndex
nsMsgViewIndex
is defined as a unsigned long
in MailNewsTypes2.idl.threadIndex
nsMsgViewIndex
is defined as a unsigned long
in MailNewsTypes2.idl.Indicates if the passed motion type is currently valid.
boolean navigateStatus(in nsMsgNavigationTypeValue motion);
motion
nsMsgNavigationTypeValue
. Defined in ther interface: nsMsgNavigationType
.Gets the key for the message at a particular index.
nsMsgKey getKeyAt(in nsMsgViewIndex index);
index
nsMsgViewIndex
is defined as a unsigned long
in MailNewsTypes2.idl.The key of the message. nsMsgKey
is defined as an unsigned long
in MailNewsTypes2.idl.
Mainly for search. Gets the folder of the message at a particular index.
nsIMsgFolder getFolderForViewIndex(in nsMsgViewIndex index);
index
nsMsgViewIndex
is defined as a unsigned long
in MailNewsTypes2.idl.nsIMsgFolder
containing the message.Gets the URL for the message at the given index.
ACString getURIForViewIndex(in nsMsgViewIndex index);
index
URL
for>. nsMsgViewIndex
is defined as a unsigned long
in MailNewsTypes2.idl.Clones this nsIMsgDBView.
nsIMsgDBView cloneDBView(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater);
aMessengerInstance
nsIMessenger
to use in the clone.aMsgWindow
nsIMsgWindow
to use in the clone.aCommandUpdater
nsIMsgDBViewCommandUpdater
to use in the clone.Gets an arry of URLs for all currently selected messages.
void getURIsForSelection([array, size_is(count)] out string uris, out unsigned long count);
uris
count
Gets the indicies of the selected messages.
void getIndicesForSelection([array, size_is(count)] out nsMsgViewIndex indices, out unsigned long count);
indices
nsMsgViewIndex
which is defined as a unsigned long
in MailNewsTypes2.idl.count
Loads a message into the message pane.
void loadMessageByMsgKey(in nsMsgKey aMsgKey);
aMsgKey
nsMsgKey
is defined as an unsigned long
in MailNewsTypes2.idl.Loads a message into the message pane.
void loadMessageByViewIndex(in nsMsgViewIndex aIndex);
aIndex
nsMsgViewIndex
is defined as a unsigned long
in MailNewsTypes2.idl.Loads a message into the message pane.
void loadMessageByUrl(in string aUrl);
aUrl
Reload the currently shown message.
void reloadMessage();
Reload the currently shown message with fetchCompleteMessage
set to true. This forces everything to be re-downloaded.
void reloadMessageWithAllParts();
Selects a message based on its key. Used by "go to folder" feature and "remember last selected message" feature. If key is not found, nothing is selected.
void selectMsgByKey(in nsMsgKey key);
key
The Key of the message to load. nsMsgKey
is defined as an unsigned long
in MailNewsTypes2.idl.
Selects a message within a folder by its key. This assumes that the key is somewhere in the displayed messages... I think.
void selectFolderMsgByKey(in nsIMsgFolder aFolder, in nsMsgKey aKey);
aFolder
nsIMsgFolder
to search within.aKey
nsMsgKey
is defined as an unsigned long
in MailNewsTypes2.idl.Called when delete is completed on a message. Used to notify the tree that rows are going away.
void onDeleteCompleted(in boolean succeeded);
succeeded
true
if the delete was successful.Gets the index of a message with a particular key.
nsMsgViewIndex findIndexFromKey(in nsMsgKey aMsgKey, in boolean aExpand);
aMsgKey
nsMsgKey
is defined as an unsigned long
in MailNewsTypes2.idl.aExpand
The index of the message. nsMsgViewIndex
is defined as a unsigned long
in MailNewsTypes2.idl.
void ExpandAndSelectThreadByIndex(in nsMsgViewIndex aIndex, in boolean aAugment);
aIndex
nsMsgViewIndex
is defined as a unsigned long
in MailNewsTypes2.idl.aAugment
true
then add to current selection. If false
then replace current selection.Attaches a nsIMsgCustomColumnHandler
to a specific column (can be a new column or a built in).+
void addColumnHandler(in AString aColumn, in nsIMsgCustomColumnHandler aHandler);
aColumn
aHandler
nsIMsgCustomColumnHandler
to add.Removes a nsIMsgCustomColumnHandler
leaving the column to be handled by the system
void removeColumnHandler(in AString aColumn);
aColumn
Returns the nsIMsgCustomColumnHandler
attached to a specific column, if any.
nsIMsgCustomColumnHandler getColumnHandler(in AString aColumn);
aColumn