/usr/include/libdtk-2.0.7/DWidget/ddialog.h is in libdtkwidget-dev 2.0.7.2-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | /*
* Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DDIALOG_H
#define DDIALOG_H
#include <QIcon>
#include "dabstractdialog.h"
class QAbstractButton;
class QButtonGroup;
class QLabel;
class QCloseEvent;
class QVBoxLayout;
DWIDGET_BEGIN_NAMESPACE
class DDialogPrivate;
class DDialog : public DAbstractDialog
{
Q_OBJECT
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
Q_PROPERTY(QString message READ message WRITE setMessage NOTIFY messageChanged)
Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap)
Q_PROPERTY(Qt::TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged)
Q_PROPERTY(bool onButtonClickedClose READ onButtonClickedClose WRITE setOnButtonClickedClose)
public:
enum ButtonType {
ButtonNormal,
ButtonWarning,
ButtonRecommend
};
explicit DDialog(QWidget *parent = 0);
explicit DDialog(const QString &title, const QString& message, QWidget *parent = 0);
int getButtonIndexByText(const QString &text) const;
int buttonCount() const;
int contentCount() const;
QList<QAbstractButton*> getButtons() const;
QList<QWidget*> getContents() const;
QAbstractButton* getButton(int index) const;
QWidget* getContent(int index) const;
QString title() const;
QString message() const;
QIcon icon() const;
QPixmap iconPixmap() const;
Qt::TextFormat textFormat() const;
bool onButtonClickedClose() const;
void setContentLayoutContentsMargins(const QMargins &margins);
QMargins contentLayoutContentsMargins() const;
Q_SIGNALS:
void aboutToClose();
void closed();
void buttonClicked(int index, const QString &text);
void titleChanged(QString title);
void messageChanged(QString massage);
void textFormatChanged(Qt::TextFormat textFormat);
void sizeChanged(QSize size);
void visibleChanged(bool visible);
public Q_SLOTS:
int addButton(const QString &text, bool isDefault = false, ButtonType type = ButtonNormal);
int addButtons(const QStringList &text);
void insertButton(int index, const QString &text, bool isDefault = false, ButtonType type = ButtonNormal);
void insertButton(int index, QAbstractButton* button, bool isDefault = false);
void insertButtons(int index, const QStringList &text);
void removeButton(int index);
void removeButton(QAbstractButton *button);
void removeButtonByText(const QString &text);
void clearButtons();
bool setDefaultButton(int index);
bool setDefaultButton(const QString &str);
void setDefaultButton(QAbstractButton *button);
void addContent(QWidget *widget, Qt::Alignment alignment = 0);
void insertContent(int index, QWidget *widget, Qt::Alignment alignment = 0);
void removeContent(QWidget *widget, bool isDelete = true);
void clearContents(bool isDelete = true);
void setSpacing(int spacing);
void addSpacing(int spacing);
void insertSpacing(int index, int spacing);
void clearSpacing();
void setButtonText(int index, const QString &text);
void setButtonIcon(int index, const QIcon &icon);
void setTitle(const QString &title);
void setMessage(const QString& message);
void setIcon(const QIcon &icon);
void setIconPixmap(const QPixmap &iconPixmap);
void setTextFormat(Qt::TextFormat textFormat);
void setOnButtonClickedClose(bool onButtonClickedClose);
int exec() Q_DECL_OVERRIDE;
protected:
explicit DDialog(DDialogPrivate &dd, QWidget *parent = 0);
void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
void childEvent(QChildEvent *event) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
private:
D_DECLARE_PRIVATE(DDialog)
Q_PRIVATE_SLOT(d_func(), void _q_onButtonClicked())
Q_PRIVATE_SLOT(d_func(), void _q_defaultButtonTriggered())
};
DWIDGET_END_NAMESPACE
#endif // DDIALOG_H
|