#ifndef TTGTVIEW_H
#define TTGTVIEW_H

#include <QWidget>
#include <QHash>
#include "ui_ttgview.h"
#include "querymanager.h"


class QString;
class NewMusicbrainzDialog;

class TtgView : public QWidget, private Ui::TtgView
{
   Q_OBJECT
   
   public :
       enum ServiceTypeEnum {
           MUSICBRAINZ = 1
       };
       Q_DECLARE_FLAGS(ServiceType, ServiceTypeEnum)
       
       TtgView(QWidget *parent = 0);
      
   private slots:
      void addQueryClicked();
      void startClicked();
      
   protected:
       void addServiceType(QString serviceTypeName, int serviceId);
        int initService(ServiceType serviceType);
      
   private:
      void setupTree();
      void addTreeServiceHeading(int id, const QString &heading);
      void addTreeQueryItem(int serviceHeadingId, int queryId, const QString &searchText);
      
      int addQuery(ServiceType serviceType, QString searchText);
      
      ServiceModel::QueryManager m_qm;
      QHash < ServiceType, ServiceModel::Service* > m_services;
      QHash < ServiceType, int > m_managedServiceIdList;
};

#endif
