~ubuntu-branches/ubuntu/lucid/lastfm/lucid

« back to all changes in this revision

Viewing changes to src/libUnicorn/LastMessageBox.h

  • Committer: Bazaar Package Importer
  • Author(s): Devid Filoni
  • Date: 2008-07-14 16:46:20 UTC
  • mfrom: (1.1.7 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080714164620-67hoz9fs177wpgmr
Tags: 1:1.5.1.31879.dfsg-1ubuntu1
* Merge from Debian unstable (LP: #248100), remaining changes:
  - debian/rules: add dh_icons call
  + debian/control:
    - switch iceweasel to firefox in Recommends field
    - modify debhelper version to >= 5.0.51~
    - modify Maintainer to Ubuntu MOTU Developers

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
*   Copyright (C) 2007 by                                                 *
3
 
*      Philipp Maihart, Last.fm Ltd <phil@last.fm>                        *
4
 
*                                                                         *
5
 
*   This program is free software; you can redistribute it and/or modify  *
6
 
*   it under the terms of the GNU General Public License as published by  *
7
 
*   the Free Software Foundation; either version 2 of the License, or     *
8
 
*   (at your option) any later version.                                   *
9
 
*                                                                         *
10
 
*   This program is distributed in the hope that it will be useful,       *
11
 
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
 
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
 
*   GNU General Public License for more details.                          *
14
 
*                                                                         *
15
 
*   You should have received a copy of the GNU General Public License     *
16
 
*   along with this program; if not, write to the                         *
17
 
*   Free Software Foundation, Inc.,                                       *
18
 
*   51 Franklin Steet, Fifth Floor, Boston, MA  02110-1301, USA.          *
19
 
***************************************************************************/
20
 
 
21
 
#ifndef MESSAGEBOX_H
22
 
#define MESSAGEBOX_H
23
 
 
24
 
#include "UnicornDllExportMacro.h"
25
 
 
26
 
#include <QMessageBox>
27
 
 
28
 
 
29
 
class UNICORN_DLLEXPORT LastMessageBox : public QMessageBox
30
 
{
31
 
    Q_OBJECT
32
 
 
33
 
public:
34
 
    LastMessageBox( QWidget* parent = 0 );
35
 
    LastMessageBox( Icon icon,
36
 
                    const QString& title,
37
 
                    const QString& text,
38
 
                    StandardButtons buttons = NoButton,
39
 
                    QWidget* parent = 0,
40
 
                    Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint,
41
 
                    QStringList buttonTexts = QStringList() );
42
 
 
43
 
    virtual void setText ( const QString& text );
44
 
    virtual void setWindowTitle ( const QString& title );
45
 
 
46
 
    //FIXME wtf? Hardcoded?
47
 
    virtual const QSize sizeHint() { return QSize( 480, 153 ); }
48
 
 
49
 
    static QMessageBox::StandardButton
50
 
    critical( const QString& title,
51
 
              const QString& text,
52
 
              StandardButtons buttons = Ok,
53
 
              StandardButton defaultButton = NoButton,
54
 
              QStringList buttonTexts = QStringList(),
55
 
              QWidget* parent = 0 );
56
 
 
57
 
    static QMessageBox::StandardButton
58
 
    information( const QString& title,
59
 
                 const QString & text,
60
 
                 StandardButtons buttons = Ok,
61
 
                 StandardButton defaultButton = NoButton,
62
 
                 QStringList buttonTexts = QStringList(),
63
 
                 QWidget* parent = 0 );
64
 
 
65
 
    static QMessageBox::StandardButton
66
 
    question( const QString& title,
67
 
              const QString& text,
68
 
              StandardButtons buttons = Ok,
69
 
              StandardButton defaultButton = NoButton,
70
 
              QStringList buttonTexts = QStringList(),
71
 
              QWidget* parent = 0 );
72
 
 
73
 
    static QMessageBox::StandardButton
74
 
    warning( const QString& title,
75
 
             const QString& text,
76
 
             StandardButtons buttons = Ok,
77
 
             StandardButton defaultButton = NoButton,
78
 
             QStringList buttonTexts = QStringList(),
79
 
             QWidget* parent = 0 );
80
 
};
81
 
 
82
 
 
83
 
#ifdef Q_WS_MAC
84
 
QMessageBox::StandardButton
85
 
showMacMessageBox(QWidget *parent, QMessageBox::Icon icon,
86
 
                  const QString& title, const QString& text,
87
 
                  QMessageBox::StandardButtons buttons,
88
 
                  QMessageBox::StandardButton defaultButton,
89
 
                  QStringList buttonTexts = QStringList()
90
 
                  );
91
 
#endif
92
 
 
93
 
#endif // MESSAGEBOX_H
 
1
/***************************************************************************
 
2
*   Copyright (C) 2007 by                                                 *
 
3
*      Philipp Maihart, Last.fm Ltd <phil@last.fm>                        *
 
4
*                                                                         *
 
5
*   This program is free software; you can redistribute it and/or modify  *
 
6
*   it under the terms of the GNU General Public License as published by  *
 
7
*   the Free Software Foundation; either version 2 of the License, or     *
 
8
*   (at your option) any later version.                                   *
 
9
*                                                                         *
 
10
*   This program is distributed in the hope that it will be useful,       *
 
11
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
*   GNU General Public License for more details.                          *
 
14
*                                                                         *
 
15
*   You should have received a copy of the GNU General Public License     *
 
16
*   along with this program; if not, write to the                         *
 
17
*   Free Software Foundation, Inc.,                                       *
 
18
*   51 Franklin Steet, Fifth Floor, Boston, MA  02110-1301, USA.          *
 
19
***************************************************************************/
 
20
 
 
21
#ifndef MESSAGEBOX_H
 
22
#define MESSAGEBOX_H
 
23
 
 
24
#include "UnicornDllExportMacro.h"
 
25
 
 
26
#include <QMessageBox>
 
27
 
 
28
 
 
29
class UNICORN_DLLEXPORT LastMessageBox : public QMessageBox
 
30
{
 
31
    Q_OBJECT
 
32
 
 
33
public:
 
34
    LastMessageBox( QWidget* parent = 0 );
 
35
    LastMessageBox( Icon icon,
 
36
                    const QString& title,
 
37
                    const QString& text,
 
38
                    StandardButtons buttons = NoButton,
 
39
                    QWidget* parent = 0,
 
40
                    Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint,
 
41
                    QStringList buttonTexts = QStringList() );
 
42
 
 
43
    virtual void setText ( const QString& text );
 
44
    virtual void setWindowTitle ( const QString& title );
 
45
 
 
46
    virtual const QSize sizeHint();
 
47
 
 
48
    static QMessageBox::StandardButton
 
49
    critical( const QString& title,
 
50
              const QString& text,
 
51
              StandardButtons buttons = Ok,
 
52
              StandardButton defaultButton = NoButton,
 
53
              QStringList buttonTexts = QStringList(),
 
54
              QWidget* parent = 0 );
 
55
 
 
56
    static void
 
57
    say( const QString & text )
 
58
    {
 
59
        information( "", text ); 
 
60
    }
 
61
 
 
62
    static QMessageBox::StandardButton
 
63
    information( const QString& title,
 
64
                 const QString & text,
 
65
                 StandardButtons buttons = Ok,
 
66
                 StandardButton defaultButton = NoButton,
 
67
                 QStringList buttonTexts = QStringList(),
 
68
                 QWidget* parent = 0 );
 
69
 
 
70
    static QMessageBox::StandardButton
 
71
    question( const QString& title,
 
72
              const QString& text,
 
73
              StandardButtons buttons = Ok,
 
74
              StandardButton defaultButton = NoButton,
 
75
              QStringList buttonTexts = QStringList(),
 
76
              QWidget* parent = 0 );
 
77
 
 
78
    static QMessageBox::StandardButton
 
79
    warning( const QString& title,
 
80
             const QString& text,
 
81
             StandardButtons buttons = Ok,
 
82
             StandardButton defaultButton = NoButton,
 
83
             QStringList buttonTexts = QStringList(),
 
84
             QWidget* parent = 0 );
 
85
};
 
86
 
 
87
 
 
88
#ifdef Q_WS_MAC
 
89
QMessageBox::StandardButton
 
90
showMacMessageBox(QWidget *parent, QMessageBox::Icon icon,
 
91
                  const QString& title, const QString& text,
 
92
                  QMessageBox::StandardButtons buttons,
 
93
                  QMessageBox::StandardButton defaultButton,
 
94
                  QStringList buttonTexts = QStringList()
 
95
                  );
 
96
#endif
 
97
 
 
98
#endif // MESSAGEBOX_H