~ubuntu-branches/ubuntu/saucy/goldencheetah/saucy

« back to all changes in this revision

Viewing changes to src/QtMacButton.h

  • Committer: Package Import Robot
  • Author(s): KURASHIKI Satoru
  • Date: 2013-08-18 07:02:45 UTC
  • mfrom: (4.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130818070245-zgdvb47e1k3mtgil
Tags: 3.0-3
debian/control: remove needless dependency. (Closes: #719571)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2010 Mark Liversedge (liversedge@gmail.com)
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License as published by the Free
 
6
 * Software Foundation; either version 2 of the License, or (at your option)
 
7
 * any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful, but WITHOUT
 
10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
12
 * more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License along
 
15
 * with this program; if not, write to the Free Software Foundation, Inc., 51
 
16
 * Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 */
 
18
 
 
19
#ifndef GC_QtMacButton_h
 
20
#define GC_QtMacButton_h
 
21
 
 
22
#include <QWidget>
 
23
#include <QVBoxLayout>
 
24
#include <QPointer>
 
25
#include <QMacCocoaViewContainer>
 
26
 
 
27
 
 
28
// Qocoa already dit this, so re-used their code, saved a bit of effort!
 
29
class QtMacButtonWidget;
 
30
class QtMacButton : public QWidget
 
31
{
 
32
    Q_OBJECT
 
33
public:
 
34
    // Matches NSBezelStyle
 
35
    enum BezelStyle {
 
36
       Rounded           = 1,
 
37
       RegularSquare     = 2,
 
38
       Disclosure        = 5,
 
39
       ShadowlessSquare  = 6,
 
40
       Circular          = 7,
 
41
       TexturedSquare    = 8,
 
42
       HelpButton        = 9,
 
43
       SmallSquare       = 10,
 
44
       TexturedRounded   = 11,
 
45
       RoundRect         = 12,
 
46
       Recessed          = 13,
 
47
       RoundedDisclosure = 14,
 
48
#ifdef __MAC_10_7
 
49
       Inline            = 15
 
50
#endif
 
51
    };
 
52
 
 
53
    explicit QtMacButton(QWidget *parent, BezelStyle bezelStyle = Rounded);
 
54
 
 
55
public slots:
 
56
    void setText(const QString &text);
 
57
    void setToolTip(const QString &text);
 
58
    void setImage(const QPixmap *image);
 
59
    void setChecked(bool checked);
 
60
    void setWidth(int x);
 
61
    void setSelected(bool x);
 
62
    void setIconAndText();
 
63
 
 
64
public:
 
65
    void setCheckable(bool checkable);
 
66
    bool isChecked();
 
67
 
 
68
signals:
 
69
    void clicked(bool checked = false);
 
70
 
 
71
private:
 
72
    friend class QtMacButtonWidget;
 
73
    QPointer<QtMacButtonWidget> qtw;
 
74
    int width;
 
75
};
 
76
 
 
77
#endif