ocarina/include/tabs.h

83 lines
1.4 KiB
C++

/*
* Copyright 2014 (c) Anna Schumaker.
*/
#ifndef OCARINA_TABS_H
#define OCARINA_TABS_H
#include <ocarina.h>
#include <playqueue.h>
class Tab {
private:
std::set<unsigned int> visible_ids;
Glib::RefPtr<Gtk::TreeModelFilter> tab_filter;
protected:
Playqueue *tab_pq;
Glib::RefPtr<PlayqueueModel> tab_model;
/**
* Widgets that MUST be set by a child class
*/
Gtk::SearchEntry *tab_search;
Gtk::TreeView *tab_treeview;
Gtk::Widget *tab_widget;
/**
* Optional widgets that MAY be set
*/
Gtk::ToggleButton *tab_random;
Gtk::Label *tab_size;
/**
* Class helper functions
*/
void tab_init_random();
bool tab_is_cur();
void tab_set_size();
void tab_unmap();
public:
Tab(Playqueue *);
virtual ~Tab();
/**
* More helper functions
*/
void tab_finish_init();
int tab_page_num();
void tab_runtime_changed();
/**
* internal callback functions
*/
virtual void on_post_init();
virtual void on_track_added(unsigned int);
virtual void on_track_deleted(unsigned int);
/**
* GTK-MM callback functions
*/
void on_random_toggled();
/* Filtering functions */
bool on_filter_visible(const Gtk::TreeIter &);
bool on_entry_key_released(GdkEventKey *);
void on_entry_changed();
};
void init_tabs();
void post_init_tabs();
void cleanup_tabs();
void init_collection_tab();
void init_history_tab();
void init_playlist_tab();
#endif /* OCARINA_TABS_H */