DB Views (message lists)

The thread pane (aka message list) is driven by classes that implement nsIMsgDBView and inherit from nsMsgDBView. These are the main view classes:

Usually, a view object has parallel arrays, which map directly to lines in the message list:

Message header key
32 bits, combination of message header flags and view-only flags (e.g., collapsed)
The indentation level when in threaded mode.
Cross-folder views only (nsMsgSearchDBView and its descendant, nsMsgXFVirtualFolderDBView)

Most of the time, the thread pane is driven by an nsMsgThreadedDBView object (even when we're in a flat sort). If the user does a quick search or picks a view from the view menu, we create an nsMsgQuickSearchDBView. Advanced search results are displayed with an nsMsgSearchDBView, and cross-folder saved searches use nsMsgXFVirtualFolderDBView, which inherits from nsMsgSearchDBView.

nsMsgGroupView is used when grouping is turned on. One unique thing about nsMsgGroupView is that instead of using the message database's nsMsgThread objects like the other view classes, it uses an nsMsgGroupThread object, which also implements nsIMsgThread.

View Flags and Types

The view flags (external reference) are not exclusive. The view types (external reference) are. These are the values filed in nsIDBFolderInfo to remember the view settings for the folder.

View Interaction with nsITreeView

The nsITreeView methods in nsMsgDBView.cpp control the appearance of the thread pane.


These nsMsgDBView methods set properties,


The theme uses these properties to style the thread pane. See the tutorial for information about styling trees using css, and the Thunderbird source for some example css.


nsITreeView.getCellText (implementation)
Tells the nsITreeView what text to display for a particular row and text column.