OpenMW
apps/opencs/view/doc/filedialog.hpp
Go to the documentation of this file.
00001 #ifndef FILEDIALOG_HPP
00002 #define FILEDIALOG_HPP
00003 
00004 #include <QDialog>
00005 #include <QModelIndex>
00006 
00007 #include <boost/filesystem/path.hpp>
00008 #include "adjusterwidget.hpp"
00009 
00010 #ifndef CS_QT_BOOST_FILESYSTEM_PATH_DECLARED
00011 #define CS_QT_BOOST_FILESYSTEM_PATH_DECLARED
00012 Q_DECLARE_METATYPE (boost::filesystem::path)
00013 #endif
00014 
00015 #include "ui_filedialog.h"
00016 
00017 class DataFilesModel;
00018 class PluginsProxyModel;
00019 
00020 namespace ContentSelectorView
00021 {
00022     class ContentSelector;
00023 }
00024 
00025 namespace CSVDoc
00026 {
00027     class FileWidget;
00028 
00029     class FileDialog : public QDialog
00030     {
00031         Q_OBJECT
00032 
00033     private:
00034 
00035         ContentSelectorView::ContentSelector *mSelector;
00036         Ui::FileDialog ui;
00037         ContentAction mAction;
00038         FileWidget *mFileWidget;
00039         AdjusterWidget *mAdjusterWidget;
00040 
00041     public:
00042 
00043         explicit FileDialog(QWidget *parent = 0);
00044         void showDialog (ContentAction action);
00045 
00046         void addFiles (const QString &path);
00047 
00048         QString filename() const;
00049         QStringList selectedFilePaths();
00050 
00051         void setLocalData (const boost::filesystem::path& localData);
00052 
00053     private:
00054 
00055         void buildNewFileView();
00056         void buildOpenFileView();
00057 
00058     signals:
00059 
00060         void signalOpenFiles (const boost::filesystem::path &path);
00061         void signalCreateNewFile (const boost::filesystem::path &path);
00062 
00063         void signalUpdateAcceptButton (bool, int);
00064 
00065     private slots:
00066 
00067         void slotNewFile();
00068         void slotOpenFile();
00069         void slotUpdateAcceptButton (int);
00070         void slotUpdateAcceptButton (const QString &, bool);
00071         void slotRejected();
00072     };
00073 }
00074 #endif // FILEDIALOG_HPP