#include <wscout_gui_trace.hh>
Public Types | |
enum | { set_position_update_delay = 0, scroll_contents_by_update_delay = 20, packet_spacing = 4, trace_vmargin = packet_spacing, trace_hmargin = 8 } |
Public Slots | |
void | setPosition (int p=0) |
void | setSwapContent (bool b=false) |
virtual void | update () |
Signals | |
void | traceChanged () |
void | positionChanged (int) |
void | packetLeftClicked (int) |
void | packetDoubleLeftClicked (int) |
Public Member Functions | |
Trace (pcapxx::descriptor<> *trace=0, QWidget *parent=0) | |
Trace (const Trace &t) | |
virtual | ~Trace () |
void | setTrace (pcapxx::descriptor<> *t=0) |
const pcapxx::descriptor * | trace () const |
pcapxx::descriptor * | trace () |
int | position () const |
int | lastPosition () const |
QString | positionString (int pos=-1) const |
bool | swapContent () const |
int | lastLeftClicked () const |
void | writeSelection (const QString &file) |
Protected Member Functions | |
Qt overrided functions | |
virtual void | keyPressEvent (QKeyEvent *) |
virtual void | mouseMoveEvent (QMouseEvent *) |
virtual void | mousePressEvent (QMouseEvent *) |
virtual void | mouseDoubleClickEvent (QMouseEvent *) |
virtual void | resizeEvent (QResizeEvent *) |
virtual void | scrollContentsBy (int, int) |
Properties | |
int | position |
bool | swapContent |
Classes | |
struct | selection |
anonymous enum |
set_position_update_delay | Delay before updating after a call to setPosition(). |
scroll_contents_by_update_delay | Delay before updating after the scrollbar has been moved. |
packet_spacing | Space between packets. |
trace_vmargin | Vertical margins (top and bottom). |
trace_hmargin | Horizontal margins (left and right). |
wscout::gui::Trace::Trace | ( | pcapxx::descriptor<> * | trace = 0 , |
|
QWidget * | parent = 0 | |||
) | [inline, explicit] |
wscout::gui::Trace::Trace | ( | const Trace & | t | ) | [inline] |
wscout::gui::Trace::~Trace | ( | ) | [virtual] |
Destructor.
void wscout::gui::Trace::setTrace | ( | pcapxx::descriptor<> * | t = 0 |
) | [inline] |
Change the underlying pcapxx::descriptor
instance.
References lastPosition(), setPosition(), and traceChanged().
Referenced by Trace().
const pcapxx::descriptor * wscout::gui::Trace::trace | ( | ) | const [inline] |
Retrieve the underlying pcapxx::descriptor
instance.
Referenced by wscout::gui::MainWindow::filter(), wscout::gui::MainWindow::find(), wscout::gui::PcapHeader::nextHeader(), and Trace().
pcapxx::descriptor * wscout::gui::Trace::trace | ( | ) | [inline] |
Retrieve the underlying pcapxx::descriptor
instance.
int wscout::gui::Trace::position | ( | ) | const |
Current position in the underlying pcapxx::descriptor
instance.
Referenced by positionString(), and update().
int wscout::gui::Trace::lastPosition | ( | ) | const [inline] |
Last position in the underlying pcapxx::descriptor
instance.
Referenced by positionString(), setPosition(), and setTrace().
QString wscout::gui::Trace::positionString | ( | int | pos = -1 |
) | const [inline] |
Get a summary of a given position as a string.
This summary consists of the current position, the last position, and the ratio of the two.
e.g.
42 / 84 (50%)
[in] | pos | The position to summarize. By default the current position. |
References lastPosition(), and position().
bool wscout::gui::Trace::swapContent | ( | ) | const |
Get whether this trace's packets contain swapped data.
For instance, some traces hold Prism headers which endianness is inconsistent with the PCAP endianness. Thus the swapContent property allows to override the PCAP endianness.
int wscout::gui::Trace::lastLeftClicked | ( | ) | const [inline] |
Get the last left clicked packet, or -1.
void wscout::gui::Trace::writeSelection | ( | const QString & | file | ) |
Write selected packets into a separate PCAP file.
Referenced by wscout::gui::MainWindow::writeSelection().
void wscout::gui::Trace::traceChanged | ( | ) | [signal] |
void wscout::gui::Trace::positionChanged | ( | int | _t1 | ) | [signal] |
The current position changed.
void wscout::gui::Trace::packetLeftClicked | ( | int | _t1 | ) | [signal] |
A packet has been left clicked.
void wscout::gui::Trace::packetDoubleLeftClicked | ( | int | _t1 | ) | [signal] |
A packet has been double left clicked.
void wscout::gui::Trace::setPosition | ( | int | p = 0 |
) | [slot] |
Change the current position.
References lastPosition(), and set_position_update_delay.
Referenced by wscout::gui::MainWindow::backward(), wscout::gui::MainWindow::begin(), wscout::gui::MainWindow::end(), wscout::gui::MainWindow::forward(), and setTrace().
void wscout::gui::Trace::setSwapContent | ( | bool | b = false |
) | [slot] |
void wscout::gui::Trace::update | ( | ) | [virtual, slot] |
Update the widget's content.
References packet_spacing, position(), wscout::gui::Packet::setSelected(), wscout::gui::Packet::setup(), and trace_vmargin.
Referenced by setSwapContent(), and Trace().
int wscout::gui::Trace::position [inline, read, write] |
Position in the underlying pcapxx::descriptor
instance.