Back to index

scribus-ng  1.3.4.dfsg+svn20071115
scmessagebox.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008     begin                : Oct 2005
00009     copyright            : (C) 2005 by Craig Bradney
00010     email                : cbradney@zip.com.au
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 #ifndef SCMESSAGEBOX_H
00022 #define SCMESSAGEBOX_H
00023 
00024 #include <qmessagebox.h>
00025 #include "scribusapi.h"
00026 
00027 class SCRIBUS_API ScMessageBox : public QMessageBox
00028 {
00029        Q_OBJECT
00030 public:
00031        //Basic copies of the normal constructors
00032        static int information ( QWidget * parent, const QString & caption, const QString & text, int button0, int button1 = 0, int button2 = 0 );
00033        static int information ( QWidget * parent, const QString & caption, const QString & text, const QString & button0Text = QString::null, const QString & button1Text = QString::null, const QString & button2Text = QString::null, int defaultButtonNumber = 0, int escapeButtonNumber = -1 );
00034        static int question ( QWidget * parent, const QString & caption, const QString & text, int button0, int button1 = 0, int button2 = 0 );
00035        static int question ( QWidget * parent, const QString & caption, const QString & text, const QString & button0Text = QString::null, const QString & button1Text = QString::null, const QString & button2Text = QString::null, int defaultButtonNumber = 0, int escapeButtonNumber = -1 );
00036        static int warning ( QWidget * parent, const QString & caption, const QString & text, int button0, int button1, int button2 = 0 );
00037        static int warning ( QWidget * parent, const QString & caption, const QString & text, const QString & button0Text = QString::null, const QString & button1Text = QString::null, const QString & button2Text = QString::null, int defaultButtonNumber = 0, int escapeButtonNumber = -1 );
00038        static int critical ( QWidget * parent, const QString & caption, const QString & text, int button0, int button1, int button2 = 0 );
00039        static int critical ( QWidget * parent, const QString & caption, const QString & text, const QString & button0Text = QString::null, const QString & button1Text = QString::null, const QString & button2Text = QString::null, int defaultButtonNumber = 0, int escapeButtonNumber = -1 );
00040        
00041        //Swap the values the buttons are passing in, return the number of buttons used
00042        static int swapButtonValues(int &b0, int &b1, int &b2);
00043        static int swapButtonValues(QString &b0Text, QString &b1Text, QString &b2Text, int &defaultButton, int &escapeButton);
00044        //Swap the return values attained from the QMessageBox class so in main code we dont have to check for swapped buttons.
00045        static int swapReturnValues(const int, const int, const int, const int, const int);
00046 };
00047 
00048 #endif