~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to kalarm/lib/label.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  label.h  -  label with radiobutton buddy option
3
3
 *  Program:  kalarm
4
 
 *  Copyright © 2004-2006 by David Jarvie <software@astrojar.org.uk>
 
4
 *  Copyright © 2004-2006 by David Jarvie <djarvie@kde.org>
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
37
37
 *  focus and is switched on. When a non-radio button is specified as a buddy, the
38
38
 *  behaviour is the same as for QLabel.
39
39
 *
40
 
 *  @author David Jarvie <software@astrojar.org.uk>
 
40
 *  @author David Jarvie <djarvie@kde.org>
41
41
 */
42
42
class Label : public QLabel
43
43
{
44
 
                Q_OBJECT
45
 
                friend class LabelFocusWidget;
46
 
        public:
47
 
                /** Constructs an empty label.
48
 
                 *  @param parent The parent object of this widget.
49
 
                 *  @param f    Flags. See QWidget constructor for details.
50
 
                 */
51
 
                explicit Label(QWidget* parent, Qt::WFlags f = 0);
52
 
                /** Constructs a label that displays @p text.
53
 
                 *  @param text   Text string to display.
54
 
                 *  @param parent The parent object of this widget.
55
 
                 *  @param f      Flags. See QWidget constructor for details.
56
 
                 */
57
 
                Label(const QString& text, QWidget* parent, Qt::WFlags f = 0);
58
 
                /** Constructs a label, with a buddy widget, that displays @p text.
59
 
                 *  @param buddy  Buddy widget which receives the keyboard focus when the
60
 
                 *                label's accelerator key is pressed. If @p buddy is a radio
61
 
                 *                button, @p buddy is in addition selected when the
62
 
                 *                accelerator key is pressed.
63
 
                 *  @param text   Text string to display.
64
 
                 *  @param parent The parent object of this widget.
65
 
                 *  @param f      Flags. See QWidget constructor for details.
66
 
                 */
67
 
                Label(QWidget* buddy, const QString& text, QWidget* parent, Qt::WFlags f = 0);
68
 
                /** Sets the label's buddy widget which receives the keyboard focus when the
69
 
                 *  label's accelerator key is pressed. If @p buddy is a radio button,
70
 
                 *  @p buddy is in addition selected when the accelerator key is pressed.
71
 
                 */
72
 
                virtual void      setBuddy(QWidget* buddy);
73
 
        private slots:
74
 
                void              buddyDead();
75
 
        private:
76
 
                void              activated();
77
 
                QRadioButton*     mRadioButton;   // buddy widget if it's a radio button, else 0
78
 
                LabelFocusWidget* mFocusWidget;
 
44
        Q_OBJECT
 
45
        friend class LabelFocusWidget;
 
46
 
 
47
    public:
 
48
        /** Constructs an empty label.
 
49
         *  @param parent The parent object of this widget.
 
50
         *  @param f    Flags. See QWidget constructor for details.
 
51
         */
 
52
        explicit Label(QWidget* parent, Qt::WFlags f = 0);
 
53
        /** Constructs a label that displays @p text.
 
54
         *  @param text   Text string to display.
 
55
         *  @param parent The parent object of this widget.
 
56
         *  @param f      Flags. See QWidget constructor for details.
 
57
         */
 
58
        Label(const QString& text, QWidget* parent, Qt::WFlags f = 0);
 
59
        /** Constructs a label, with a buddy widget, that displays @p text.
 
60
         *  @param buddy  Buddy widget which receives the keyboard focus when the
 
61
         *                label's accelerator key is pressed. If @p buddy is a radio
 
62
         *                button, @p buddy is in addition selected when the
 
63
         *                accelerator key is pressed.
 
64
         *  @param text   Text string to display.
 
65
         *  @param parent The parent object of this widget.
 
66
         *  @param f      Flags. See QWidget constructor for details.
 
67
         */
 
68
        Label(QWidget* buddy, const QString& text, QWidget* parent, Qt::WFlags f = 0);
 
69
        /** Sets the label's buddy widget which receives the keyboard focus when the
 
70
         *  label's accelerator key is pressed. If @p buddy is a radio button,
 
71
         *  @p buddy is in addition selected when the accelerator key is pressed.
 
72
         */
 
73
        virtual void      setBuddy(QWidget* buddy);
 
74
 
 
75
    private slots:
 
76
        void              buddyDead();
 
77
 
 
78
    private:
 
79
        void              activated();
 
80
        QRadioButton*     mRadioButton;   // buddy widget if it's a radio button, else 0
 
81
        LabelFocusWidget* mFocusWidget;
79
82
};
80
83
 
81
84
 
82
85
// Private class for use by Label
83
86
class LabelFocusWidget : public QWidget
84
87
{
85
 
                Q_OBJECT
86
 
        public:
87
 
                LabelFocusWidget(QWidget* parent);
88
 
        protected:
89
 
                virtual void focusInEvent(QFocusEvent*);
 
88
        Q_OBJECT
 
89
    public:
 
90
        LabelFocusWidget(QWidget* parent);
 
91
 
 
92
    protected:
 
93
        virtual void focusInEvent(QFocusEvent*);
90
94
};
91
95
 
92
96
#endif // LABEL_H
 
97
 
 
98
// vim: et sw=4: