This file is indexed.

/usr/share/doc/qmf/html/messagenavigator.html is in qmf-doc-html 1.0.7~2011w23.2-2.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- messagenavigator.qdoc -->
<head>
  <title>MessageNavigator Example</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qtlogo.png" align="left" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
<td align="right" valign="top" width="230"><img src="images/codeless.png"  border="0" /></td></tr></table><h1 class="title">MessageNavigator Example<br /><span class="subtitle"></span>
</h1>
<p>The MessageNavigator example shows how to create a client application which displays messages stored by the Messaging Framework. The example application allows the user to browse for messages using a tree view to expose the hierarchical structure of email accounts that use folders. It displays the messages in each folder in a list, and when a message is selected, it uses Qt Extended services to delegate the display of the message to another application.</p>
<p align="center"><img src="images/messagenavigator-example.png" alt="Screenshot of the MessageNavigator example" /></p><p>The application is structured as a stack of widgets, contained by a <a href="http://doc.trolltech.com/4.5/qstackedwidget.html">QStackedWidget</a>. We need two widgets in our stack: one to select a folder from a tree, and another to select a message from a list.</p>
<p>The example application uses the Messaging Framework Client library's <a href="qmailmessagesetmodel.html">QMailMessageSetModel</a> class to build a model of the messages in the Qt Extended mail store. It divides all the messages into groups, first by the account to which they belong, and within an account, by the folder where they are located. This task is performed by subclassing the <a href="qmailmessagesetmodel.html">QMailMessageSetModel</a> class to create our FolderModel class:</p>
<pre></pre>
<p>The base class is specialized in two ways. The content of the model is determined by adding the necessary items in the constructor, and the data elements that are displayed for each item are augmented with an icon by overriding the <a href="qmailmessagesetmodel.html#data">data</a> function.</p>
<p>The content of the model is configured by appending the items we want to display to the model, in the constructor. To the empty model, we successively append a new <a href="qmailaccountmessageset.html">QMailAccountMessageSet</a> item for each account in the mail store:</p>
<pre></pre>
<p>The <a href="qmailaccountmessageset.html">QMailAccountMessageSet</a> class represents a message set defined by selecting all messages associated with the account the item is configured with. The constructor for <a href="qmailaccountmessageset.html">QMailAccountMessageSet</a> takes a parent container to which it should be appended, and the identifier of the account that it should represent. It also takes a third parameter, which is used to specify the optional <tt>hierarchical</tt> property. If <tt>hierarchical</tt> is true, then the <a href="qmailaccountmessageset.html">QMailAccountMessageSet</a> class will automatically maintain a tree of <a href="qmailfoldermessageset.html">QMailFolderMessageSet</a> items as child items, corresponding to the folders belonging to the relevant account in the mail store. This determines the entire content of our model.</p>
<p>In order to customize the display of the items in our tree view, the FolderModel class overrides the <a href="qmailmessagesetmodel.html#data">data</a> function of <a href="qmailmessagesetmodel.html">QMailMessageSetModel</a> and provides data for the <a href="http://doc.trolltech.com/4.5/qt.html#ItemDataRole-enum">Qt::DecorationRole</a> value used by QtopiaItemDelegate:</p>
<pre></pre>
<p>For our application, we create a FolderSelector widget which uses a <a href="http://doc.trolltech.com/4.5/qtreeview.html">QTreeView</a> to present our folder model:</p>
<pre></pre>
<p>When we select an item from the tree view, we extract the <a href="qmailmessageset.html">QMailMessageSet</a> object represented by the selected item, and emit that data to our MessageSelector object:</p>
<pre></pre>
<p>Once we have selected a message set, we will display a listing of the messages defined by that message set. For this, we need a stackable widget to list messages.</p>
<p>The MessageSelector uses a <a href="http://doc.trolltech.com/4.5/qlistview.html">QListView</a> to present a listing of messages associated with a specific contact. To do this, we need to create a model of message data that the <a href="http://doc.trolltech.com/4.5/qlistview.html">QListView</a> will present. Our class therefore contains a <a href="qmailmessagelistmodel.html">QMailMessageListModel</a> object, and a QMailMessageDelegate object, whose responsibility is to render each element in the list view using the data of each message.</p>
<pre></pre>
<p>Now that we have widgets to display our folder model and a message list, we simply need to connect them together:</p>
<pre></pre>
<p>When we have a folder selected from our folder tree, we create a list of messages corresponding to that folder. The <a href="qmailmessagelistmodel.html">QMailMessageListModel</a> provides the setKey() function, which allows the caller to specify the messages to be listed by providing a <a href="qmailmessagekey.html">QMailMessageKey</a> object that selects them from the mail store. We can use the messageKey() function of the <a href="qmailmessageset.html">QMailMessageSet</a> object selected in the FolderSelector to acquire a message key for our model:</p>
<pre></pre>
<p>When the message list has been prepared, we move our message list to the top of the widget stack, in MessageNavigator::showMessageList():</p>
<pre></pre>
<p>Finally, we handle the event where the user selects a message from our list. Rather than displaying the message ourself, we will use the QtopiaServiceRequest mechanism to request that another application handle this task for us. The <tt>Messages</tt> service exports a <tt>viewMessage</tt> function, which takes a <a href="qmailmessageid.html">QMailMessageId</a> object as a parameter; we respond to the user's selection by invoking this service with the identifier of the message that they selected:</p>
<pre></pre>
<p>See also <a href="messageviewer.html">MessageViewer Example</a>.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2010 QtSoftware</td>
<td align="right"><div align="right">Messaging Framework</div></td>
</tr></table></div></address></body>
</html>