DB Views (message lists)

  • Revision slug: DB_Views_(message_lists)
  • Revision title: DB Views (message lists)
  • Revision id: 136136
  • Created:
  • Creator: DavidBienvenu
  • Is current revision? No
  • Comment /* View Interaction with nsITreeView */

Revision Content

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

  • nsMsgThreadedDBView
  • nsMsgSearchDBView
  • nsMsgQuickSearchDBView
  • nsMsgXFVirtualFolderDBView
  • nsMsgGroupView

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

  • m_keys - msg hdr key
  • m_flags - 32 bits, combination of msg hdr flags and view-only flags (e.g., collapsed)
  • m_level - the indentation level when in threaded mode).
  • m_folders - cross-folder views only (nsMsgSearchDBView and its descendent, 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 msg db's nsMsgThread objects like the other view classes, it uses an nsMsgGroupThread object, which also implements nsIMsgThread.


View Flags and Types

The view flags are not exclusive. The view types are. These are the values we file out in the nsIDBFolderInfo for a folder in order 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, getRowProperties getCellPropreties

and the theme uses the properties to style the thread pane, e.g., http://mxr.mozilla.org/mailnews/source/mail/themes/qute/mail/mailWindow1.css#85

getCellText tells the treeview 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 <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/base/public/nsIMsgDBView.idl#247">nsIMsgDBView</a> 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>nsMsgThreadedDBView 
</li><li>nsMsgSearchDBView
</li><li>nsMsgQuickSearchDBView
</li><li>nsMsgXFVirtualFolderDBView
</li><li>nsMsgGroupView
</li></ul>
<p>Usually, a view object has parallel arrays, which map directly to lines in the message list:
</p>
<ul><li>m_keys - msg hdr key
</li><li>m_flags - 32 bits, combination of msg hdr flags and view-only flags (e.g., collapsed)
</li><li>m_level - the indentation level when in threaded mode).
</li><li>m_folders - cross-folder views only (nsMsgSearchDBView and its descendent, nsMsgXFVirtualFolderDBView)
</li></ul>
<p>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.
</p><p>nsMsgGroupView is used when grouping is turned on. One unique thing about nsMsgGroupView is that instead of using the msg db'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 nsMsgGroupThread object, which also implements <a class="external" href="http://mxr.mozilla.org/mailnews/source/mailnews/base/public/nsIMsgThread.idl#47">nsIMsgThread</a>.
</p><p><br>
</p>
<h3 name="View_Flags_and_Types"> View Flags and Types </h3>
<p>The <a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/public/nsIMsgDBView.idl#76">view flags</a> are not exclusive. The <a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/public/nsIMsgDBView.idl#66">view types</a> are. These are the values we file out in the nsIDBFolderInfo for a folder in order to remember the view settings for the folder.
</p><p><br>
</p>
<h3 name="View_Interaction_with_nsITreeView"> View Interaction with nsITreeView </h3>
<p>The <a class="external" href="http://mxr.mozilla.org/mozilla/source/layout/xul/base/src/tree/public/nsITreeView.idl#48">nsITreeView</a> methods in nsMsgDBView.cpp control the appearance of the thread pane.
</p><p>These nsMsgDBView methods set properties, 
<a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgDBView.cpp#1131">getRowProperties</a> 
<a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgDBView.cpp#1164">getCellPropreties</a>
</p><p>and the theme uses the properties to style the thread pane, e.g., http://mxr.mozilla.org/mailnews/source/mail/themes/qute/mail/mailWindow1.css#85
</p><p><a class="external" href="http://mxr.mozilla.org/mozilla/source/mailnews/base/src/nsMsgDBView.cpp#1704">getCellText</a> tells the treeview what text to display for a particular row and text column.
</p>
Revert to this revision