File: optionslayer.h

package info (click to toggle)
soundkonverter 3.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,012 kB
  • sloc: cpp: 30,779; sh: 59; xml: 50; makefile: 7
file content (92 lines) | stat: -rw-r--r-- 1,905 bytes parent folder | download | duplicates (3)
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
87
88
89
90
91
92
//
// C++ Interface: optionslayer
//
// Description:
//
//
// Author: Daniel Faust <hessijames@gmail.com>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef OPTIONSLAYER_H
#define OPTIONSLAYER_H

#include <QWidget>
#include <QColor>
#include <QTimer>
#include <QUrl>

class Config;
class Options;
class ConversionOptions;

class QFrame;
class KPushButton;

/**
	@author Daniel Faust <hessijames@gmail.com>
*/
class OptionsLayer : public QWidget
{
    Q_OBJECT
public:
    /** Constructor */
    OptionsLayer( Config *config, QWidget *parent );

    /** Destructor */
    ~OptionsLayer();

    void fadeIn();
    void fadeOut(); // should be private
    void addUrls( const QList<QUrl>& _urls );

private:
    QFrame *frame;
    Options *options;
    KPushButton *pOk;
    KPushButton *pCancel;

    QTimer fadeTimer;
    float fadeAlpha;
    int fadeMode; // 1 = fade in, 2 = fade out

    QList<QUrl> urls;
    QString command;

    inline QBrush brushSetAlpha( QBrush brush, const int alpha )
    {
        QColor color = brush.color();
        color.setAlpha( alpha );
        brush.setColor( color );
        return brush;
    }

public slots:
    /** Set the current profile */
    void setProfile( const QString& profile );

    /** Set the current format */
    void setFormat( const QString& format );

    /** Set the current output directory */
    void setOutputDirectory( const QString& directory );

    /** Set the command to execute after the conversion is complete */
    void setCommand( const QString& _command );

    /** Set the current conversion options */
    void setCurrentConversionOptions( const ConversionOptions *options );

private slots:
    void fadeAnim();
    void abort();
    void ok();

signals:
    void done( const QList<QUrl>& urls, ConversionOptions *options, const QString& command );
    void saveFileList();

};

#endif