~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to src/topushbutton.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-09-11 12:37:52 UTC
  • mfrom: (1.2.8 upstream) (3.3.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090911123752-qhu322xlclo2hpqu
Tags: 2.1.0-1
* New upstream version, the rebuild closes: #540046.
* Bumped Standards-Version to 3.8.3, no changes needed.
* New project homepage.
* Removed no longer needed 01_missing_includes.dpatch.
* Removed no longer used dh_desktop call.
* Added README.source file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* BEGIN_COMMON_COPYRIGHT_HEADER
 
3
 *
 
4
 * TOra - An Oracle Toolkit for DBA's and developers
 
5
 * 
 
6
 * Shared/mixed copyright is held throughout files in this product
 
7
 * 
 
8
 * Portions Copyright (C) 2000-2001 Underscore AB
 
9
 * Portions Copyright (C) 2003-2005 Quest Software, Inc.
 
10
 * Portions Copyright (C) 2004-2009 Numerous Other Contributors
 
11
 * 
 
12
 * This program is free software; you can redistribute it and/or
 
13
 * modify it under the terms of the GNU General Public License
 
14
 * as published by the Free Software Foundation;  only version 2 of
 
15
 * the License is valid for this program.
 
16
 * 
 
17
 * This program is distributed in the hope that it will be useful,
 
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
 * GNU General Public License for more details.
 
21
 * 
 
22
 * You should have received a copy of the GNU General Public License
 
23
 * along with this program; if not, write to the Free Software
 
24
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
25
 * 
 
26
 *      As a special exception, you have permission to link this program
 
27
 *      with the Oracle Client libraries and distribute executables, as long
 
28
 *      as you follow the requirements of the GNU GPL in regard to all of the
 
29
 *      software in the executable aside from Oracle client libraries.
 
30
 * 
 
31
 *      Specifically you are not permitted to link this program with the
 
32
 *      Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
 
33
 *      And you are not permitted to distribute binaries compiled against
 
34
 *      these libraries. 
 
35
 * 
 
36
 *      You may link this product with any GPL'd Qt library.
 
37
 * 
 
38
 * All trademarks belong to their respective owners.
 
39
 *
 
40
 * END_COMMON_COPYRIGHT_HEADER */
 
41
 
 
42
#ifndef TOPUSHBUTTON_H
 
43
#define TOPUSHBUTTON_H
 
44
 
 
45
#include "config.h"
 
46
 
 
47
#include <QPushButton>
 
48
 
 
49
 
 
50
// a button that can be rotated.
 
51
 
 
52
class toPushButton : public QPushButton
 
53
{
 
54
    Q_OBJECT;
 
55
 
 
56
public:
 
57
    enum Rotation
 
58
    {
 
59
        NoRotation       = 0,
 
60
        UpsideDown       = 180,
 
61
        Clockwise        = 90,
 
62
        CounterClockwise = 270
 
63
    };
 
64
 
 
65
    explicit toPushButton(QWidget *parent = 0);
 
66
    explicit toPushButton(const QString &text,
 
67
                          QWidget *parent = 0);
 
68
    explicit toPushButton(const QIcon &icon,
 
69
                          const QString &text,
 
70
                          QWidget *parent = 0);
 
71
 
 
72
    /**
 
73
     * Return the rotation set for this button
 
74
     *
 
75
     */
 
76
    inline Rotation rotation() const
 
77
    {
 
78
        return rotate;
 
79
    }
 
80
 
 
81
 
 
82
    /**
 
83
     * Set rotation for this button
 
84
     *
 
85
     */
 
86
    void setRotation(Rotation rotation);
 
87
 
 
88
 
 
89
    virtual QSize sizeHint() const;
 
90
    virtual QSize minimumSizeHint() const;
 
91
 
 
92
protected:
 
93
    virtual void paintEvent(QPaintEvent *);
 
94
 
 
95
private:
 
96
    Rotation rotate;
 
97
    QStyleOptionButton getStyleOption();
 
98
};
 
99
 
 
100
#endif