diff options
Diffstat (limited to 'plugins/Page.hpp')
-rw-r--r-- | plugins/Page.hpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/Page.hpp b/plugins/Page.hpp index e60c752..39d76d6 100644 --- a/plugins/Page.hpp +++ b/plugins/Page.hpp @@ -59,6 +59,9 @@ namespace QuickMedia { // Mutually exclusive with |get_type| when |get_type| is not PageTypez::REGULAR virtual bool is_single_page() const { return false; } virtual bool is_trackable() const { return false; } + // Return nullptr if bookmark is not supported by this page + virtual const char* get_bookmark_name() const { return nullptr; } + virtual bool is_bookmark_page() const { return false; } virtual bool is_lazy_fetch_page() const { return false; } // Note: If submit is done without any selection, then the search term is sent as the |title| and |url|. Submit will only be sent if the input text is not empty or if an item is selected virtual bool allow_submit_no_selection() const { return false; } @@ -76,7 +79,7 @@ namespace QuickMedia { Program *program; std::shared_ptr<BodyItem> submit_body_item; // TODO: Remove this - bool needs_refresh = false; // Set to true to refresh the page + bool needs_refresh = false; // Set to true to refresh the page. Note: only works for search pages and lazy fetch pages }; enum class TrackResult { @@ -153,4 +156,17 @@ namespace QuickMedia { protected: std::string url; }; + + class BookmarksPage : public LazyFetchPage { + public: + BookmarksPage(Program *program, Page *redirect_page) : LazyFetchPage(program), redirect_page(redirect_page) {} + const char* get_title() const override { return "Bookmarks"; } + PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override; + PluginResult lazy_fetch(BodyItems &result_items) override; + bool reload_on_page_change() override { return true; } + const char* get_bookmark_name() const override { return redirect_page->get_bookmark_name(); } + bool is_bookmark_page() const override { return true; } + private: + Page *redirect_page; + }; }
\ No newline at end of file |