/* * Copyright 2014 (c) Anna Schumaker. */ #ifndef OCARINA_TABS_H #define OCARINA_TABS_H #include #include class Tab { private: std::set visible_ids; unsigned int tab_sorting_count; std::string tab_sorting_title; protected: Playqueue *tab_pq; Glib::RefPtr tab_model; Glib::RefPtr tab_filter; /** * 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::ToggleButton *tab_repeat; Gtk::Label *tab_size; /** * Class helper functions */ void tab_init_random(); void tab_init_repeat(); void tab_toggle_button(Gtk::ToggleButton *, playqueue_flags); void tab_dec_sort_count(); virtual void tab_set_size(); void tab_unmap(); public: Tab(Playqueue *); virtual ~Tab(); /** * More helper functions */ void tab_finish_init(); int tab_page_num(); bool tab_is_cur(); void tab_runtime_changed(); void tab_display_sorting(); void tab_focus_search(); void tab_selected_ids(std::vector &); void tab_queue_add(Playqueue *); bool tab_queue_selected(bool); bool tab_add_to_queue(unsigned int); bool tab_add_to_playlist(const std::string &); bool tab_favorite_selected(); void tab_ban_selected(); /** * internal callback functions that can be overridden if necessary */ virtual void on_post_init(); virtual void on_track_added(unsigned int); virtual void on_track_deleted(unsigned int); virtual void on_track_changed(unsigned int); virtual bool on_key_press_event(const std::string &); virtual void on_show_rc_menu(); /** * GTK-MM callback functions */ void on_random_toggled(); void on_repeat_toggled(); void on_row_activated(const Gtk::TreePath &, Gtk::TreeViewColumn *); bool on_key_pressed(GdkEventKey *); void on_column_clicked(unsigned int); bool on_button_pressed(GdkEventButton *); /* Filtering functions */ bool on_filter_visible(const Gtk::TreeIter &); bool on_entry_key_released(GdkEventKey *); void on_entry_changed(); }; Tab *find_tab(Playqueue *); void tab_focus_search(); void init_tabs(); void post_init_tabs(); void cleanup_tabs(); void init_collection_tab(); void init_history_tab(); void init_playlist_tab(); void init_queue_tabs(); #endif /* OCARINA_TABS_H */