QGIS API Documentation  3.37.0-Master (a5b4d9743e8)
qgsencodingfiledialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsencodingfiledialog.h - File dialog which queries the encoding type
3  --------------------------------------
4  Date : 16-Feb-2005
5  Copyright : (C) 2005 by Marco Hugentobler
6  email : [email protected]
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSENCODINGFILEDIALOG_H
17 #define QGSENCODINGFILEDIALOG_H
18 
19 #include <QFileDialog>
20 #include "qgis_gui.h"
21 #include "qgis_sip.h"
22 
23 class QComboBox;
24 class QPushButton;
25 
30 class GUI_EXPORT QgsEncodingFileDialog: public QFileDialog
31 {
32  Q_OBJECT
33  public:
34 
38  QgsEncodingFileDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr,
39  const QString &caption = QString(), const QString &directory = QString(),
40  const QString &filter = QString(), const QString &encoding = QString() );
42  QString encoding() const;
44  void addCancelAll();
46  bool cancelAll();
47 
48  public slots:
49  void saveUsedEncoding();
50 
51  void pbnCancelAll_clicked();
52 
53  private:
55  QComboBox *mEncodingComboBox = nullptr;
56 
57  /* The button to click */
58  QPushButton *mCancelAllButton = nullptr;
59 
60  /* Set if user clicked 'Cancel All' */
61  bool mCancelAll;
62 };
63 
68 class GUI_EXPORT QgsEncodingSelectionDialog: public QDialog
69 {
70  Q_OBJECT
71 
72  public:
73 
81  QgsEncodingSelectionDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr,
82  const QString &caption = QString(), const QString &encoding = QString(),
83  Qt::WindowFlags flags = Qt::WindowFlags() );
84 
89  QString encoding() const;
90 
95  void setEncoding( const QString &encoding );
96 
97  private:
98 
99  QComboBox *mEncodingComboBox = nullptr;
100 
101 };
102 
103 
104 #endif
A file dialog which lets the user select the preferred encoding type for a data provider.
A dialog which presents the user with a choice of file encodings.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53