QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
qgsauthguiutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthguiutils.h
3  ---------------------
4  begin : October 24, 2014
5  copyright : (C) 2014 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 QGSAUTHGUIUTILS_H
18 #define QGSAUTHGUIUTILS_H
19 
20 #include <QColor>
21 #include "qgis_gui.h"
22 
23 class QWidget;
24 class QgsMessageBar;
25 
26 #define SIP_NO_FILE
27 
28 
34 class GUI_EXPORT QgsAuthGuiUtils
35 {
36  public:
37 
39  static QColor greenColor();
40 
42  static QColor orangeColor();
43 
45  static QColor redColor();
46 
48  static QColor yellowColor();
49 
51  static QString greenTextStyleSheet( const QString &selector = "*" );
52 
54  static QString orangeTextStyleSheet( const QString &selector = "*" );
55 
57  static QString redTextStyleSheet( const QString &selector = "*" );
58 
59 
61  static bool isDisabled( QgsMessageBar *msgbar );
62 
64  static void setMasterPassword( QgsMessageBar *msgbar );
65 
67  static void clearCachedMasterPassword( QgsMessageBar *msgbar );
68 
70  static void resetMasterPassword( QgsMessageBar *msgbar, QWidget *parent = nullptr );
71 
73  static void clearCachedAuthenticationConfigs( QgsMessageBar *msgbar );
74 
76  static void removeAuthenticationConfigs( QgsMessageBar *msgbar, QWidget *parent = nullptr );
77 
79  static void eraseAuthenticationDatabase( QgsMessageBar *msgbar, QWidget *parent = nullptr );
80 
82  static void fileFound( bool found, QWidget *widget );
83 
85  static QString getOpenFileName( QWidget *parent, const QString &title, const QString &extfilter );
86 
88  static void passwordHelperDelete( QgsMessageBar *msgbar, QWidget *parent = nullptr );
89 
91  static void passwordHelperSync( QgsMessageBar *msgbar );
92 
94  static void passwordHelperEnable( bool enabled, QgsMessageBar *msgbar );
95 
97  static void passwordHelperLoggingEnable( bool enabled, QgsMessageBar *msgbar, int timeout = 0 );
98 
99 };
100 
101 // clazy:excludeall=qstring-allocations
102 
103 #endif // QGSAUTHGUIUTILS_H
Utility functions for use by authentication GUI widgets or standalone apps.
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:61