mozilla

Revision 136138 of DB Views (message lists)

  • Revision slug: DB_Views_(message_lists)
  • Revision title: DB Views (message lists)
  • Revision id: 136138
  • Created:
  • Creator: Wjjohnst
  • Is current revision? No
  • Comment Formatting

Revision Content

The thread pane (aka message list) is driven by classes that implement {{ Interface("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:

<tt>m_keys</tt>
Message header key
<tt>m_flags</tt>
32 bits, combination of message header flags and view-only flags (e.g., collapsed)
<tt>m_level</tt>
The indentation level when in threaded mode.
<tt>m_folders</tt>
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 {{ Interface("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 {{ Interface("nsIDBFolderInfo") }} to remember the view settings for the folder.


View Interaction with nsITreeView

The {{ Interface("nsITreeView") }} methods in nsMsgDBView.cpp control the appearance of the thread pane.

Properties

These nsMsgDBView methods set properties,

  • {{ Interface-method("nsITreeView", "getRowProperties") }} (implementation)
  • {{ Interface-method("nsITreeView", "getCellPropreties") }} (implementation)

Theming

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.

Text

{{ Interface-method("nsITreeView", "getCellText") }} (implementation)
Tells the {{ Interface("nsITreeView") }} what text to display for a particular row and text column.

Revision Source

<p>The thread pane (aka message list) is driven by classes that implement {{ Interface("nsIMsgDBView") }} and inherit from <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/base/src/nsMsgDBView.h#108">nsMsgDBView</a>. These are the main view classes:
</p>
<ul><li><code>nsMsgThreadedDBView - <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/base/src/nsMsgThreadedDBView.cpp">(implementation)</a></code>
</li><li><code>nsMsgSearchDBView - <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/base/src/nsMsgSearchDBView.cpp">(implementation)</a></code>
</li><li><code>nsMsgQuickSearchDBView - <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/base/src/nsMsgQuickSearchDBView.cpp">(implementation)</a></code>
</li><li><code>nsMsgXFVirtualFolderDBView - <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp">(implementation)</a></code>
</li><li><code>nsMsgGroupView - <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/base/src/nsMsgGroupView.cpp">(implementation)</a></code>
</li></ul>
<p>Usually, a view object has parallel arrays, which map directly to lines in the message list:
</p>
<dl><dt><tt>m_keys</tt>
</dt><dd> Message header key
</dd><dt><tt>m_flags</tt>
</dt><dd> 32 bits, combination of message header flags and view-only flags (e.g., collapsed)
</dd><dt><tt>m_level</tt>
</dt><dd> The indentation level when in threaded mode.
</dd><dt><tt>m_folders</tt>
</dt><dd> Cross-folder views only (<code>nsMsgSearchDBView</code> and its descendant, <code>nsMsgXFVirtualFolderDBView</code>)
</dd></dl>
<p>Most of the time, the thread pane is driven by an <code>nsMsgThreadedDBView</code> 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 <code>nsMsgQuickSearchDBView</code>. Advanced search results are displayed with an <code>nsMsgSearchDBView</code>, and cross-folder saved searches use <code>nsMsgXFVirtualFolderDBView</code>, which inherits from <code>nsMsgSearchDBView</code>.
</p><p><code>nsMsgGroupView</code> is used when grouping is turned on. One unique thing about <code>nsMsgGroupView</code> is that instead of using the message database's <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/db/msgdb/public/nsMsgThread.h#50">nsMsgThread</a> objects like the other view classes, it uses an <code>nsMsgGroupThread</code> object, which also implements {{ Interface("nsIMsgThread") }}.
</p><p><br>
</p>
<h2 name="View_Flags_and_Types"> View Flags and Types </h2>
<p>The <a href="en/NsMsgViewFlagsType">view flags</a> <a class="external" href="http://mxr.mozilla.org/thunderbird/source/mailnews/base/public/nsIMsgDBView.idl#65">(external reference)</a> are not exclusive. The <a href="en/NsMsgViewType">view types</a> <a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/public/nsIMsgDBView.idl#66">(external reference)</a> are. These are the values filed in {{ Interface("nsIDBFolderInfo") }} to remember the view settings for the folder.
</p><p><br>
</p>
<h2 name="View_Interaction_with_nsITreeView"> View Interaction with nsITreeView </h2>
<p>The {{ Interface("nsITreeView") }} methods in <a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgDBView.cpp">nsMsgDBView.cpp</a> control the appearance of the thread pane.
</p>
<h3 name="Properties">Properties</h3>
<p>These nsMsgDBView methods set properties, </p>
<ul><li>{{ Interface-method("nsITreeView", "getRowProperties") }} (<a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgDBView.cpp#1131">implementation</a>)
</li><li>{{ Interface-method("nsITreeView", "getCellPropreties") }} (<a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgDBView.cpp#1164">implementation</a>)
</li></ul>
<h3 name="Theming">Theming</h3>
<p>The theme uses these properties to style the thread pane. See the <a href="en/XUL_Tutorial/Styling_a_Tree">tutorial</a> for information about styling trees using css, and the Thunderbird source for some <a class="external" href="http://mxr.mozilla.org/mailnews/source/mail/themes/qute/mail/mailWindow1.css#85">example css</a>.
</p>
<h3 name="Text">Text</h3>
<dl><dt>{{ Interface-method("nsITreeView", "getCellText") }} (<a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgDBView.cpp#1704">implementation</a>)
</dt><dd> Tells the {{ Interface("nsITreeView") }} what text to display for a particular row and text column.
</dd></dl>
Revert to this revision