summaryrefslogtreecommitdiff
path: root/plugins/Themes/Oxygen/ThemesFactory.h
blob: f5e304f23defedf0da0c68a470a365c8aaa7369c (plain)
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
/** \file factory.h
\brief Define the factory, to create instance of the interface
\author alpha_one_x86
\licence GPL3, see the file COPYING */

#ifndef FACTORY_H
#define FACTORY_H

#include <QObject>
#include <QWidget>
#include <QMenu>
#include <QCloseEvent>
#include <QFile>
#include <QIcon>
#include <QColor>
#include <QPixmap>

#include "../../../interface/PluginInterface_Themes.h"
#include "ui_themesOptions.h"
#include "interface.h"
#include "Environment.h"

namespace Ui {
    class themesOptions;
}

/// \brief Define the factory, to create instance of the interface
class ThemesFactory : public PluginInterface_ThemesFactory
{
    Q_OBJECT
    #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT
    Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.ThemesFactory/1.0.1.0" FILE "plugin.json")
    Q_INTERFACES(PluginInterface_ThemesFactory)
    #endif
public:
    ThemesFactory();
    ~ThemesFactory();
    /// \brief to return the instance of the copy engine
    PluginInterface_Themes * getInstance();
    /// \brief set the resources, to store options, to have facilityInterface
    void setResources(OptionInterface * optionsEngine,const std::string &
                  #ifdef ULTRACOPIER_PLUGIN_DEBUG
                  writePath
                  #endif
                  ,const std::string &
                  #ifdef ULTRACOPIER_PLUGIN_DEBUG
                  pluginPath
                  #endif
                  ,FacilityInterface * facilityEngine,const bool &portableVersion);
    /// \brief to get the default options widget
    QWidget * options();
    /// \brief to get a resource icon
    QIcon getIcon(const std::string &fileName) const;
private slots:
    void checkBoxShowSpeedHaveChanged(bool toggled);
    void checkBoxStartWithMoreButtonPushedHaveChanged(bool toggled);
    void comboBox_copyEnd(int value);
    void speedWithProgressBar(bool toggled);
    void checkBoxShowSpeed(bool checked);
    void minimizeToSystray(bool checked);
    void alwaysOnTop(bool checked);
    void showDualProgression(bool checked);
    void on_SliderSpeed_valueChanged(int value);
    void uiUpdateSpeed();
    void updateSpeed();
    void progressColorWrite_clicked();
    void progressColorRead_clicked();
    void progressColorRemaining_clicked();
    void updateProgressionColorBar();
    void setShowProgressionInTheTitle();
    void startMinimized(bool checked);
public slots:
    void resetOptions();
    void newLanguageLoaded();
private:
    OptionInterface * optionsEngine;
    Ui::themesOptions *ui;
    QWidget *tempWidget;
    FacilityInterface * facilityEngine;
    int32_t currentSpeed;///< in KB/s, assume as 0KB/s as default like every where
    QColor progressColorWrite,progressColorRead,progressColorRemaining;
signals:
    void reloadLanguage() const;
};

#endif // FACTORY_H