00001 /* -*- mode: c++ -*- */ 00002 00014 #ifndef _QtFileDialog_H_ 00015 #define _QtFileDialog_H_ 00016 00017 #if QT_VERSION < 0x040000 00018 #include <qfiledialog.h> 00019 #else 00020 #include <q3filedialog.h> 00021 #endif 00022 00023 #include <string> 00024 00034 #if QT_VERSION < 0x040000 00035 class QtFileDialog : public QFileDialog 00036 #else 00037 class QtFileDialog : public Q3FileDialog 00038 #endif 00039 { 00040 00041 private: 00042 00046 static const std::string s_doc_suffix; 00047 00051 static const std::string s_data_suffix; 00052 00055 std::string m_open_filter; 00056 00057 public: 00058 00061 QtFileDialog ( const QString & dirName, 00062 QWidget * parent = 0, 00063 const char * name = 0, 00064 bool modal = FALSE ); 00065 00070 static void openFileError ( const std::string & filename, 00071 std::exception & e ); 00072 00075 void createOpenFilter (); 00076 00079 void createBrowseFilter (); 00080 00083 static const std::string & getDocSuffix (); 00084 00087 static const std::string & getTextSuffix (); 00088 00091 static bool isDocSuffix ( const std::string & suffix ); 00092 00096 bool isFitsSuffix ( const std::string & suffix ) const; 00097 00101 bool isRootSuffix ( const std::string & suffix ) const; 00102 00105 static bool isTextSuffix ( const std::string & suffix ); 00106 00110 int exec (); 00111 00114 static void openTextTuple ( const std::string & filename ); 00115 00118 void openRootTuple ( const std::string & filename ); 00119 00122 bool isFitsFile ( const std::string & filename ) const; 00123 00126 void openFitsTuple ( const std::string & filename ); 00127 00131 std::string getSaveDocFilename (); 00132 00133 }; 00134 00135 #endif // _QtFileDialog_H_