~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Plugins/Qt/QTMFileDialog.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA
  • Date: 2010-04-23 07:09:40 UTC
  • mfrom: (4.1.8 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100423070940-72mjdmdepfgrvo8f
Tags: 1:1.0.7.4-2
Re-upload, former upload failed with wrong diff.gz perhaps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/******************************************************************************
 
3
* MODULE     : QTMFileDialog.hpp
 
4
* DESCRIPTION: QT file choosers
 
5
* COPYRIGHT  : (C) 2009 David MICHEL
 
6
*******************************************************************************
 
7
* This software falls under the GNU general public license version 3 or later.
 
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
 
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
 
10
******************************************************************************/
 
11
 
 
12
#ifndef QTMFILEDIALOG_HPP
 
13
#define QTMFILEDIALOG_HPP
 
14
 
 
15
#include <QFileDialog>
 
16
#include <QLabel>
 
17
#include <QLineEdit>
 
18
#include <QHBoxLayout>
 
19
#include "string.hpp"
 
20
 
 
21
class QMyFileDialog : public QFileDialog
 
22
{
 
23
  Q_OBJECT
 
24
public:
 
25
  QMyFileDialog (QWidget* parent= 0, const QString & caption = QString(),
 
26
                 const QString & directory = QString(), const QString & filter = QString()) 
 
27
  : QFileDialog(parent, caption, directory, filter) {}
 
28
};
 
29
 
 
30
class QTMFileDialog : public QDialog
 
31
{
 
32
  Q_OBJECT
 
33
 
 
34
protected:
 
35
  QHBoxLayout* hbox;
 
36
  QFileDialog *file;
 
37
 
 
38
public:
 
39
  QTMFileDialog (QWidget* parent= 0, const QString & caption = QString(),
 
40
      const QString & directory = QString(), const QString & filter = QString());
 
41
  QStringList selectedFiles () { return file->selectedFiles (); };
 
42
#if (defined(Q_WS_MAC) && (QT_VERSION >= 0x040600))
 
43
  void setOptions (QFileDialog::Options opts) { return file->setOptions (opts); };
 
44
#endif
 
45
  void setViewMode (QFileDialog::ViewMode mode) { return file->setViewMode (mode); };
 
46
  void setFileMode (QFileDialog::FileMode mode) { return file->setFileMode (mode); };
 
47
  void setLabelText (QFileDialog::DialogLabel label, const QString& text) { return file->setLabelText (label, text); };
 
48
};
 
49
 
 
50
class QTMImagePreview : public QWidget
 
51
{
 
52
  Q_OBJECT
 
53
 
 
54
  QLabel *image;
 
55
 
 
56
public:
 
57
  QLineEdit* wid;
 
58
  QLineEdit* hei;
 
59
  QLineEdit* leb;
 
60
  QLineEdit* lob;
 
61
  QLineEdit* rib;
 
62
  QLineEdit* upb;
 
63
 
 
64
public slots:
 
65
  void setImage (const QString&);
 
66
 
 
67
public:
 
68
  QTMImagePreview (QWidget* parent= 0);
 
69
};
 
70
 
 
71
class QTMImageDialog : public QTMFileDialog
 
72
{
 
73
  Q_OBJECT
 
74
 
 
75
  QTMImagePreview* preview;
 
76
 
 
77
public:
 
78
  QTMImageDialog (QWidget* parent= 0, const QString& caption= QString (),
 
79
      const QString& directory= QString (), const QString& filter= QString ());
 
80
  string getParamsAsString ();
 
81
};
 
82
 
 
83
#endif // defined QTMFILEDIALOG_HPP
 
84