File: oxygengenericanimationconfigitem.h

package info (click to toggle)
oxygen 4%3A6.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,492 kB
  • sloc: cpp: 23,036; python: 39; sh: 14; makefile: 5
file content (86 lines) | stat: -rw-r--r-- 2,072 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef oxygengenericanimationconfigitem_h
#define oxygengenericanimationconfigitem_h

//////////////////////////////////////////////////////////////////////////////
// oxygengenericanimationconfigitem.h
// animation configuration item
// -------------------
//
// SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
//
// SPDX-License-Identifier: MIT
//////////////////////////////////////////////////////////////////////////////

#include "oxygen_config_export.h"
#include "oxygenanimationconfigitem.h"

#include <QFrame>
#include <QPointer>
#include <QSpinBox>

class Ui_GenericAnimationConfigBox;

namespace Oxygen
{
class OXYGEN_CONFIG_EXPORT GenericAnimationConfigBox : public QFrame
{
    Q_OBJECT

public:
    //* constructor
    explicit GenericAnimationConfigBox(QWidget *);

    //* destructor
    virtual ~GenericAnimationConfigBox();

    //* duration spin box
    QSpinBox *durationSpinBox(void) const;

private:
    Ui_GenericAnimationConfigBox *ui = nullptr;
};

//* generic animation config item
class OXYGEN_CONFIG_EXPORT GenericAnimationConfigItem : public AnimationConfigItem
{
    Q_OBJECT

public:
    //* constructor
    explicit GenericAnimationConfigItem(QWidget *parent, const QString &title = QString(), const QString &description = QString())
        : AnimationConfigItem(parent, title, description)
    {
    }

    //* configure
    void initializeConfigurationWidget(QWidget *) override;

    //* configuration widget
    QWidget *configurationWidget(void) const override
    {
        return _configurationWidget.data();
    }

    //* duration
    virtual int duration(void) const
    {
        return _configurationWidget ? _configurationWidget.data()->durationSpinBox()->value() : 0;
    }

public Q_SLOTS:

    //* duration
    virtual void setDuration(int value)
    {
        if (_configurationWidget) {
            _configurationWidget.data()->durationSpinBox()->setValue(value);
        }
    }

private:
    //* configuration widget
    QPointer<GenericAnimationConfigBox> _configurationWidget;
};
}

#endif