SilentEye 0.4.1

optiondialog.h

Go to the documentation of this file.
00001 //  This file is part of SilentEye.
00002 //
00003 //  SilentEye is free software: you can redistribute it and/or modify
00004 //  it under the terms of the GNU General Public License as published by
00005 //  the Free Software Foundation, either version 3 of the License, or
00006 //  (at your option) any later version.
00007 //
00008 //  SilentEye is distributed in the hope that it will be useful,
00009 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //  GNU General Public License for more details.
00012 //
00013 //  You should have received a copy of the GNU General Public License
00014 //  along with SilentEye. If not, see <http://www.gnu.org/licenses/>.
00015 
00016 #ifndef OPTIONDIALOG_H_
00017 #define OPTIONDIALOG_H_
00018 
00019 #include <QtGui>
00020 #include <image.h>
00021 #include <config.h>
00022 #include <logger.h>
00023 
00024 #include "ui_optiondialog.h"
00025 #include "modulemanager.h"
00026 
00027 using namespace SilentEyeFramework;
00028 
00029 namespace SilentEye {
00030 
00032     class OptionDialog : public QDialog, public Ui::OptionDialog
00033     {
00034         Q_OBJECT;
00035 
00036     protected:
00037         QPointer<Logger> m_logger;
00038 
00039         QPointer<Media> m_md;
00040         QString m_filePath;
00041         QWidget* m_optionWidget;
00042 
00043         bool m_checkSize;
00044         int m_originalHeight;
00045 
00046     public:
00047         OptionDialog(QWidget* parent=0);
00048         ~OptionDialog();
00049 
00050         void setMedia(QPointer<Media>);
00051 
00052     protected:
00053         void setupDialog();
00054         void updateDialogSize();
00055         void loadFormats();
00056         void loadEncryptionTypes();
00057         bool isDialogReady();
00058         bool checkCryptoPassword();
00059         FormatModuleInterface* currentFormatModule();
00060         CryptoModuleInterface* currentCryptoModule();
00061         Data::DataFormat currentCharset();
00062         int dataSizeRemaining(FormatModuleInterface* module = NULL, QPointer<Media> = QPointer<Media>());
00063         void displayException(const QString& title, const SilentEyeException e);
00064         virtual QWidget* currentFormatWidget(FormatModuleInterface*) = 0;
00065 
00066     private:
00067         void connectSignals();
00068 
00069     protected slots:
00070         virtual void ok() = 0;
00071         void rejected();
00072         void selectFolder();
00073         void selectFile();
00074         void addFile(const QString&);
00075         void removeFile();
00076         void formatChanged(const QString&);
00077         void cryptoStatusChanged(int);
00078         void cryptoPwd1TextEdited(QString);
00079         void cryptoPwd2TextEdited(QString);
00080         void valueChanged();
00081     };
00082 }
00083 #endif