KDeclarative

icondialog.h
1 /*
2  SPDX-FileCopyrightText: 2015 Kai Uwe Broulik <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef ICONDIALOG_H
8 #define ICONDIALOG_H
9 
10 #include <QObject>
11 #include <QString>
12 
13 class KIconDialog;
14 
15 class IconDialog : public QObject
16 {
17  Q_OBJECT
18 
22  Q_PROPERTY(QString iconName READ iconName NOTIFY iconNameChanged)
26  Q_PROPERTY(int iconSize READ iconSize WRITE setIconSize NOTIFY iconSizeChanged)
30  Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
34  Q_PROPERTY(bool user READ user WRITE setUser NOTIFY userChanged)
38  Q_PROPERTY(QString customLocation READ customLocation WRITE setCustomLocation NOTIFY customLocationChanged)
42  Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged)
47  Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
48 
49 public:
50  explicit IconDialog(QObject *parent = nullptr);
51  ~IconDialog() override;
52 
53  QString iconName() const;
54 
55  int iconSize() const;
56  void setIconSize(int iconSize);
57 
58  QString title() const;
59  void setTitle(const QString &title);
60 
61  bool user() const;
62  void setUser(bool user);
63 
64  QString customLocation() const;
65  void setCustomLocation(const QString &customLocation);
66 
67  Qt::WindowModality modality() const;
68  void setModality(Qt::WindowModality modality);
69 
70  bool visible() const;
71  void setVisible(bool visible);
72 
73  Q_INVOKABLE void open();
74  Q_INVOKABLE void close();
75 
76 Q_SIGNALS:
77  void iconNameChanged(const QString &iconName);
78  void iconSizeChanged(int iconSize);
79  void titleChanged(const QString &title);
80  void userChanged(bool user);
81  void customLocationChanged(const QString &customLocation);
82  void modalityChanged(Qt::WindowModality modality);
83  void visibleChanged();
84 
85 private:
86  bool eventFilter(QObject *watched, QEvent *event) override;
87 
89 
90  QString m_iconName;
91  int m_iconSize;
92  bool m_user;
93  QString m_customLocation;
94  Qt::WindowModality m_modality;
95  bool m_visible;
96 
97 };
98 
99 #endif // ICONDIALOG_H
Q_SIGNALSQ_SIGNALS
virtual bool event(QEvent *e)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_INVOKABLEQ_INVOKABLE
WindowModality
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.