QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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, int timeout = 0 );
62 
64  static void setMasterPassword( QgsMessageBar *msgbar, int timeout = 0 );
65 
67  static void clearCachedMasterPassword( QgsMessageBar *msgbar, int timeout = 0 );
68 
70  static void resetMasterPassword( QgsMessageBar *msgbar, int timeout = 0, QWidget *parent = nullptr );
71 
73  static void clearCachedAuthenticationConfigs( QgsMessageBar *msgbar, int timeout = 0 );
74 
76  static void removeAuthenticationConfigs( QgsMessageBar *msgbar, int timeout = 0, QWidget *parent = nullptr );
77 
79  static void eraseAuthenticationDatabase( QgsMessageBar *msgbar, int timeout = 0, 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, int timeout = 0, QWidget *parent = nullptr );
89 
91  static void passwordHelperSync( QgsMessageBar *msgbar, int timeout = 0 );
92 
94  static void passwordHelperEnable( bool enabled, QgsMessageBar *msgbar, int timeout = 0 );
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
QgsMessageBar
Definition: qgsmessagebar.h:60
QgsAuthGuiUtils
Utility functions for use by authentication GUI widgets or standalone apps.
Definition: qgsauthguiutils.h:34