00001 /* -*- mode: c++ -*- */ 00002 00014 #ifndef _QtFileDialog_H_ 00015 #define _QtFileDialog_H_ 00016 00017 #include <qglobal.h> // for version 00018 #if QT_VERSION < 0x040000 00019 #include <qfiledialog.h> 00020 #else 00021 #include <q3filedialog.h> 00022 #endif 00023 00024 #include <string> 00025 00026 namespace hippodraw { 00027 00028 class DataSource; 00029 00049 class QtFileDialog 00050 { 00051 00052 private: 00053 00057 static const std::string s_doc_suffix; 00058 00062 static const std::string s_data_suffix; 00063 00066 static std::string s_open_filter; 00067 00072 void checkDuplicateLabels ( const DataSource * source, QWidget * ); 00073 00074 public: 00075 00078 QtFileDialog (); 00079 00082 static const std::string & createOpenFilter (); 00083 00086 static const std::string & createBrowseFilter (); 00087 00090 static const std::string & createDocumentFilter (); 00091 00094 static const std::string & createExportFilter (); 00095 00098 static const std::string & getDocSuffix (); 00099 00102 static const std::string & getTextSuffix (); 00103 00106 static bool isDocSuffix ( const std::string & suffix ); 00107 00111 static bool isFitsSuffix ( const std::string & suffix ); 00112 00116 static bool isRootSuffix ( const std::string & suffix ); 00117 00120 static bool isTextSuffix ( const std::string & suffix ); 00121 00124 static void openTextTuple ( const std::string & filename ); 00125 00128 void openRootTuple ( const std::string & filename, QWidget * parent ); 00129 00132 static bool isFitsFile ( const std::string & filename ); 00133 00136 static bool isZippedFitsSuffix ( const std::string & suffix); 00137 00140 void openFitsTuple ( const std::string & filename, QWidget * parent ); 00141 00142 00143 #ifdef HAVE_CFITSIO 00144 00149 void saveFitsTuple ( const std::string & filename, QWidget * parent ); 00150 #endif 00151 00154 void saveTextTuple ( const std::string & filename, QWidget * parent ); 00155 00160 static std::string getExportTupleFilename ( QWidget * widget); 00161 00162 }; 00163 00164 } // namespace hippodraw 00165 00166 #endif // _QtFileDialog_H_