LibreWeb-Browser/src/mainwindow.h

60 lines
1.4 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-11-14 14:13:00 -08:00
MainWindow();
2020-11-28 14:47:34 -08:00
protected:
// Signal handlers:
// Our new improved on_button_clicked(). (see below)
2020-12-10 10:01:11 -08:00
void go_home();
void input_activate();
2020-11-28 14:47:34 -08:00
void on_button_clicked(Glib::ustring data);
2020-12-07 16:13:21 -08:00
void show_about();
void hide_about(int response);
2020-12-11 21:02:17 -08:00
void show_source_code_dialog();
2020-11-12 14:27:47 -08:00
2020-11-28 14:47:34 -08:00
// Child widgets
2020-11-30 15:43:52 -08:00
Menu m_menu;
Gtk::Box m_vbox;
2020-12-08 19:44:26 -08:00
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;
2020-11-28 14:47:34 -08:00
Gtk::ScrolledWindow m_scrolledWindow;
RenderArea m_renderArea;
2020-12-11 21:02:17 -08:00
SourceCodeDialog m_sourceCodeDialog;
2020-12-07 16:13:21 -08:00
About m_about;
2020-11-12 14:27:47 -08:00
private:
File m_file;
2020-12-10 13:43:45 -08:00
std::string requestPath;
std::string finalRequestPath;
2020-12-11 21:02:17 -08:00
std::string currentSourceCode;
2020-12-10 13:43:45 -08:00
void doRequest(const std::string &path = "");
2020-12-10 10:01:11 -08:00
void refresh();
void fetchFromIPFS();
void openFromDisk();
2020-11-12 14:27:47 -08:00
};
2020-11-14 14:13:00 -08:00
#endif