LibreWeb-Browser/src/mainwindow.h

60 lines
1.3 KiB
C
Raw Normal View History

2020-11-12 14:27:47 -08:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
2020-11-28 14:47:34 -08:00
#include <gtkmm/window.h>
2020-11-30 15:43:52 -08:00
#include <gtkmm/box.h>
#include <gtkmm/menubar.h>
2020-11-28 14:47:34 -08:00
#include <gtkmm/scrolledwindow.h>
2020-12-08 19:44:26 -08:00
#include <gtkmm/button.h>
#include <gtkmm/entry.h>
2020-11-28 14:47:34 -08:00
#include "render-area.h"
2020-11-30 15:43:52 -08:00
#include "menu.h"
2020-12-04 17:51:40 -08:00
#include "file.h"
2020-12-07 16:13:21 -08:00
#include "about.h"
2020-12-11 21:02:17 -08:00
#include "source-code-dialog.h"
2020-11-12 14:27:47 -08:00
2020-11-28 14:47:34 -08:00
class MainWindow : public Gtk::Window
2020-11-12 14:27:47 -08:00
{
public:
2020-12-14 10:40:08 -08:00
MainWindow();
2020-11-14 14:13:00 -08:00
2020-11-28 14:47:34 -08:00
protected:
2020-12-14 10:40:08 -08:00
// Signal handlers:
// Our new improved on_button_clicked(). (see below)
void go_home();
void input_activate();
void on_button_clicked(Glib::ustring data);
void show_about();
void hide_about(int response);
void show_source_code_dialog();
2020-11-12 14:27:47 -08:00
2020-12-14 10:40:08 -08:00
// Child widgets
Menu m_menu;
Gtk::Box m_vbox;
Gtk::Box m_hbox_bar;
Gtk::Button m_backButton;
Gtk::Button m_forwardButton;
Gtk::Button m_refreshButton;
Gtk::Button m_homeButton;
Gtk::Entry m_inputField;
Gtk::Image backIcon;
Gtk::Image forwardIcon;
Gtk::Image refreshIcon;
Gtk::Image homeIcon;
Gtk::ScrolledWindow m_scrolledWindow;
RenderArea m_renderArea;
SourceCodeDialog m_sourceCodeDialog;
About m_about;
2020-11-12 14:27:47 -08:00
private:
2020-12-14 10:40:08 -08:00
File m_file;
std::string requestPath;
std::string finalRequestPath;
std::string currentContent;
2020-12-14 10:40:08 -08:00
void doRequest(const std::string &path = "");
void refresh();
void fetchFromIPFS();
void openFromDisk();
2020-11-12 14:27:47 -08:00
};
2020-11-14 14:13:00 -08:00
#endif