mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
rename widgets
This commit is contained in:
parent
38b2ac4f04
commit
57f43e2dd9
28 changed files with 365 additions and 365 deletions
64
src/app/browser/main/tab/page/navigation/history.hpp
Normal file
64
src/app/browser/main/tab/page/navigation/history.hpp
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP
|
||||
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP
|
||||
|
||||
#include <ctime>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/object.h>
|
||||
#include <vector>
|
||||
|
||||
namespace app::browser::main::tab::page::navigation
|
||||
{
|
||||
namespace history
|
||||
{
|
||||
class Back;
|
||||
class Forward;
|
||||
}
|
||||
|
||||
class History : public Gtk::Box
|
||||
{
|
||||
// Components
|
||||
history::Back * historyBack;
|
||||
history::Forward * historyForward;
|
||||
|
||||
int index = -1;
|
||||
|
||||
public:
|
||||
|
||||
// Extras
|
||||
struct Memory
|
||||
{
|
||||
Glib::ustring request;
|
||||
std::time_t time; // event unix time
|
||||
bool permanent; // save in database (on application close) @TODO
|
||||
};
|
||||
|
||||
// Define navigation history storage
|
||||
std::vector<Memory> memory;
|
||||
|
||||
History();
|
||||
|
||||
// Actions
|
||||
void add(
|
||||
const Glib::ustring & REQUEST,
|
||||
const bool & FOLLOW = true
|
||||
);
|
||||
|
||||
void refresh();
|
||||
|
||||
void save(); // @TODO save history to the permanent storage
|
||||
|
||||
bool try_back(
|
||||
Memory & match,
|
||||
const bool & FOLLOW = true
|
||||
);
|
||||
|
||||
bool try_forward(
|
||||
Memory & match,
|
||||
const bool & FOLLOW = true
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP
|
||||
Loading…
Add table
Add a link
Reference in a new issue