dtkWidgetsLogView_p.h 2.5 KB
Newer Older
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
/* dtkWidgetsLogView_p.h ---
 *
 * Author: Julien Wintz
 * Copyright (C) 2008-2011 - Julien Wintz, Inria.
 * Created: Fri Mar  2 15:30:16 2012 (+0100)
 * Version: $Id$
 * Last-Updated: Tue Mar  6 10:04:35 2012 (+0100)
 *           By: Julien Wintz
 *     Update #: 66
 */

/* Commentary:
 *
 */

/* Change log:
 *
 */

#ifndef DTKWIDGETSLOGVIEW_P_H
#define DTKWIDGETSLOGVIEW_P_H

#include <dtkLog/dtkLogger.h>

#include <QtWidgets>

class dtkLogModel;

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogViewBar
// /////////////////////////////////////////////////////////////////

class dtkWidgetsLogViewBar : public QFrame
{
    Q_OBJECT

public:
38
    dtkWidgetsLogViewBar(QWidget *parent = 0);
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    ~dtkWidgetsLogViewBar(void);

signals:
    void displayTrace(bool);
    void displayDebug(bool);
    void displayInfo(bool);
    void displayWarn(bool);
    void displayError(bool);
    void displayFatal(bool);
};

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogViewTree
// /////////////////////////////////////////////////////////////////

class dtkWidgetsLogViewTree : public QTreeWidget
{
    Q_OBJECT

public:
59
    dtkWidgetsLogViewTree(QWidget *parent = 0);
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
    ~dtkWidgetsLogViewTree(void);

signals:
    void runtimeClicked(void);
    void fileClicked(const QString& path);

protected slots:
    void onItemClicked(QTreeWidgetItem *, int);

private:
    QTreeWidgetItem *runtime;
    QTreeWidgetItem *file;
};

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogViewList
// /////////////////////////////////////////////////////////////////

class dtkWidgetsLogViewList : public QListView
{
    Q_OBJECT

public:
83
    dtkWidgetsLogViewList(QWidget *parent = 0);
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
    ~dtkWidgetsLogViewList(void);

public slots:
    void setRuntime(void);
    void setFile(const QString& path);
    void setAutoScroll(bool autoScroll);

public:
    void setFilter(const QRegExp& expression);

private:
    dtkLogModel *model;

private:
    QHash<QString, QStringListModel *> models;

private:
    QSortFilterProxyModel *proxy;
};

// /////////////////////////////////////////////////////////////////
// dtkWidgetsLogViewPrivate
// /////////////////////////////////////////////////////////////////

class dtkWidgetsLogViewPrivate
{
public:
    QRegExp expression(void);

public:
    dtkWidgetsLogViewBar  *bar;
    dtkWidgetsLogViewTree *tree;
    dtkWidgetsLogViewList *list;

public:
    QStringList exclude;

121
public:
122 123 124 125
    QCheckBox *checkbox_auto_scroll;
};

#endif