kdeui Library API Documentation

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 
00024 #include <kguiitem.h>
00025 #include <kstdguiitem.h>
00026 
00027 class QWidget;
00028 class QStringList;
00029 
00042 class KMessageBox
00043 {
00044 public:
00048  enum ButtonCode
00049  {
00050    Ok = 1,
00051    Cancel = 2,
00052    Yes = 3,
00053    No = 4,
00054    Continue = 5
00055  };
00056 
00057  enum DialogType
00058  {
00059    QuestionYesNo = 1,
00060    WarningYesNo = 2,
00061    WarningContinueCancel = 3,
00062    WarningYesNoCancel = 4,
00063    Information = 5,
00064    // Reserved for: SSLMessageBox = 6
00065    Sorry = 7,
00066    Error = 8,
00067    QuestionYesNoCancel = 9
00068  };
00069 
00074  enum OptionsType
00075  {
00076    Notify = 1,
00077    AllowLink = 2
00078  };
00079 
00107  static int questionYesNo(QWidget *parent,
00108                           const QString &text,
00109                           const QString &caption = QString::null,
00110                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
00111                           const KGuiItem &buttonNo =  KStdGuiItem::no(),
00112                           const QString &dontAskAgainName = QString::null,
00113                           int options = Notify);
00143   static int questionYesNoCancel(QWidget *parent,
00144                           const QString &text,
00145                           const QString &caption = QString::null,
00146                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
00147                           const KGuiItem &buttonNo  = KStdGuiItem::no(),
00148                           const QString &dontAskAgainName = QString::null,
00149                           int options = Notify);
00150 
00182  static int questionYesNoList(QWidget *parent,
00183                           const QString &text,
00184                           const QStringList &strlist,
00185                           const QString &caption = QString::null,
00186                           const KGuiItem &buttonYes = KStdGuiItem::yes(),
00187                           const KGuiItem &buttonNo = KStdGuiItem::no(),
00188                           const QString &dontAskAgainName = QString::null,
00189                           int options = Notify);
00217  static int warningYesNo(QWidget *parent,
00218                          const QString &text,
00219                          const QString &caption = QString::null,
00220                          const KGuiItem &buttonYes = KStdGuiItem::yes(),
00221                          const KGuiItem &buttonNo = KStdGuiItem::no(),
00222                          const QString &dontAskAgainName = QString::null,
00223                          int options = Notify);
00224 
00251  static int warningContinueCancel(QWidget *parent,
00252                          const QString &text,
00253                          const QString &caption = QString::null,
00254                          const KGuiItem &buttonContinue = KStdGuiItem::cont(),
00255                          const QString &dontAskAgainName = QString::null,
00256                          int options = Notify);
00257 
00258 
00290  static int warningContinueCancelList(QWidget *parent,
00291                          const QString &text,
00292                          const QStringList &strlist,
00293                          const QString &caption = QString::null,
00294                          const KGuiItem &buttonContinue = KStdGuiItem::cont(),
00295                          const QString &dontAskAgainName = QString::null,
00296                          int options = Notify);
00297 
00298 
00332   static int warningYesNoCancel(QWidget *parent,
00333                                 const QString &text,
00334                                 const QString &caption = QString::null,
00335                                 const KGuiItem &buttonYes = KStdGuiItem::yes(),
00336                                 const KGuiItem &buttonNo = KStdGuiItem::no(),
00337                                 const QString &dontAskAgainName = QString::null,
00338                                 int options = Notify);
00339 
00363   static void error(QWidget *parent,
00364                     const QString &text,
00365                     const QString &caption = QString::null,
00366                     int options = Notify);
00367 
00394   static void detailedError(QWidget *parent,
00395                     const QString &text,
00396                     const QString &details,
00397                     const QString &caption = QString::null,
00398                     int options = Notify);
00399 
00410   static void queuedDetailedError( QWidget *parent,
00411                     const QString &text,
00412                     const QString &details,
00413                     const QString &caption = QString::null);
00414 
00437   static void sorry(QWidget *parent,
00438                     const QString &text,
00439                     const QString &caption = QString::null,
00440                     int options = Notify);
00441 
00470   static void detailedSorry(QWidget *parent,
00471                     const QString &text,
00472                     const QString &details,
00473                     const QString &caption = QString::null,
00474                     int options = Notify);
00475 
00502   static void information(QWidget *parent,
00503                           const QString &text,
00504                           const QString &caption = QString::null,
00505                           const QString &dontShowAgainName = QString::null,
00506                           int options = Notify);
00507 
00538   static void informationList(QWidget *parent, 
00539                   const QString &text, 
00540                   const QStringList & strlist,
00541                   const QString &caption = QString::null,
00542                   const QString &dontShowAgainName = QString::null, 
00543                   int options = Notify);
00544 
00549   static void enableAllMessages();
00550 
00570   static void about(QWidget *parent,
00571             const QString& text,
00572             const QString& caption = QString::null,
00573                     int options = Notify);
00574 
00593     static int messageBox( QWidget *parent, DialogType type, const QString &text,
00594                     const QString &caption = QString::null,
00595                     const KGuiItem &buttonYes = KStdGuiItem::yes(),
00596                     const KGuiItem &buttonNo = KStdGuiItem::no(),
00597                     int options = Notify);
00598 
00599     /*
00600      * Like @ref messageBox
00601      *
00602      * Only for message boxes of type Information, Sorry or Error.
00603      *
00604      * This function will return immediately, the messagebox will be shown
00605      * once the application enters an event loop and no other messagebox
00606      * is being shown.
00607      *
00608      * Note that if the parent gets deleted, the messagebox will not be
00609      * shown.
00610      */
00611     static void queuedMessageBox( QWidget *parent,
00612                     DialogType type, const QString &text,
00613                     const QString &caption,
00614                     int options );
00615 
00622     static void queuedMessageBox( QWidget *parent,
00623                     DialogType type, const QString &text,
00624                     const QString &caption = QString::null );
00625 
00626 };
00627 
00628 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:00 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001