Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > 9601c7beb4ff23e834bfa171795ed560 > files > 201

vidalia-0.2.9-1mdv2010.1.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Vidalia: LogTreeWidget.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_b47abd1aad201a152869566145babb61.html">src</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_695ba8f8357372e02d38c40b3c6dbe81.html">vidalia</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_b5419f0f3b920f7a66865768144dfe22.html">log</a>
  </div>
</div>
<div class="contents">
<h1>LogTreeWidget.h</h1><a href="_log_tree_widget_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">**  This file is part of Vidalia, and is subject to the license terms in the</span>
<a name="l00003"></a>00003 <span class="comment">**  LICENSE file, found in the top level directory of this distribution. If you</span>
<a name="l00004"></a>00004 <span class="comment">**  did not receive the LICENSE file with this file, you may obtain it from the</span>
<a name="l00005"></a>00005 <span class="comment">**  Vidalia source package distributed by the Vidalia Project at</span>
<a name="l00006"></a>00006 <span class="comment">**  http://www.vidalia-project.net/. No part of Vidalia, including this file,</span>
<a name="l00007"></a>00007 <span class="comment">**  may be copied, modified, propagated, or distributed except according to the</span>
<a name="l00008"></a>00008 <span class="comment">**  terms described in the LICENSE file.</span>
<a name="l00009"></a>00009 <span class="comment">*/</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">/*</span>
<a name="l00012"></a>00012 <span class="comment">** \file LogTreeWidget.h</span>
<a name="l00013"></a>00013 <span class="comment">** \version $Id: LogTreeWidget.h 4054 2009-08-17 02:25:08Z edmanm $ </span>
<a name="l00014"></a>00014 <span class="comment">** \brief Contains a collection of log messages as LogTreeItems</span>
<a name="l00015"></a>00015 <span class="comment">*/</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef _LOGTREEWIDGET_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _LOGTREEWIDGET_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="_log_tree_item_8h.html">LogTreeItem.h</a>&quot;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;<a class="code" href="_tor_control_8h.html">TorControl.h</a>&quot;</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;QList&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;QString&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;QStringList&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;QTreeWidget&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;QHeaderView&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;QShowEvent&gt;</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 
<a name="l00032"></a><a class="code" href="class_log_tree_widget.html">00032</a> <span class="keyword">class </span><a class="code" href="class_log_tree_widget.html">LogTreeWidget</a> : <span class="keyword">public</span> QTreeWidget
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034   Q_OBJECT
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment">  /** Log tree column indices. */</span>
<a name="l00038"></a><a class="code" href="class_log_tree_widget.html#aadf9fda3c5d89369329d5e8c7fdc157c">00038</a>   <span class="keyword">enum</span> <a class="code" href="class_log_tree_widget.html#aadf9fda3c5d89369329d5e8c7fdc157c">LogColumns</a> {
<a name="l00039"></a><a class="code" href="class_log_tree_widget.html#aadf9fda3c5d89369329d5e8c7fdc157ca08b72f107f7cb0e5cdfa4383dc3298ac">00039</a>     <a class="code" href="class_log_tree_widget.html#aadf9fda3c5d89369329d5e8c7fdc157ca08b72f107f7cb0e5cdfa4383dc3298ac">TimeColumn</a>    = 0, <span class="comment">/**&lt; Timestamp column. */</span>
<a name="l00040"></a><a class="code" href="class_log_tree_widget.html#aadf9fda3c5d89369329d5e8c7fdc157ca06fb96c7ca29cc41bc885f91dee49758">00040</a>     <a class="code" href="class_log_tree_widget.html#aadf9fda3c5d89369329d5e8c7fdc157ca06fb96c7ca29cc41bc885f91dee49758">TypeColumn</a>    = 1, <span class="comment">/**&lt; Message severity type column. */</span>
<a name="l00041"></a><a class="code" href="class_log_tree_widget.html#aadf9fda3c5d89369329d5e8c7fdc157cabfe920066beb7a469f3b72b401fe36d3">00041</a>     <a class="code" href="class_log_tree_widget.html#aadf9fda3c5d89369329d5e8c7fdc157cabfe920066beb7a469f3b72b401fe36d3">MessageColumn</a> = 2  <span class="comment">/**&lt; Message text column. */</span>
<a name="l00042"></a>00042   };
<a name="l00043"></a>00043   <span class="comment"></span>
<a name="l00044"></a>00044 <span class="comment">  /** Default constructor. */</span>
<a name="l00045"></a>00045   <a class="code" href="class_log_tree_widget.html#ab856e45a6b799921e122c8ab9454d1c4">LogTreeWidget</a>(QWidget *parent = 0);
<a name="l00046"></a>00046   <span class="comment"></span>
<a name="l00047"></a>00047 <span class="comment">  /** Returns a list of all currently selected messages. */</span>
<a name="l00048"></a>00048   QStringList <a class="code" href="class_log_tree_widget.html#a41ff0009894796431a0bac2fd8b9758f">selectedMessages</a>();<span class="comment"></span>
<a name="l00049"></a>00049 <span class="comment">  /** Returns a list of all messages in the tree. */</span>
<a name="l00050"></a>00050   QStringList <a class="code" href="class_log_tree_widget.html#a1d05f7386ab358f60c5bd90eda3f93e4">allMessages</a>();<span class="comment"></span>
<a name="l00051"></a>00051 <span class="comment">  /** Deselects all currently selected messages. */</span>
<a name="l00052"></a>00052   <span class="keywordtype">void</span> <a class="code" href="class_log_tree_widget.html#ae31d7491220ef0b64459d3bfda9748c2">deselectAll</a>();
<a name="l00053"></a>00053   <span class="comment"></span>
<a name="l00054"></a>00054 <span class="comment">  /** Returns the number of items currently in the tree. */</span>
<a name="l00055"></a>00055   <span class="keywordtype">int</span> <a class="code" href="class_log_tree_widget.html#abc3fa7b075e18afc15a8da3abbe9c7c4">messageCount</a>();<span class="comment"></span>
<a name="l00056"></a>00056 <span class="comment">  /** Sets the maximum number of items in the tree. */</span>
<a name="l00057"></a>00057   <span class="keywordtype">void</span> <a class="code" href="class_log_tree_widget.html#a22f0f868ccbe74e47d88c50a5d9b562b">setMaximumMessageCount</a>(<span class="keywordtype">int</span> max);<span class="comment"></span>
<a name="l00058"></a>00058 <span class="comment">  /** Filters the log according to the specified filter. */</span>
<a name="l00059"></a>00059   <span class="keywordtype">void</span> <a class="code" href="class_log_tree_widget.html#a2bc5192e68b6250fdb0970a259442b30">filter</a>(uint <a class="code" href="class_log_tree_widget.html#a2bc5192e68b6250fdb0970a259442b30">filter</a>);
<a name="l00060"></a>00060   <span class="comment"></span>
<a name="l00061"></a>00061 <span class="comment">  /** Adds a log item to the tree. */</span>
<a name="l00062"></a>00062   <a class="code" href="class_log_tree_item.html">LogTreeItem</a>* <a class="code" href="class_log_tree_widget.html#af4122a365ac1c9fd5eddb150a8ef9e7d">log</a>(<a class="code" href="namespacetc.html#abb893107129c283d2eb0238e46eb3d4c">tc::Severity</a> severity, <span class="keyword">const</span> QString &amp;message);
<a name="l00063"></a>00063   <span class="comment"></span>
<a name="l00064"></a>00064 <span class="comment">  /** Searches the log for entries that contain the given text. */</span>
<a name="l00065"></a>00065   QList&lt;LogTreeItem *&gt; <a class="code" href="class_log_tree_widget.html#a44873975bf7dcb1e168b3a9825dcf40c">find</a>(QString text, <span class="keywordtype">bool</span> highlight = <span class="keyword">true</span>);
<a name="l00066"></a>00066 
<a name="l00067"></a>00067 <span class="keyword">public</span> slots:<span class="comment"></span>
<a name="l00068"></a>00068 <span class="comment">  /** Clears all contents on the message log and resets the counter. */</span>
<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="class_log_tree_widget.html#ae0fadbe6cf82385db47a90db55833684">clearMessages</a>();
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l00072"></a>00072 <span class="comment">  /** Sets the default, initial column header widths. */</span>
<a name="l00073"></a>00073   <span class="keywordtype">void</span> <a class="code" href="class_log_tree_widget.html#a139a86a62d1c502aefe0a0947cfa2c00">showEvent</a>(QShowEvent *event);
<a name="l00074"></a>00074 
<a name="l00075"></a>00075 <span class="keyword">private</span> slots:<span class="comment"></span>
<a name="l00076"></a>00076 <span class="comment">  /** Called when the user moves the vertical scroll bar. */</span>
<a name="l00077"></a>00077   <span class="keywordtype">void</span> <a class="code" href="class_log_tree_widget.html#aabee6ee2b5358f7b09230660ceb6bf36">verticalSliderReleased</a>();
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00080"></a>00080 <span class="comment">  /** Adds &lt;b&gt;item&lt;/b&gt; as a top-level item in the tree. */</span>
<a name="l00081"></a>00081   <span class="keywordtype">void</span> <a class="code" href="class_log_tree_widget.html#a1c2695fc5be0153243d2b0d47a3ba70e">addLogTreeItem</a>(<a class="code" href="class_log_tree_item.html">LogTreeItem</a> *item);<span class="comment"></span>
<a name="l00082"></a>00082 <span class="comment">  /** Casts a QList of one pointer type to another. */</span>
<a name="l00083"></a>00083   QList&lt;LogTreeItem *&gt; <a class="code" href="class_log_tree_widget.html#ae6782f444d5f5e73feea39427e266254">qlist_cast</a>(QList&lt;QTreeWidgetItem *&gt; inlist);<span class="comment"></span>
<a name="l00084"></a>00084 <span class="comment">  /** Sortrs a QList of pointers to tree items. */</span>
<a name="l00085"></a>00085   QList&lt;LogTreeItem *&gt; <a class="code" href="class_log_tree_widget.html#a54187221981404877408968392a0ceec">qlist_sort</a>(QList&lt;LogTreeItem *&gt; inlist);
<a name="l00086"></a>00086 <span class="comment"></span>
<a name="l00087"></a>00087 <span class="comment">  /**&lt; List of pointers to all log message items currently in the tree. */</span>
<a name="l00088"></a><a class="code" href="class_log_tree_widget.html#a00e972ecb35ded59b75b4712554c97cd">00088</a>   QList&lt;LogTreeItem *&gt; <a class="code" href="class_log_tree_widget.html#a00e972ecb35ded59b75b4712554c97cd">_itemHistory</a>;
<a name="l00089"></a><a class="code" href="class_log_tree_widget.html#a58ea256dcd531b5ba185d0c7ea64f852">00089</a>   <span class="keywordtype">int</span> <a class="code" href="class_log_tree_widget.html#a58ea256dcd531b5ba185d0c7ea64f852">_maxItemCount</a>; <span class="comment">/**&lt; Maximum number of items in the tree. */</span>
<a name="l00090"></a><a class="code" href="class_log_tree_widget.html#a8398670bee4cddcda5ea71a4084979c8">00090</a>   <span class="keywordtype">bool</span> <a class="code" href="class_log_tree_widget.html#a8398670bee4cddcda5ea71a4084979c8">_scrollOnNewItem</a>; <span class="comment">/**&lt; Set to true if we are to scroll to the new item</span>
<a name="l00091"></a>00091 <span class="comment">                               after adding a message to the log. */</span>
<a name="l00092"></a>00092 };
<a name="l00093"></a>00093   
<a name="l00094"></a>00094 <span class="preprocessor">#endif</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Aug 30 22:58:54 2010 for Vidalia by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>