RouterDescriptorView.h

Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.vidalia-project.net/. No part of Vidalia, including this file,
00007 **  may be copied, modified, propagated, or distributed except according to the
00008 **  terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file RouterDescriptorView.h
00013 ** \version $Id: RouterDescriptorView.h 3735 2009-04-28 20:28:01Z edmanm $
00014 ** \brief Formats and displays a router descriptor as HTML
00015 */
00016 
00017 #ifndef _ROUTERDESCRIPTORVIEW_H
00018 #define _ROUTERDESCRIPTORVIEW_H
00019 
00020 #include "RouterDescriptor.h"
00021 
00022 #include <QObject>
00023 #include <QTextEdit>
00024 #include <QList>
00025 #include <QContextMenuEvent>
00026 
00027 
00028 class RouterDescriptorView : public QTextEdit
00029 {
00030   Q_OBJECT
00031 
00032 public:
00033   /** Default constructor. */
00034   RouterDescriptorView(QWidget *parent = 0);
00035 
00036 public slots:
00037   /** Shows the given router descriptor. */
00038   void display(RouterDescriptor rd);
00039   /** Shows all router descriptors in the given list. */
00040   void display(QList<RouterDescriptor> rdlist);
00041   /** Copies any selected text to the clipboard. */
00042   void copySelectedText();
00043 
00044 protected:
00045   /** Displays a context menu for the user when they right-click on the
00046    * widget. */
00047   virtual void contextMenuEvent(QContextMenuEvent *event);
00048 
00049 private:
00050   /** Adjusts the displayed uptime to include time since the
00051    * router's descriptor was last published. */
00052   quint64 adjustUptime(quint64 uptime, QDateTime published);
00053 };
00054 
00055 #endif
00056 

Generated on Mon Aug 30 19:09:59 2010 for Vidalia by  doxygen 1.5.9