/*
    Header for the main dialog.
    Copyright (C) 2007 Tim Beaulen <tbscope@gmail.com>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/

#include "ui_backenddebugger.h"

#include <QDialog>
#include <QtXml>
#include <QTimer>
#include <QIcon>
#include <QDBusVariant>

#include "backenddebugger_interface.h"
#include "backenditem.h"

#ifndef BACKENDDEBUGGERFORM_H
#define BACKENDDEBUGGERFORM_H

class BackendDebuggerForm : public QDialog
{
    Q_OBJECT

public:
    BackendDebuggerForm(QWidget *parent = 0);

private slots:
    void updateMessageList();
    void newMessage(int type, int level, const QString &objname, const QString &message);
    void updateDBusStatus();
    void turnOffLed();
    void newBackend(const QString &xmlStructure);
    void updateBackend(const QString &xmlStructure);
    void removeBackend(const QString &xmlStructure);

private:
    //void redraw();

    PhononGStreamerBackendDebuggerInterface *m_interface;
    void setupPipelineView();
    void setupLevelCombo();
    void setupMessageList();
    void setupObjectCombo();
    void updateSceneBoundingRect();

    QDomDocument m_domDoc;

    QIcon m_pulseIcon;
    QTimer *pulseTimer;
    Ui::BackendDebuggerForm ui;

    QList<BackendItem*> m_backendItems;
};

#endif
