summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets/recipebrowser/mainwindow.h
blob: 959c82af8b0cc2ec6a3f2f7095e7658998fae4c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "document.h"
#include <QMainWindow>
#include <QSettings>
#include <QWebEngineScriptCollection>
#include <QWebEngineView>
#include <QPlainTextEdit>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void insertStyleSheet(const QString &name, const QString &source, bool immediately);
    void removeStyleSheet(const QString &name, bool immediately);
    bool hasStyleSheet(const QString &name);
    void loadDefaultStyleSheets();

private slots:
    void showStyleSheetsDialog();
    void toggleEditView();

private:
    Ui::MainWindow *ui;

    bool m_isEditMode;
    Document m_content;
};

#endif // MAINWINDOW_H