# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# kmessagebox.h

    00001 /*  This file is part of the KDE libraries
    00002     Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
    00003
    00004     This library is free software; you can redistribute it and/or
    00005     modify it under the terms of the GNU Library General Public
    00006     License as published by the Free Software Foundation; version 2
    00007     of the License.
    00008
    00009     This library is distributed in the hope that it will be useful,
    00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012     Library General Public License for more details.
    00013
    00014     You should have received a copy of the GNU Library General Public License
    00015     along with this library; see the file COPYING.LIB.  If not, write to
    00016     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00017     Boston, MA 02111-1307, USA.
    00018 */
    00019 #ifndef _KMESSAGEBOX_H_
    00020 #define _KMESSAGEBOX_H_
    00021
    00022 #include <qstring.h>
    00023 #include <qmessagebox.h>
    00024
    00025 #include <kguiitem.h>
    00026 #include <kstdguiitem.h>
    00027
    00028 class QWidget;
    00029 class QStringList;
    00030 class KConfig;
    00031 class KDialogBase;
    00032
    00044 class KDEUI_EXPORT KMessageBox
    00045 {
    00046 public:
    00050  enum ButtonCode
    00051  {
    00052    Ok = 1,
    00053    Cancel = 2,
    00054    Yes = 3,
    00055    No = 4,
    00056    Continue = 5
    00057  };
    00058
    00059  enum DialogType
    00060  {
    00061    QuestionYesNo = 1,
    00062    WarningYesNo = 2,
    00063    WarningContinueCancel = 3,
    00064    WarningYesNoCancel = 4,
    00065    Information = 5,
    00066    // Reserved for: SSLMessageBox = 6
    00067    Sorry = 7,
    00068    Error = 8,
    00069    QuestionYesNoCancel = 9
    00070  };
    00071
    00079  enum OptionsType
    00080  {
    00081    Notify = 1,
    00082    AllowLink = 2,
    00083    Dangerous = 4,
    00084    PlainCaption = 8,
    00085    NoExec = 16
    00086  };
    00087
    00118  static int questionYesNo(QWidget *parent,
    00119                           const QString &text,
    00120                           const QString &caption = QString::null,
    00121                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00122                           const KGuiItem &buttonNo =  KStdGuiItem::no(),
    00123                           const QString &dontAskAgainName = QString::null,
    00124                           int options = Notify);
    00130  static int questionYesNoWId(WId parent_id,
    00131                           const QString &text,
    00132                           const QString &caption = QString::null,
    00133                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00134                           const KGuiItem &buttonNo =  KStdGuiItem::no(),
    00135                           const QString &dontAskAgainName = QString::null,
    00136                           int options = Notify);
    00169   static int questionYesNoCancel(QWidget *parent,
    00170                           const QString &text,
    00171                           const QString &caption = QString::null,
    00172                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00173                           const KGuiItem &buttonNo  = KStdGuiItem::no(),
    00174                           const QString &dontAskAgainName = QString::null,
    00175                           int options = Notify);
    00176
    00182   static int questionYesNoCancelWId(WId parent_id,
    00183                           const QString &text,
    00184                           const QString &caption = QString::null,
    00185                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00186                           const KGuiItem &buttonNo  = KStdGuiItem::no(),
    00187                           const QString &dontAskAgainName = QString::null,
    00188                           int options = Notify);
    00189
    00224  static int questionYesNoList(QWidget *parent,
    00225                           const QString &text,
    00226                           const QStringList &strlist,
    00227                           const QString &caption = QString::null,
    00228                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00229                           const KGuiItem &buttonNo = KStdGuiItem::no(),
    00230                           const QString &dontAskAgainName = QString::null,
    00231                           int options = Notify);
    00232
    00238  static int questionYesNoListWId(WId parent_id,
    00239                           const QString &text,
    00240                           const QStringList &strlist,
    00241                           const QString &caption = QString::null,
    00242                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00243                           const KGuiItem &buttonNo = KStdGuiItem::no(),
    00244                           const QString &dontAskAgainName = QString::null,
    00245                           int options = Notify);
    00246
    00277  static int warningYesNo(QWidget *parent,
    00278                          const QString &text,
    00279                          const QString &caption = QString::null,
    00280                          const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00281                          const KGuiItem &buttonNo = KStdGuiItem::no(),
    00282                          const QString &dontAskAgainName = QString::null,
    00283                          int options = Notify | Dangerous);
    00284
    00290  static int warningYesNoWId(WId parent_id,
    00291                          const QString &text,
    00292                          const QString &caption = QString::null,
    00293                          const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00294                          const KGuiItem &buttonNo = KStdGuiItem::no(),
    00295                          const QString &dontAskAgainName = QString::null,
    00296                          int options = Notify | Dangerous);
    00297
    00332  static int warningYesNoList(QWidget *parent,
    00333                             const QString &text,
    00334                             const QStringList &strlist,
    00335                             const QString &caption = QString::null,
    00336                             const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00337                             const KGuiItem &buttonNo = KStdGuiItem::no(),
    00338                             const QString &dontAskAgainName = QString::null,
    00339                             int options = Notify | Dangerous);
    00340
    00346  static int warningYesNoListWId(WId parent_id,
    00347                             const QString &text,
    00348                             const QStringList &strlist,
    00349                             const QString &caption = QString::null,
    00350                             const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00351                             const KGuiItem &buttonNo = KStdGuiItem::no(),
    00352                             const QString &dontAskAgainName = QString::null,
    00353                             int options = Notify | Dangerous);
    00354
    00384  static int warningContinueCancel(QWidget *parent,
    00385                          const QString &text,
    00386                          const QString &caption = QString::null,
    00387                          const KGuiItem &buttonContinue = KStdGuiItem::cont(),
    00388                          const QString &dontAskAgainName = QString::null,
    00389                          int options = Notify);
    00390
    00396  static int warningContinueCancelWId(WId parent_id,
    00397                          const QString &text,
    00398                          const QString &caption = QString::null,
    00399                          const KGuiItem &buttonContinue = KStdGuiItem::cont(),
    00400                          const QString &dontAskAgainName = QString::null,
    00401                          int options = Notify);
    00402
    00436  static int warningContinueCancelList(QWidget *parent,
    00437                          const QString &text,
    00438                          const QStringList &strlist,
    00439                          const QString &caption = QString::null,
    00440                          const KGuiItem &buttonContinue = KStdGuiItem::cont(),
    00441                          const QString &dontAskAgainName = QString::null,
    00442                          int options = Notify);
    00443
    00449  static int warningContinueCancelListWId(WId parent_id,
    00450                          const QString &text,
    00451                          const QStringList &strlist,
    00452                          const QString &caption = QString::null,
    00453                          const KGuiItem &buttonContinue = KStdGuiItem::cont(),
    00454                          const QString &dontAskAgainName = QString::null,
    00455                          int options = Notify);
    00456
    00493   static int warningYesNoCancel(QWidget *parent,
    00494                                 const QString &text,
    00495                                 const QString &caption = QString::null,
    00496                                 const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00497                                 const KGuiItem &buttonNo = KStdGuiItem::no(),
    00498                                 const QString &dontAskAgainName = QString::null,
    00499                                 int options = Notify);
    00500
    00506   static int warningYesNoCancelWId(WId parent_id,
    00507                                 const QString &text,
    00508                                 const QString &caption = QString::null,
    00509                                 const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00510                                 const KGuiItem &buttonNo = KStdGuiItem::no(),
    00511                                 const QString &dontAskAgainName = QString::null,
    00512                                 int options = Notify);
    00513
    00555   static int warningYesNoCancelList(QWidget *parent,
    00556                                 const QString &text,
    00557                                 const QStringList &strlist,
    00558                                 const QString &caption = QString::null,
    00559                                 const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00560                                 const KGuiItem &buttonNo = KStdGuiItem::no(),
    00561                                 const QString &dontAskAgainName = QString::null,
    00562                                 int options = Notify);
    00563
    00569   static int warningYesNoCancelListWId(WId parent_id,
    00570                                 const QString &text,
    00571                                 const QStringList &strlist,
    00572                                 const QString &caption = QString::null,
    00573                                 const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00574                                 const KGuiItem &buttonNo = KStdGuiItem::no(),
    00575                                 const QString &dontAskAgainName = QString::null,
    00576                                 int options = Notify);
    00577
    00601   static void error(QWidget *parent,
    00602                     const QString &text,
    00603                     const QString &caption = QString::null,
    00604                     int options = Notify);
    00605
    00612   static void errorWId(WId parent_id,
    00613                     const QString &text,
    00614                     const QString &caption = QString::null,
    00615                     int options = Notify);
    00616
    00645   static void errorList(QWidget *parent,
    00646                     const QString &text,
    00647                     const QStringList &strlist,
    00648                     const QString &caption = QString::null,
    00649                     int options = Notify);
    00650
    00657   static void errorListWId(WId parent_id,
    00658                     const QString &text,
    00659                     const QStringList &strlist,
    00660                     const QString &caption = QString::null,
    00661                     int options = Notify);
    00662
    00689   static void detailedError(QWidget *parent,
    00690                     const QString &text,
    00691                     const QString &details,
    00692                     const QString &caption = QString::null,
    00693                     int options = Notify);
    00694
    00700   static void detailedErrorWId(WId parent_id,
    00701                     const QString &text,
    00702                     const QString &details,
    00703                     const QString &caption = QString::null,
    00704                     int options = Notify);
    00705
    00716   static void queuedDetailedError( QWidget *parent,
    00717                     const QString &text,
    00718                     const QString &details,
    00719                     const QString &caption = QString::null);
    00720
    00726   static void queuedDetailedErrorWId( WId parent_id,
    00727                     const QString &text,
    00728                     const QString &details,
    00729                     const QString &caption = QString::null);
    00730
    00753   static void sorry(QWidget *parent,
    00754                     const QString &text,
    00755                     const QString &caption = QString::null,
    00756                     int options = Notify);
    00757
    00763   static void sorryWId(WId parent_id,
    00764                     const QString &text,
    00765                     const QString &caption = QString::null,
    00766                     int options = Notify);
    00767
    00796   static void detailedSorry(QWidget *parent,
    00797                     const QString &text,
    00798                     const QString &details,
    00799                     const QString &caption = QString::null,
    00800                     int options = Notify);
    00801
    00807   static void detailedSorryWId(WId parent_id,
    00808                     const QString &text,
    00809                     const QString &details,
    00810                     const QString &caption = QString::null,
    00811                     int options = Notify);
    00812
    00839   static void information(QWidget *parent,
    00840                           const QString &text,
    00841                           const QString &caption = QString::null,
    00842                           const QString &dontShowAgainName = QString::null,
    00843                           int options = Notify);
    00844
    00850   static void informationWId(WId parent_id,
    00851                           const QString &text,
    00852                           const QString &caption = QString::null,
    00853                           const QString &dontShowAgainName = QString::null,
    00854                           int options = Notify);
    00855
    00886   static void informationList(QWidget *parent,
    00887                   const QString &text,
    00888                   const QStringList & strlist,
    00889                   const QString &caption = QString::null,
    00890                   const QString &dontShowAgainName = QString::null,
    00891                   int options = Notify);
    00892
    00898   static void informationListWId(WId parent_id,
    00899                   const QString &text,
    00900                   const QStringList & strlist,
    00901                   const QString &caption = QString::null,
    00902                   const QString &dontShowAgainName = QString::null,
    00903                   int options = Notify);
    00904
    00909   static void enableAllMessages();
    00910
    00918   static void enableMessage(const QString &dontShowAgainName);
    00919
    00939   static void about(QWidget *parent,
    00940             const QString& text,
    00941             const QString& caption = QString::null,
    00942                     int options = Notify);
    00943
    00968     static int messageBox( QWidget *parent, DialogType type, const QString &text,
    00969                     const QString &caption,
    00970                     const KGuiItem &buttonYes,
    00971                     const KGuiItem &buttonNo,
    00972                     const QString &dontShowAskAgainName,
    00973                     int options = Notify);
    00974
    00993     // KDE4 - merge with above?
    00994     static int messageBox( QWidget *parent, DialogType type, const QString &text,
    00995                     const QString &caption = QString::null,
    00996                     const KGuiItem &buttonYes = KStdGuiItem::yes(),
    00997                     const KGuiItem &buttonNo = KStdGuiItem::no(),
    00998                     int options = Notify);
    00999
    01005     static int messageBoxWId( WId parent_id, DialogType type, const QString &text,
    01006                     const QString &caption = QString::null,
    01007                     const KGuiItem &buttonYes = KStdGuiItem::yes(),
    01008                     const KGuiItem &buttonNo = KStdGuiItem::no(),
    01009                     const QString &dontShowAskAgainName = QString::null,
    01010                     int options = Notify);
    01011
    01024     static void queuedMessageBox( QWidget *parent,
    01025                     DialogType type, const QString &text,
    01026                     const QString &caption,
    01027                     int options );
    01028
    01034     static void queuedMessageBoxWId( WId parent_id,
    01035                     DialogType type, const QString &text,
    01036                     const QString &caption,
    01037                     int options );
    01038
    01045     static void queuedMessageBox( QWidget *parent,
    01046                     DialogType type, const QString &text,
    01047                     const QString &caption = QString::null );
    01048
    01054     static void queuedMessageBoxWId( WId parent_id,
    01055                     DialogType type, const QString &text,
    01056                     const QString &caption = QString::null );
    01057
    01067     static bool shouldBeShownYesNo(const QString &dontShowAgainName,
    01068                                    ButtonCode &result);
    01076     static bool shouldBeShownContinue(const QString &dontShowAgainName);
    01077
    01086     static void saveDontShowAgainYesNo(const QString &dontShowAgainName,
    01087                                        ButtonCode result);
    01088
    01096     static void saveDontShowAgainContinue(const QString &dontShowAgainName);
    01097
    01103     static void setDontShowAskAgainConfig(KConfig* cfg);
    01104
    01128     static int createKMessageBox(KDialogBase *dialog, QMessageBox::Icon icon,
    01129                              const QString &text, const QStringList &strlist,
    01130                              const QString &ask, bool *checkboxReturn,
    01131                              int options, const QString &details=QString::null);
    01132
    01159     static int createKMessageBox(KDialogBase *dialog, QPixmap icon,
    01160                              const QString &text, const QStringList &strlist,
    01161                              const QString &ask, bool *checkboxReturn,
    01162                              int options, const QString &details=QString::null,
    01163                              QMessageBox::Icon notifyType=QMessageBox::Information);
    01164
    01165 private:
    01166     static KConfig* againConfig;
    01167 };
    01168
    01169 #endif

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:20:19 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003