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 class KConfig; 00030 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 00075 enum OptionsType 00076 { 00077 Notify = 1, 00078 AllowLink = 2, 00079 Dangerous = 4 00080 }; 00081 00109 static int questionYesNo(QWidget *parent, 00110 const QString &text, 00111 const QString &caption = QString::null, 00112 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00113 const KGuiItem &buttonNo = KStdGuiItem::no(), 00114 const QString &dontAskAgainName = QString::null, 00115 int options = Notify); 00121 static int questionYesNoWId(WId parent_id, 00122 const QString &text, 00123 const QString &caption = QString::null, 00124 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00125 const KGuiItem &buttonNo = KStdGuiItem::no(), 00126 const QString &dontAskAgainName = QString::null, 00127 int options = Notify); 00157 static int questionYesNoCancel(QWidget *parent, 00158 const QString &text, 00159 const QString &caption = QString::null, 00160 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00161 const KGuiItem &buttonNo = KStdGuiItem::no(), 00162 const QString &dontAskAgainName = QString::null, 00163 int options = Notify); 00164 00170 static int questionYesNoCancelWId(WId parent_id, 00171 const QString &text, 00172 const QString &caption = QString::null, 00173 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00174 const KGuiItem &buttonNo = KStdGuiItem::no(), 00175 const QString &dontAskAgainName = QString::null, 00176 int options = Notify); 00177 00209 static int questionYesNoList(QWidget *parent, 00210 const QString &text, 00211 const QStringList &strlist, 00212 const QString &caption = QString::null, 00213 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00214 const KGuiItem &buttonNo = KStdGuiItem::no(), 00215 const QString &dontAskAgainName = QString::null, 00216 int options = Notify); 00217 00223 static int questionYesNoListWId(WId parent_id, 00224 const QString &text, 00225 const QStringList &strlist, 00226 const QString &caption = QString::null, 00227 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00228 const KGuiItem &buttonNo = KStdGuiItem::no(), 00229 const QString &dontAskAgainName = QString::null, 00230 int options = Notify); 00231 00259 static int warningYesNo(QWidget *parent, 00260 const QString &text, 00261 const QString &caption = QString::null, 00262 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00263 const KGuiItem &buttonNo = KStdGuiItem::no(), 00264 const QString &dontAskAgainName = QString::null, 00265 int options = Notify | Dangerous); 00266 00272 static int warningYesNoWId(WId parent_id, 00273 const QString &text, 00274 const QString &caption = QString::null, 00275 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00276 const KGuiItem &buttonNo = KStdGuiItem::no(), 00277 const QString &dontAskAgainName = QString::null, 00278 int options = Notify | Dangerous); 00279 00311 static int warningYesNoList(QWidget *parent, 00312 const QString &text, 00313 const QStringList &strlist, 00314 const QString &caption = QString::null, 00315 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00316 const KGuiItem &buttonNo = KStdGuiItem::no(), 00317 const QString &dontAskAgainName = QString::null, 00318 int options = Notify | Dangerous); 00319 00325 static int warningYesNoListWId(WId parent_id, 00326 const QString &text, 00327 const QStringList &strlist, 00328 const QString &caption = QString::null, 00329 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00330 const KGuiItem &buttonNo = KStdGuiItem::no(), 00331 const QString &dontAskAgainName = QString::null, 00332 int options = Notify | Dangerous); 00333 00360 static int warningContinueCancel(QWidget *parent, 00361 const QString &text, 00362 const QString &caption = QString::null, 00363 const KGuiItem &buttonContinue = KStdGuiItem::cont(), 00364 const QString &dontAskAgainName = QString::null, 00365 int options = Notify); 00366 00372 static int warningContinueCancelWId(WId parent_id, 00373 const QString &text, 00374 const QString &caption = QString::null, 00375 const KGuiItem &buttonContinue = KStdGuiItem::cont(), 00376 const QString &dontAskAgainName = QString::null, 00377 int options = Notify); 00378 00410 static int warningContinueCancelList(QWidget *parent, 00411 const QString &text, 00412 const QStringList &strlist, 00413 const QString &caption = QString::null, 00414 const KGuiItem &buttonContinue = KStdGuiItem::cont(), 00415 const QString &dontAskAgainName = QString::null, 00416 int options = Notify); 00417 00423 static int warningContinueCancelListWId(WId parent_id, 00424 const QString &text, 00425 const QStringList &strlist, 00426 const QString &caption = QString::null, 00427 const KGuiItem &buttonContinue = KStdGuiItem::cont(), 00428 const QString &dontAskAgainName = QString::null, 00429 int options = Notify); 00430 00464 static int warningYesNoCancel(QWidget *parent, 00465 const QString &text, 00466 const QString &caption = QString::null, 00467 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00468 const KGuiItem &buttonNo = KStdGuiItem::no(), 00469 const QString &dontAskAgainName = QString::null, 00470 int options = Notify); 00471 00477 static int warningYesNoCancelWId(WId parent_id, 00478 const QString &text, 00479 const QString &caption = QString::null, 00480 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00481 const KGuiItem &buttonNo = KStdGuiItem::no(), 00482 const QString &dontAskAgainName = QString::null, 00483 int options = Notify); 00484 00523 static int warningYesNoCancelList(QWidget *parent, 00524 const QString &text, 00525 const QStringList &strlist, 00526 const QString &caption = QString::null, 00527 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00528 const KGuiItem &buttonNo = KStdGuiItem::no(), 00529 const QString &dontAskAgainName = QString::null, 00530 int options = Notify); 00531 00537 static int warningYesNoCancelListWId(WId parent_id, 00538 const QString &text, 00539 const QStringList &strlist, 00540 const QString &caption = QString::null, 00541 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00542 const KGuiItem &buttonNo = KStdGuiItem::no(), 00543 const QString &dontAskAgainName = QString::null, 00544 int options = Notify); 00545 00569 static void error(QWidget *parent, 00570 const QString &text, 00571 const QString &caption = QString::null, 00572 int options = Notify); 00573 00579 static void errorWId(WId parent_id, 00580 const QString &text, 00581 const QString &caption = QString::null, 00582 int options = Notify); 00583 00610 static void detailedError(QWidget *parent, 00611 const QString &text, 00612 const QString &details, 00613 const QString &caption = QString::null, 00614 int options = Notify); 00615 00621 static void detailedErrorWId(WId parent_id, 00622 const QString &text, 00623 const QString &details, 00624 const QString &caption = QString::null, 00625 int options = Notify); 00626 00637 static void queuedDetailedError( QWidget *parent, 00638 const QString &text, 00639 const QString &details, 00640 const QString &caption = QString::null); 00641 00647 static void queuedDetailedErrorWId( WId parent_id, 00648 const QString &text, 00649 const QString &details, 00650 const QString &caption = QString::null); 00651 00674 static void sorry(QWidget *parent, 00675 const QString &text, 00676 const QString &caption = QString::null, 00677 int options = Notify); 00678 00684 static void sorryWId(WId parent_id, 00685 const QString &text, 00686 const QString &caption = QString::null, 00687 int options = Notify); 00688 00717 static void detailedSorry(QWidget *parent, 00718 const QString &text, 00719 const QString &details, 00720 const QString &caption = QString::null, 00721 int options = Notify); 00722 00728 static void detailedSorryWId(WId parent_id, 00729 const QString &text, 00730 const QString &details, 00731 const QString &caption = QString::null, 00732 int options = Notify); 00733 00760 static void information(QWidget *parent, 00761 const QString &text, 00762 const QString &caption = QString::null, 00763 const QString &dontShowAgainName = QString::null, 00764 int options = Notify); 00765 00771 static void informationWId(WId parent_id, 00772 const QString &text, 00773 const QString &caption = QString::null, 00774 const QString &dontShowAgainName = QString::null, 00775 int options = Notify); 00776 00807 static void informationList(QWidget *parent, 00808 const QString &text, 00809 const QStringList & strlist, 00810 const QString &caption = QString::null, 00811 const QString &dontShowAgainName = QString::null, 00812 int options = Notify); 00813 00819 static void informationListWId(WId parent_id, 00820 const QString &text, 00821 const QStringList & strlist, 00822 const QString &caption = QString::null, 00823 const QString &dontShowAgainName = QString::null, 00824 int options = Notify); 00825 00830 static void enableAllMessages(); 00831 00839 static void enableMessage(const QString &dontShowAgainName); 00840 00860 static void about(QWidget *parent, 00861 const QString& text, 00862 const QString& caption = QString::null, 00863 int options = Notify); 00864 00889 static int messageBox( QWidget *parent, DialogType type, const QString &text, 00890 const QString &caption, 00891 const KGuiItem &buttonYes, 00892 const KGuiItem &buttonNo, 00893 const QString &dontShowAskAgainName, 00894 int options = Notify); 00895 00914 // KDE4 - merge with above? 00915 static int messageBox( QWidget *parent, DialogType type, const QString &text, 00916 const QString &caption = QString::null, 00917 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00918 const KGuiItem &buttonNo = KStdGuiItem::no(), 00919 int options = Notify); 00920 00926 static int messageBoxWId( WId parent_id, DialogType type, const QString &text, 00927 const QString &caption = QString::null, 00928 const KGuiItem &buttonYes = KStdGuiItem::yes(), 00929 const KGuiItem &buttonNo = KStdGuiItem::no(), 00930 const QString &dontShowAskAgainName = QString::null, 00931 int options = Notify); 00932 00945 static void queuedMessageBox( QWidget *parent, 00946 DialogType type, const QString &text, 00947 const QString &caption, 00948 int options ); 00949 00955 static void queuedMessageBoxWId( WId parent_id, 00956 DialogType type, const QString &text, 00957 const QString &caption, 00958 int options ); 00959 00966 static void queuedMessageBox( QWidget *parent, 00967 DialogType type, const QString &text, 00968 const QString &caption = QString::null ); 00969 00975 static void queuedMessageBoxWId( WId parent_id, 00976 DialogType type, const QString &text, 00977 const QString &caption = QString::null ); 00978 00988 static bool shouldBeShownYesNo(const QString &dontShowAgainName, 00989 ButtonCode &result); 00997 static bool shouldBeShownContinue(const QString &dontShowAgainName); 00998 01007 static void saveDontShowAgainYesNo(const QString &dontShowAgainName, 01008 ButtonCode result); 01009 01017 static void saveDontShowAgainContinue(const QString &dontShowAgainName); 01018 01024 static void setDontShowAskAgainConfig(KConfig* cfg); 01025 private: 01026 static KConfig* againConfig; 01027 }; 01028 01029 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 12 15:08:16 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003