Falkon Develop
Cross-platform Qt-based web browser
qmlwindow.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2018 Anmol Gautam <tarptaeya@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#pragma once
19
20#include <QObject>
21#include "browserwindow.h"
22#include "../qmlenums.h"
26class QmlWindow : public QObject
27{
28 Q_OBJECT
29
33 Q_PROPERTY(int id READ id CONSTANT)
34
35
38 Q_PROPERTY(bool incognito READ incognito CONSTANT)
39
40
43 Q_PROPERTY(QString title READ title CONSTANT)
44
45
48 Q_PROPERTY(QmlEnums::WindowState state READ state CONSTANT)
49
50
53 Q_PROPERTY(QmlEnums::WindowType type READ type CONSTANT)
54
55
58 Q_PROPERTY(QList<QObject*> tabs READ tabs CONSTANT)
59
60
63 Q_PROPERTY(bool focussed READ focussed CONSTANT)
64
65
68 Q_PROPERTY(int height READ height CONSTANT)
69
70
73 Q_PROPERTY(int width READ width CONSTANT)
74public:
75 QmlWindow(BrowserWindow *window = nullptr, QObject *parent = nullptr);
76
77private:
78 BrowserWindow *m_window = nullptr;
79
80 int id() const;
81 bool incognito() const;
82 QString title() const;
85 QList<QObject*> tabs() const;
86 bool focussed() const;
87 int height() const;
88 int width() const;
89};
WindowType
The WindowType enum.
Definition: qmlenums.h:45
WindowState
The WindowState enum.
Definition: qmlenums.h:33
The class exposing Browser window to QML.
Definition: qmlwindow.h:27
int width
width of window
Definition: qmlwindow.h:73
int id
id of window
Definition: qmlwindow.h:33
int height
height of window
Definition: qmlwindow.h:68
QString title
title of window
Definition: qmlwindow.h:43
QmlWindow(BrowserWindow *window=nullptr, QObject *parent=nullptr)
Definition: qmlwindow.cpp:25
QmlEnums::WindowType type
window type of window
Definition: qmlwindow.h:53
QmlEnums::WindowState state
window state of window
Definition: qmlwindow.h:48
bool focussed
checks if the window is focused
Definition: qmlwindow.h:63
QList< QObject * > tabs
list of all tabs of window
Definition: qmlwindow.h:58
bool incognito
checks if the window is private
Definition: qmlwindow.h:38