QtFileDialog.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _QtFileDialog_H_
15 #define _QtFileDialog_H_
16 
17 #include <qglobal.h> // for version
18 #if QT_VERSION < 0x040000
19 #include <qfiledialog.h>
20 #else
21 #include <q3filedialog.h>
22 #endif
23 
24 #include <string>
25 
26 namespace hippodraw {
27 
28  class DataSource;
29 
50 {
51 
52 private:
53 
57  static const std::string s_doc_suffix;
58 
62  static const std::string s_data_suffix;
63 
66  static std::string s_open_filter;
67 
72  void checkDuplicateLabels ( const DataSource * source, QWidget * );
73 
74 public:
75 
78  QtFileDialog ();
79 
82  static const std::string & createOpenFilter ();
83 
86  static const std::string & createBrowseFilter ();
87 
90  static const std::string & createDocumentFilter ();
91 
94  static const std::string & createExportFilter ();
95 
98  static const std::string & getDocSuffix ();
99 
102  static const std::string & getTextSuffix ();
103 
106  static bool isDocSuffix ( const std::string & suffix );
107 
111  static bool isFitsSuffix ( const std::string & suffix );
112 
116  static bool isRootSuffix ( const std::string & suffix );
117 
120  static bool isTextSuffix ( const std::string & suffix );
121 
124  static void openTextTuple ( const std::string & filename );
125 
128  void openRootTuple ( const std::string & filename, QWidget * parent );
129 
132  static bool isFitsFile ( const std::string & filename );
133 
136  static bool isZippedFitsSuffix ( const std::string & suffix);
137 
140  void openFitsTuple ( const std::string & filename, QWidget * parent );
141 
142 
143 #ifdef HAVE_CFITSIO
144 
149  void saveFitsTuple ( const std::string & filename, QWidget * parent );
150 #endif
151 
154  void saveTextTuple ( const std::string & filename, QWidget * parent );
155 
160  static std::string getExportTupleFilename ( QWidget * widget);
161 
162 };
163 
164 } // namespace hippodraw
165 
166 #endif // _QtFileDialog_H_
void openRootTuple(const std::string &filename, QWidget *parent)
Opens a ROOT DataSource file.
static bool isFitsFile(const std::string &filename)
Returns true if the file filename is a FITS file.
static bool isFitsSuffix(const std::string &suffix)
Returns true if suffix is one corresponding to FITS DataSource file.
void checkDuplicateLabels(const DataSource *source, QWidget *)
Checks for duplicate column labels in the DataSource source.
static bool isTextSuffix(const std::string &suffix)
Returns true if suffix is one corresponding to text NTuple file.
static const std::string & createExportFilter()
Creates a filter for exporting DataSource to file.
static const std::string & getDocSuffix()
Returns the suffix for a document.
static const std::string s_data_suffix
The file name suffix used for the application&#39;s text data source files.
Definition: QtFileDialog.h:62
static const std::string & getTextSuffix()
Returns the suffix for a text data source files.
A class to handle various file types.
Definition: QtFileDialog.h:49
void saveTextTuple(const std::string &filename, QWidget *parent)
Save a text file.
static std::string s_open_filter
The open file filter.
Definition: QtFileDialog.h:66
void openFitsTuple(const std::string &filename, QWidget *parent)
Opens a FITS DataSource file.
static const std::string & createBrowseFilter()
Creates the open file filter.
static const std::string s_doc_suffix
The file name suffix used for the application&#39;s document files.
Definition: QtFileDialog.h:57
void saveFitsTuple(const std::string &filename, QWidget *parent)
Save a FITS file.
QtFileDialog()
The constructor.
static bool isDocSuffix(const std::string &suffix)
Returns true if suffix is one corresponding to document file.
static const std::string & createDocumentFilter()
Creates a filter for saving a document.
static std::string getExportTupleFilename(QWidget *widget)
Returns a filename for exporting a DataSource.
static bool isZippedFitsSuffix(const std::string &suffix)
Returns true if the file filename is a compressed FITS file.
static const std::string & createOpenFilter()
Creates the open file filter.
static bool isRootSuffix(const std::string &suffix)
Returns true if suffix is one corresponding to ROOT DataSource files.
static void openTextTuple(const std::string &filename)
Opens a text NTuple file.
Base class for DataSource.
Definition: DataSource.h:55

Generated for HippoDraw Class Library by doxygen