Skip to content
Phosphor
/
API Reference
Search
PlasmaZones
Libraries
Guides
Brand
Palette
About
GitHub
Discord
Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
FileView.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2026 fuddlesworth
2
// SPDX-License-Identifier: LGPL-2.1-or-later
3
4
#pragma once
5
6
#include <PhosphorShell/phosphorshell_export.h>
7
8
#include <QObject>
9
#include <QString>
10
11
QT_BEGIN_NAMESPACE
12
class
QFileSystemWatcher;
13
class
QTimer;
14
QT_END_NAMESPACE
15
16
namespace
PhosphorShell
{
17
18
class
PHOSPHORSHELL_EXPORT
FileView
:
public
QObject
19
{
20
Q_OBJECT
21
22
Q_PROPERTY(QString
path
READ
path
WRITE
setPath
NOTIFY
pathChanged
)
23
Q_PROPERTY(QString
content
READ
content
NOTIFY
contentChanged
)
24
Q_PROPERTY(
int
interval
READ
interval
WRITE
setInterval
NOTIFY
intervalChanged
)
25
Q_PROPERTY(
bool
exists
READ
exists
NOTIFY
existsChanged
)
26
27
public
:
28
explicit
FileView
(QObject* parent =
nullptr
);
29
~FileView
()
override
;
30
31
[[nodiscard]] QString
path
()
const
;
32
void
setPath
(
const
QString&
path
);
33
34
[[nodiscard]] QString
content
()
const
;
35
36
[[nodiscard]]
int
interval
()
const
;
37
void
setInterval
(
int
interval
);
38
39
[[nodiscard]]
bool
exists
()
const
;
40
41
Q_SIGNALS:
42
void
pathChanged
();
43
void
contentChanged
();
44
void
intervalChanged
();
45
void
existsChanged
();
46
47
private
Q_SLOTS:
48
void
readFile();
49
void
onFileChanged();
50
void
onDirectoryChanged();
51
52
private
:
53
void
setupWatcher();
54
void
setupTimer();
55
56
QString m_path;
57
QString m_content;
58
int
m_interval = 0;
59
bool
m_exists =
false
;
60
QFileSystemWatcher* m_watcher =
nullptr
;
61
QTimer* m_timer =
nullptr
;
62
};
63
64
}
// namespace PhosphorShell
PhosphorShell::FileView::FileView
FileView(QObject *parent=nullptr)
PhosphorShell::FileView::content
QString content() const
PhosphorShell::FileView::interval
int interval() const
PhosphorShell::FileView::~FileView
~FileView() override
PhosphorShell::FileView::contentChanged
void contentChanged()
PhosphorShell::FileView::path
QString path() const
PhosphorShell::FileView::pathChanged
void pathChanged()
PhosphorShell::FileView::intervalChanged
void intervalChanged()
PhosphorShell::FileView::existsChanged
void existsChanged()
PhosphorShell::FileView::setPath
void setPath(const QString &path)
PhosphorShell::FileView::exists
bool exists() const
PhosphorShell::FileView::setInterval
void setInterval(int interval)
PhosphorShell
Definition
Environment.h:11
phosphor-shell
include
PhosphorShell
FileView.h
Generated by
1.15.0