Yoda/src/app/browser/main/tab/page/navigation.hpp

80 lines
2.2 KiB
C++
Raw Normal View History

2024-09-04 23:16:43 +03:00
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP
2024-08-13 08:28:33 +03:00
2024-09-08 03:49:08 +03:00
#include <giomm/simpleaction.h>
#include <glibmm/refptr.h>
2024-08-14 09:16:45 +03:00
#include <glibmm/ustring.h>
2024-08-13 08:28:33 +03:00
#include <gtkmm/box.h>
2024-09-02 16:25:31 +03:00
#include <gtkmm/object.h>
2024-08-13 08:28:33 +03:00
2024-08-15 18:52:11 +03:00
namespace app::browser::main::tab::page
2024-08-13 08:28:33 +03:00
{
2024-09-04 23:16:43 +03:00
namespace navigation
2024-08-13 08:40:17 +03:00
{
class Base;
2024-08-13 09:54:11 +03:00
class Bookmark;
2024-08-13 09:47:59 +03:00
class History;
2024-08-13 09:05:59 +03:00
class Update;
2024-08-13 09:59:58 +03:00
class Request;
2024-08-13 08:40:17 +03:00
}
2024-09-04 23:16:43 +03:00
class Navigation : public Gtk::Box
2024-08-13 08:28:33 +03:00
{
2024-08-17 00:50:24 +03:00
// Components
2024-09-04 23:16:43 +03:00
navigation::Base * navigationBase;
navigation::Bookmark * navigationBookmark;
navigation::History * navigationHistory;
navigation::Request * navigationRequest;
navigation::Update * navigationUpdate;
2024-08-17 00:50:24 +03:00
// Defaults
const int SPACING = 8;
const int MARGIN = 8;
2024-08-14 09:16:45 +03:00
2024-08-13 08:28:33 +03:00
public:
2024-09-04 23:16:43 +03:00
Navigation(
2024-09-08 07:24:59 +03:00
const Glib::RefPtr<Gio::SimpleAction> & ACTION__REFRESH,
2024-09-08 03:49:08 +03:00
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK,
2024-09-08 04:20:25 +03:00
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_UPDATE
2024-08-26 22:29:09 +03:00
);
2024-08-14 09:16:45 +03:00
// Actions
2024-09-06 05:17:33 +03:00
void refresh(
const double & PROGRESS_FRACTION
);
2024-09-05 23:13:30 +03:00
2024-09-04 20:51:14 +03:00
void history_add(
const Glib::ustring & REQUEST,
2024-09-05 23:10:15 +03:00
const bool & UPDATE_MEMORY_INDEX
2024-08-29 04:02:38 +03:00
);
2024-09-05 23:13:30 +03:00
// Actionable getters
bool try_history_back(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
);
2024-08-14 09:16:45 +03:00
2024-09-05 23:13:30 +03:00
bool try_history_forward(
Glib::ustring & request,
const bool & UPDATE_MEMORY_INDEX
);
2024-08-14 09:16:45 +03:00
// Getters
2024-08-26 22:29:09 +03:00
Glib::ustring get_request_text();
2024-08-16 09:02:50 +03:00
2024-08-17 12:45:43 +03:00
Glib::ustring get_request_scheme();
Glib::ustring get_request_host();
Glib::ustring get_request_port();
Glib::ustring get_request_path();
Glib::ustring get_request_query();
2024-09-05 22:04:01 +03:00
2024-09-05 23:13:30 +03:00
// Setters
void set_request_text(
const Glib::ustring & VALUE
2024-09-05 22:04:01 +03:00
);
2024-08-13 08:28:33 +03:00
};
}
2024-09-04 23:16:43 +03:00
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP