QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsnewnamedialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsnewnamedialog.h
3  -------------------
4  begin : May, 2015
5  copyright : (C) 2015 Radim Blazek
6  email : [email protected]
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSNEWNAMEDIALOG_H
18 #define QGSNEWNAMEDIALOG_H
19 
20 class QLabel;
21 class QLineEdit;
22 
23 #include "qgsdialog.h"
24 
30 class GUI_EXPORT QgsNewNameDialog : public QgsDialog
31 {
32  Q_OBJECT
33  public:
44  QgsNewNameDialog( const QString& source = QString::null, const QString& initial = QString::null,
45  const QStringList& extensions = QStringList(), const QStringList& existing = QStringList(),
46  const QRegExp& regexp = QRegExp(), Qt::CaseSensitivity cs = Qt::CaseSensitive,
47  QWidget *parent = 0, Qt::WindowFlags flags = QgisGui::ModalDialogFlags );
48 
52  QString name() const;
53 
61  static bool exists( const QString& name, const QStringList& extensions,
62  const QStringList& existing, Qt::CaseSensitivity cs = Qt::CaseSensitive );
63  public slots:
64  void nameChanged();
65 
66  protected:
69  Qt::CaseSensitivity mCaseSensitivity;
71  QLabel *mNamesLabel; // list of names with extensions
75  QString highlightText( const QString& text );
76  static QStringList fullNames( const QString& name, const QStringList& extensions );
77  // get list of existing names
78  static QStringList matching( const QStringList& newNames, const QStringList& existingNames,
79  Qt::CaseSensitivity cs = Qt::CaseSensitive );
80 };
81 
82 #endif // QGSNEWNAMEDIALOG_H
static const Qt::WindowFlags ModalDialogFlags
Definition: qgisgui.h:48
Qt::CaseSensitivity mCaseSensitivity
QStringList mExiting
A generic dialog with layout and button box.
Definition: qgsdialog.h:30
QStringList mExtensions
const char * name() const
New name, for example new layer name dialog.
typedef WindowFlags
QLineEdit * mLineEdit