6dfb3c31e2
I'm going to have a lot of queue-related files soon, so let's make things easier by keeping everything in a new directory. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
/*
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_GUI_QUEUE_MODEL_H
|
|
#define OCARINA_GUI_QUEUE_MODEL_H
|
|
|
|
#include <core/queue.h>
|
|
#include <gtkmm.h>
|
|
|
|
class QueueModel : public Gtk::TreeModel, public Glib::Object {
|
|
private:
|
|
int _stamp;
|
|
Queue *_queue;
|
|
|
|
void increment_stamp();
|
|
bool check_iter_validity(const Gtk::TreeIter &) const;
|
|
|
|
protected:
|
|
/* Inherited from Gtk::TreeModel */
|
|
Gtk::TreeModelFlags get_flags_vfunc() const;
|
|
int get_n_columns_vfunc() const;
|
|
GType get_column_type_vfunc(int) const;
|
|
void get_value_vfunc(const Gtk::TreeIter &, int, Glib::ValueBase &) const;
|
|
bool iter_next_vfunc(const Gtk::TreeIter &, Gtk::TreeIter &) const;
|
|
int iter_n_root_children_vfunc() const;
|
|
bool iter_nth_root_child_vfunc(int, Gtk::TreeIter &) const;
|
|
Gtk::TreeModel::Path get_path_vfunc(const Gtk::TreeIter &) const;
|
|
bool get_iter_vfunc(const Gtk::TreePath &, Gtk::TreeIter &) const;
|
|
|
|
public:
|
|
QueueModel(Queue *);
|
|
|
|
void on_row_inserted(unsigned int);
|
|
void on_row_deleted(unsigned int);
|
|
void on_row_changed(unsigned int);
|
|
void on_path_selected(const Gtk::TreePath &);
|
|
unsigned int iter_to_id(const Gtk::TreeIter &) const;
|
|
unsigned int path_to_id(const Gtk::TreePath &) const;
|
|
};
|
|
|
|
#endif /* OCARINA_GUI_QUEUE_MODEL_H */
|