// src/jump_to_dialog.hh - Copyright 2005, 2006, University
//               of Padova, dept. of Pure and Applied
//               Mathematics
//
// This file is part of SGPEMv2.
//
// This 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 3 of the License, or
// (at your option) any later version.
//
// SGPEMv2 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 SGPEMv2. If not, see http://www.gnu.org/licenses/.


#ifndef JUMP_TO_DIALOG_HH
#define JUMP_TO_DIALOG_HH 1

#include "sgpemv2/simulation_observer.hh"

#include <gtkmm/dialog.h>
#include <gtkmm/progressbar.h>
#include <gtkmm/builder.h>

namespace sgpem
{
  class JumpToDialog : public Gtk::Dialog, public SimulationObserver
  {
  public:
    JumpToDialog(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& ui);

    unsigned int set_target_instant(unsigned int new_target = 0);
    unsigned int get_target_instant() const;

    void start();

  protected:
    bool on_delete_event(GdkEventAny* event);
    
  private:
    // Hide Dialog::run() to prevent usage
    void run();

    void _on_stop();
    
    void update(const Simulation& changed_simulation);
    
    Gtk::ProgressBar* _progress;

    unsigned int _target_instant;
  };

} //~ namespace sgpem


#endif //~ JUMP_TO_DIALOG_HH
