
#include <QDialog>

#include <stdint.h>
#include "ui_mem_view.h"
#include "history.hh"

class MemModel;
class RegModel;
class EventModel;

class MemView : public QDialog, public Ui_Dialog
{
  Q_OBJECT;

public:
  MemView(HistoryBase *hist, uint64_t addr, uint64_t size, QWidget *parent = 0);

public slots:
  void showAllEvents();
  void showMemEvents(const QModelIndex &index);
  void showRegEvents(const QModelIndex &index);
  void showDate(const QModelIndex &index);
  void showEvent(const QModelIndex &index);
  void newView();
  void addrEntered();
  void newEvent(unsigned int date, unsigned int type, qulonglong addr, qulonglong size);
  void initEvent();

private:
  void timerEvent(QTimerEvent *event);

  int _track_timer;
  HistoryBase::history_date_t _last_date;
  uint64_t _last_addr;
  uint64_t _last_size;

  MemModel *_mmodel;
  RegModel *_rmodel;
  EventModel *_emodel;
  HistoryBase *_hist;
};

