QGIS API Documentation  2.12.0-Lyon
qgsauthconfigidedit.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthconfigidedit.h
3  ---------------------
4  begin : September, 2015
5  copyright : (C) 2015 by Boundless Spatial, Inc. USA
6  author : Larry Shaffer
7  email : lshaffer at boundlessgeo dot com
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 QGSAUTHCONFIGIDEDIT_H
18 #define QGSAUTHCONFIGIDEDIT_H
19 
20 #include "ui_qgsauthconfigidedit.h"
21 
22 #include <QWidget>
23 
28 class GUI_EXPORT QgsAuthConfigIdEdit : public QWidget, private Ui::QgsAuthConfigIdEdit
29 {
30  Q_OBJECT
31 
32  public:
39  explicit QgsAuthConfigIdEdit( QWidget *parent = 0, const QString &authcfg = QString(), bool allowEmpty = true );
41 
43  QString const configId();
44 
46  bool allowEmptyId() { return mAllowEmpty;}
47 
49  bool validate();
50 
51  signals:
53  void validityChanged( bool valid );
54 
55  public slots:
57  void setAuthConfigId( const QString &authcfg );
58 
60  void setAllowEmptyId( bool allowed );
61 
63  void clear();
64 
65  private slots:
66  void updateValidityStyle( bool valid );
67 
68  void on_btnLock_toggled( bool checked );
69 
70  void on_leAuthCfg_textChanged( const QString &txt );
71 
72  private:
73  bool isAlphaNumeric( const QString &authcfg );
74 
75  QString mAuthCfgOrig;
76  bool mValid;
77  bool mAllowEmpty;
78 };
79 
80 #endif // QGSAUTHCONFIGIDEDIT_H
bool allowEmptyId()
Whether to allow no ID to be set.
Custom widget for editing an authentication configuration ID.