~ubuntu-branches/ubuntu/vivid/muon/vivid-proposed

« back to all changes in this revision

Viewing changes to installer/BreadcrumbWidget/BreadcrumbItemButton.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-03-24 23:06:35 UTC
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: package-import@ubuntu.com-20150324230635-nvt7aq7kqvaxq36e
Tags: upstream-5.2.2-1
ImportĀ upstreamĀ versionĀ 5.2.2-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************************
 
2
 * Copyright (c) 2006 Peter Penz <peter.penz@gmx.at>                                    *
 
3
 * Copyright (c) 2006 Aaron Seigo <aseigo@kde.org>                                      *
 
4
 * Copyright (c) 2009 Seb Ruiz <ruiz@kde.org>                                           *
 
5
 *                                                                                      *
 
6
 * This program is free software; you can redistribute it and/or modify it under        *
 
7
 * the terms of the GNU General Public License as published by the Free Software        *
 
8
 * Foundation; either version 2 of the License, or (at your option) any later           *
 
9
 * version.                                                                             *
 
10
 *                                                                                      *
 
11
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
 
12
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
 
13
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
 
14
 *                                                                                      *
 
15
 * You should have received a copy of the GNU General Public License along with         *
 
16
 * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
 
17
 ****************************************************************************************/
 
18
 
 
19
#ifndef BREADCRUMBITEMBUTTON_P_H
 
20
#define BREADCRUMBITEMBUTTON_P_H
 
21
 
 
22
#include <QColor>
 
23
#include <QtWidgets/QPushButton>
 
24
 
 
25
class QEvent;
 
26
 
 
27
/**
 
28
 * @brief Base class for buttons of the URL navigator.
 
29
 *
 
30
 * Each button of the URL navigator contains an URL, which
 
31
 * is set as soon as the button has been clicked.
 
32
 */
 
33
class BreadcrumbItemButton : public QPushButton
 
34
{
 
35
    Q_OBJECT
 
36
 
 
37
    public:
 
38
        BreadcrumbItemButton( QWidget* parent );
 
39
        BreadcrumbItemButton( const QIcon &icon, const QString &text, QWidget *parent );
 
40
        virtual ~BreadcrumbItemButton();
 
41
 
 
42
        void setActive( const bool active );
 
43
 
 
44
        virtual QSize sizeHint() const;
 
45
 
 
46
    protected:
 
47
        enum DisplayHint
 
48
        {
 
49
            ActiveHint = 1,
 
50
            HoverHint = 2
 
51
        };
 
52
 
 
53
        void setDisplayHintEnabled(DisplayHint hint, bool enable);
 
54
        bool isDisplayHintEnabled(DisplayHint hint) const;
 
55
 
 
56
        virtual void enterEvent(QEvent* event);
 
57
        virtual void leaveEvent(QEvent* event);
 
58
 
 
59
        virtual void paintEvent(QPaintEvent* event);
 
60
        virtual void drawHoverBackground(QPainter* painter);
 
61
 
 
62
        /** Returns the foreground color by respecting the current display hint. */
 
63
        QColor foregroundColor() const;
 
64
 
 
65
    private:
 
66
        void init();
 
67
        int m_displayHint;
 
68
};
 
69
 
 
70
#endif