mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement browser, main widget db session
This commit is contained in:
parent
c240c9faee
commit
c13cc44a59
6 changed files with 552 additions and 62 deletions
|
|
@ -18,12 +18,58 @@ namespace app::browser
|
|||
|
||||
class Main : public Gtk::Box
|
||||
{
|
||||
// Components
|
||||
main::Tab * mainTab;
|
||||
public:
|
||||
|
||||
// Defaults
|
||||
const bool HOMOGENEOUS = true;
|
||||
/*
|
||||
* Tab class database
|
||||
*
|
||||
* Allowed parental access to enums and relationship methods
|
||||
*/
|
||||
struct DB
|
||||
{
|
||||
// APP_BROWSER_MAIN__*
|
||||
struct SESSION
|
||||
{
|
||||
enum
|
||||
{
|
||||
ID,
|
||||
TIME
|
||||
}; // table fields index
|
||||
|
||||
static int init(
|
||||
sqlite3 * db
|
||||
); // return sqlite3_exec status code
|
||||
|
||||
static int clean(
|
||||
sqlite3 * db,
|
||||
const sqlite3_int64 & APP_BROWSER__SESSION__ID
|
||||
); // return sqlite3_finalize status code
|
||||
|
||||
static sqlite3_int64 add(
|
||||
sqlite3 * db,
|
||||
const sqlite3_int64 & APP_BROWSER__SESSION__ID
|
||||
); // return sqlite3_last_insert_rowid
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal members
|
||||
*/
|
||||
private:
|
||||
|
||||
// Database
|
||||
sqlite3 * db;
|
||||
|
||||
// Components
|
||||
main::Tab * mainTab;
|
||||
|
||||
// Defaults
|
||||
const bool HOMOGENEOUS = true;
|
||||
|
||||
/*
|
||||
* Main class API
|
||||
*/
|
||||
public:
|
||||
|
||||
Main(
|
||||
|
|
@ -37,10 +83,6 @@ namespace app::browser
|
|||
);
|
||||
|
||||
// Actions
|
||||
void clean();
|
||||
void restore();
|
||||
void save();
|
||||
|
||||
void tab_append();
|
||||
|
||||
void tab_close_all();
|
||||
|
|
@ -52,6 +94,18 @@ namespace app::browser
|
|||
void tab_page_navigation_history_back();
|
||||
void tab_page_navigation_history_forward();
|
||||
|
||||
int restore(
|
||||
const sqlite3_int64 & APP_BROWSER__SESSION__ID
|
||||
); // return sqlite3_finalize status code
|
||||
|
||||
void clean(
|
||||
const sqlite3_int64 & APP_BROWSER__SESSION__ID
|
||||
);
|
||||
|
||||
void save(
|
||||
const sqlite3_int64 & APP_BROWSER__SESSION__ID
|
||||
);
|
||||
|
||||
void update();
|
||||
|
||||
// Getters
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue