QGIS API Documentation  3.21.0-Master (5b68dc587e)
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 
67  static void importAuthenticationConfigs( QgsMessageBar *msgbar );
68 
73  static void exportSelectedAuthenticationConfigs( QStringList authenticationConfigIds, QgsMessageBar *msgbar );
74 
76  static void setMasterPassword( QgsMessageBar *msgbar );
77 
79  static void clearCachedMasterPassword( QgsMessageBar *msgbar );
80 
82  static void resetMasterPassword( QgsMessageBar *msgbar, QWidget *parent = nullptr );
83 
85  static void clearCachedAuthenticationConfigs( QgsMessageBar *msgbar );
86 
88  static void removeAuthenticationConfigs( QgsMessageBar *msgbar, QWidget *parent = nullptr );
89 
91  static void eraseAuthenticationDatabase( QgsMessageBar *msgbar, QWidget *parent = nullptr );
92 
94  static void fileFound( bool found, QWidget *widget );
95 
97  static QString getOpenFileName( QWidget *parent, const QString &title, const QString &extfilter );
98 
100  static void passwordHelperDelete( QgsMessageBar *msgbar, QWidget *parent = nullptr );
101 
103  static void passwordHelperSync( QgsMessageBar *msgbar );
104 
106  static void passwordHelperEnable( bool enabled, QgsMessageBar *msgbar );
107 
109  static void passwordHelperLoggingEnable( bool enabled, QgsMessageBar *msgbar, int timeout = 0 );
110 
111 };
112 
113 // clazy:excludeall=qstring-allocations
114 
115 #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