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

« back to all changes in this revision

Viewing changes to kalarm/lib/checkbox.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
 *  checkbox.h  -  check box with focus widget and read-only options
3
3
 *  Program:  kalarm
4
 
 *  Copyright © 2002,2003,2005,2006 by David Jarvie <software@astrojar.org.uk>
 
4
 *  Copyright © 2002,2003,2005,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
39
39
 *  The widget may be set as read-only. This has the same effect as disabling it, except
40
40
 *  that its appearance is unchanged.
41
41
 *
42
 
 *  @author David Jarvie <software@astrojar.org.uk>
 
42
 *  @author David Jarvie <djarvie@kde.org>
43
43
 */
44
44
class CheckBox : public QCheckBox
45
45
{
46
 
                Q_OBJECT
47
 
        public:
48
 
                /** Constructor.
49
 
                 *  @param parent The parent object of this widget.
50
 
                 */
51
 
                explicit CheckBox(QWidget* parent);
52
 
                /** Constructor.
53
 
                 *  @param text Text to display.
54
 
                 *  @param parent The parent object of this widget.
55
 
                 */
56
 
                CheckBox(const QString& text, QWidget* parent);
57
 
                /** Returns true if the widget is read only. */
58
 
                bool         isReadOnly() const          { return mReadOnly; }
59
 
                /** Sets whether the check box is read-only for the user. If read-only,
60
 
                 *  its state cannot be changed by the user.
61
 
                 *  @param readOnly True to set the widget read-only, false to set it read-write.
62
 
                 */
63
 
                virtual void setReadOnly(bool readOnly);
64
 
                /** Returns the widget which receives focus when the user selects the check box by clicking on it. */
65
 
                QWidget*     focusWidget() const         { return mFocusWidget; }
66
 
                /** Specifies a widget to receive focus when the user selects the check box by clicking on it.
67
 
                 *  @param widget Widget to receive focus.
68
 
                 *  @param enable If true, @p widget will be enabled before receiving focus. If
69
 
                 *                false, the enabled state of @p widget will be left unchanged when
70
 
                 *                the check box is clicked.
71
 
                 */
72
 
                void         setFocusWidget(QWidget* widget, bool enable = true);
73
 
        protected:
74
 
                virtual void mousePressEvent(QMouseEvent*);
75
 
                virtual void mouseReleaseEvent(QMouseEvent*);
76
 
                virtual void mouseMoveEvent(QMouseEvent*);
77
 
                virtual void keyPressEvent(QKeyEvent*);
78
 
                virtual void keyReleaseEvent(QKeyEvent*);
79
 
        protected slots:
80
 
                void         slotClicked();
81
 
        private:
82
 
                Qt::FocusPolicy mFocusPolicy;       // default focus policy for the QCheckBox
83
 
                QWidget*             mFocusWidget;       // widget to receive focus when button is clicked on
84
 
                bool                 mFocusWidgetEnable; // enable focus widget before setting focus
85
 
                bool                 mReadOnly;          // value cannot be changed
 
46
        Q_OBJECT
 
47
    public:
 
48
        /** Constructor.
 
49
         *  @param parent The parent object of this widget.
 
50
         */
 
51
        explicit CheckBox(QWidget* parent);
 
52
        /** Constructor.
 
53
         *  @param text Text to display.
 
54
         *  @param parent The parent object of this widget.
 
55
         */
 
56
        CheckBox(const QString& text, QWidget* parent);
 
57
        /** Returns true if the widget is read only. */
 
58
        bool         isReadOnly() const          { return mReadOnly; }
 
59
        /** Sets whether the check box is read-only for the user. If read-only,
 
60
         *  its state cannot be changed by the user.
 
61
         *  @param readOnly True to set the widget read-only, false to set it read-write.
 
62
         */
 
63
        virtual void setReadOnly(bool readOnly);
 
64
        /** Returns the widget which receives focus when the user selects the check box by clicking on it. */
 
65
        QWidget*     focusWidget() const         { return mFocusWidget; }
 
66
        /** Specifies a widget to receive focus when the user selects the check box by clicking on it.
 
67
         *  @param widget Widget to receive focus.
 
68
         *  @param enable If true, @p widget will be enabled before receiving focus. If
 
69
         *                false, the enabled state of @p widget will be left unchanged when
 
70
         *                the check box is clicked.
 
71
         */
 
72
        void         setFocusWidget(QWidget* widget, bool enable = true);
 
73
    protected:
 
74
        virtual void mousePressEvent(QMouseEvent*);
 
75
        virtual void mouseReleaseEvent(QMouseEvent*);
 
76
        virtual void mouseMoveEvent(QMouseEvent*);
 
77
        virtual void keyPressEvent(QKeyEvent*);
 
78
        virtual void keyReleaseEvent(QKeyEvent*);
 
79
    protected slots:
 
80
        void         slotClicked();
 
81
    private:
 
82
        Qt::FocusPolicy mFocusPolicy;       // default focus policy for the QCheckBox
 
83
        QWidget*        mFocusWidget;       // widget to receive focus when button is clicked on
 
84
        bool            mFocusWidgetEnable; // enable focus widget before setting focus
 
85
        bool            mReadOnly;          // value cannot be changed
86
86
};
87
87
 
88
88
#endif // CHECKBOX_H
 
89
 
 
90
// vim: et sw=4: