File indexing completed on 2025-01-05 04:26:49

0001 /*
0002  * Replacement fot QT Bindings that were removed from QT5
0003  * Copyright (C) 2020  Pedro de Carvalho Gomes <pedrogomes81@gmail.com>
0004  *
0005  * This program is free software: you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation, either version 3 of the License, or
0008  * (at your option) any later version.
0009  *
0010  * This program is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017  */
0018 
0019 #ifndef GUIDIALOGBUTTONBOX_H
0020 #define GUIDIALOGBUTTONBOX_H
0021 
0022 #include "QtBinding.h"
0023 
0024 #include <QDialogButtonBox>
0025 
0026 namespace QtBindings
0027 {
0028     namespace Gui
0029     {
0030         class DialogButtonBox : public QDialogButtonBox, public QtBindings::Base<DialogButtonBox>
0031         {
0032             Q_OBJECT
0033         public:
0034             enum ButtonRole {
0035                 InvalidRole = -1,
0036                 AcceptRole,
0037                 RejectRole,
0038                 DestructiveRole,
0039                 ActionRole,
0040                 HelpRole,
0041                 YesRole,
0042                 NoRole,
0043                 ResetRole,
0044                 ApplyRole,
0045                 NRoles
0046             };
0047             Q_ENUM(ButtonRole)
0048 
0049             enum StandardButton {
0050                 NoButton           = 0x00000000,
0051                 Ok                 = 0x00000400,
0052                 Save               = 0x00000800,
0053                 SaveAll            = 0x00001000,
0054                 Open               = 0x00002000,
0055                 Yes                = 0x00004000,
0056                 YesToAll           = 0x00008000,
0057                 No                 = 0x00010000,
0058                 NoToAll            = 0x00020000,
0059                 Abort              = 0x00040000,
0060                 Retry              = 0x00080000,
0061                 Ignore             = 0x00100000,
0062                 Close              = 0x00200000,
0063                 Cancel             = 0x00400000,
0064                 Discard            = 0x00800000,
0065                 Help               = 0x01000000,
0066                 Apply              = 0x02000000,
0067                 Reset              = 0x04000000,
0068                 RestoreDefaults    = 0x08000000,
0069             };
0070             Q_FLAG(StandardButtons)
0071 
0072             enum ButtonLayout {
0073                 WinLayout,
0074                 MacLayout,
0075                 KdeLayout,
0076                 GnomeLayout
0077             };
0078             Q_ENUM(ButtonLayout)
0079 
0080             Q_INVOKABLE DialogButtonBox(QWidget *parent = Q_NULLPTR);
0081             Q_INVOKABLE DialogButtonBox(const DialogButtonBox &other);
0082             Q_INVOKABLE ~DialogButtonBox();
0083             Q_INVOKABLE DialogButtonBox &operator=(const DialogButtonBox &other);
0084         };
0085     }
0086 }
0087 Q_DECLARE_METATYPE(QtBindings::Gui::DialogButtonBox)
0088 #endif //GUIDIALOGBUTTONBOX_H