#ifndef NEWSBEUTER_FEEDLIST_FORMACTION__H #define NEWSBEUTER_FEEDLIST_FORMACTION__H #include #include #include #include #include namespace newsbeuter { typedef std::pair, unsigned int> feedptr_pos_pair; class feedlist_formaction : public formaction { public: feedlist_formaction(view *, std::string formstr); virtual ~feedlist_formaction(); virtual void prepare(); virtual void init(); void set_feedlist(std::vector>& feeds); void update_visible_feeds(std::vector>& feeds); void set_tags(const std::vector& t); virtual keymap_hint_entry * get_keymap_hint(); std::shared_ptr get_feed(); virtual void set_redraw(bool b) { formaction::set_redraw(b); apply_filter = !(v->get_cfg()->get_configvalue_as_bool("show-read-feeds")); } virtual std::string id() const { return "feedlist"; } virtual std::string title(); bool jump_to_next_unread_feed(unsigned int& feedpos); bool jump_to_previous_unread_feed(unsigned int& feedpos); bool jump_to_next_feed(unsigned int& feedpos); bool jump_to_previous_feed(unsigned int& feedpos); bool jump_to_random_unread_feed(unsigned int& feedpos); virtual void handle_cmdline(const std::string& cmd); virtual void finished_qna(operation op); void mark_pos_if_visible(unsigned int pos); void set_regexmanager(regexmanager * r); private: int get_pos(unsigned int realidx); virtual void process_operation(operation op, bool automatic = false, std::vector * args = NULL); void goto_feed(const std::string& str); void save_filterpos(); void op_end_setfilter(); void op_start_search(); void handle_cmdline_num(unsigned int idx); void set_pos(); std::string get_title(std::shared_ptr feed); std::string format_line(const std::string& feedlist_format, std::shared_ptr feed, unsigned int pos, unsigned int width); bool zero_feedpos; unsigned int feeds_shown; bool quit; std::vector visible_feeds; std::string tag; std::vector tags; matcher m; bool apply_filter; history filterhistory; std::shared_ptr search_dummy_feed; unsigned int filterpos; bool set_filterpos; regexmanager * rxman; unsigned int old_width; unsigned int unread_feeds; unsigned int total_feeds; std::string old_sort_order; }; } #endif