create database struct methods

This commit is contained in:
yggverse 2024-09-11 00:01:42 +03:00
parent f0ff57e799
commit ae85b3bc71
4 changed files with 335 additions and 191 deletions

View file

@ -18,41 +18,51 @@ namespace app::browser::main
class Tab : public Gtk::Notebook
{
// Database
sqlite3 * db;
public:
struct DB
{
enum APP_BROWSER_MAIN_TAB__SESSION
struct DB
{
ID,
TIME,
PAGE_NUMBER,
IS_CURRENT,
LABEL_TEXT
enum APP_BROWSER_MAIN_TAB__SESSION
{
ID,
TIME,
PAGE_NUMBER,
IS_CURRENT,
LABEL_TEXT
};
static int init(
sqlite3 * db
);
static int clear(
sqlite3 * db
);
static sqlite3_int64 add(
sqlite3 * db,
const int & PAGE_NUMBER,
const bool & IS_CURRENT,
const Glib::ustring & LABEL_TEXT
);
};
};
// Actions
Glib::RefPtr<Gio::SimpleAction> action__refresh,
action__tab_close_active,
action__tab_close_all,
action__tab_page_navigation_history_back,
action__tab_page_navigation_history_forward,
action__tab_page_navigation_update;
private:
// Components
tab::Label * get_tabLabel(
const int & PAGE_NUMBER
);
// Database
sqlite3 * db;
tab::Page * get_tabPage(
const int & PAGE_NUMBER
);
// Actions
Glib::RefPtr<Gio::SimpleAction> action__refresh,
action__tab_close_active,
action__tab_close_all,
action__tab_page_navigation_history_back,
action__tab_page_navigation_history_forward,
action__tab_page_navigation_update;
// Defaults
const bool REORDERABLE = true;
const bool SCROLLABLE = true;
// Defaults
const bool REORDERABLE = true;
const bool SCROLLABLE = true;
public:
@ -99,7 +109,7 @@ namespace app::browser::main
int restore();
void clean();
void clear();
void save();
@ -111,6 +121,14 @@ namespace app::browser::main
Glib::ustring get_page_description(
const int & PAGE_NUMBER
);
tab::Label * get_tabLabel(
const int & PAGE_NUMBER
);
tab::Page * get_tabPage(
const int & PAGE_NUMBER
);
};
}