QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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 "qgis_gui.h"
21
22#include <QColor>
23
24class QTreeWidgetItem;
25class QWidget;
26class QgsMessageBar;
27
28#define SIP_NO_FILE
29
30
36class GUI_EXPORT QgsAuthGuiUtils
37{
38 public:
40 static QColor greenColor();
41
43 static QColor orangeColor();
44
46 static QColor redColor();
47
49 static QColor yellowColor();
50
52 static QString greenTextStyleSheet( const QString &selector = "*" );
53
55 static QString orangeTextStyleSheet( const QString &selector = "*" );
56
58 static QString redTextStyleSheet( const QString &selector = "*" );
59
60
62 static bool isDisabled( QgsMessageBar *msgbar );
63
68 static void importAuthenticationConfigs( QgsMessageBar *msgbar );
69
74 static void exportSelectedAuthenticationConfigs( QStringList authenticationConfigIds, QgsMessageBar *msgbar );
75
77 static void setMasterPassword( QgsMessageBar *msgbar );
78
80 static void clearCachedMasterPassword( QgsMessageBar *msgbar );
81
83 static void resetMasterPassword( QgsMessageBar *msgbar, QWidget *parent = nullptr );
84
87
89 static void removeAuthenticationConfigs( QgsMessageBar *msgbar, QWidget *parent = nullptr );
90
92 static void eraseAuthenticationDatabase( QgsMessageBar *msgbar, QWidget *parent = nullptr );
93
95 static void fileFound( bool found, QWidget *widget );
96
98 static QString getOpenFileName( QWidget *parent, const QString &title, const QString &extfilter );
99
101 static void passwordHelperDelete( QgsMessageBar *msgbar, QWidget *parent = nullptr );
102
104 static void passwordHelperEnable( bool enabled, QgsMessageBar *msgbar );
105
107 static void passwordHelperLoggingEnable( bool enabled, QgsMessageBar *msgbar, int timeout = 0 );
108
110 static void setItemBold( QTreeWidgetItem *item );
111
113 static void removeChildren( QTreeWidgetItem *item );
114};
115
116// clazy:excludeall=qstring-allocations
117
118#endif // QGSAUTHGUIUTILS_H
Utility functions for use by authentication GUI widgets or standalone apps.
static void importAuthenticationConfigs(QgsMessageBar *msgbar)
Import authentication configurations from a XML file.
static void exportSelectedAuthenticationConfigs(QStringList authenticationConfigIds, QgsMessageBar *msgbar)
Exports selected authentication configurations to a XML file.
static QString greenTextStyleSheet(const QString &selector="*")
Green text stylesheet representing valid, trusted, etc. certificate.
static void resetMasterPassword(QgsMessageBar *msgbar, QWidget *parent=nullptr)
Reset the cached master password, updating its hash in authentication database and resetting all exis...
static QColor greenColor()
Green color representing valid, trusted, etc. certificate.
static QColor orangeColor()
Orange color representing loaded component, but not stored in database.
static QString redTextStyleSheet(const QString &selector="*")
Red text stylesheet representing invalid, untrusted, etc. certificate.
static void clearCachedMasterPassword(QgsMessageBar *msgbar)
Clear the currently cached master password (not its hash in database).
static void passwordHelperEnable(bool enabled, QgsMessageBar *msgbar)
Sets password helper enabled (enable/disable).
static QString orangeTextStyleSheet(const QString &selector="*")
Orange text stylesheet representing loaded component, but not stored in database.
static void setItemBold(QTreeWidgetItem *item)
Call setFirstColumnSpanned(true) on the item and make its font bold.
static void removeChildren(QTreeWidgetItem *item)
Remove the children of the passed item.
static void clearCachedAuthenticationConfigs(QgsMessageBar *msgbar)
Clear all cached authentication configs for session.
static bool isDisabled(QgsMessageBar *msgbar)
Verify the authentication system is active, else notify user.
static void passwordHelperLoggingEnable(bool enabled, QgsMessageBar *msgbar, int timeout=0)
Sets password helper logging enabled (enable/disable).
static void eraseAuthenticationDatabase(QgsMessageBar *msgbar, QWidget *parent=nullptr)
Completely clear out the authentication database (configs and master password).
static void removeAuthenticationConfigs(QgsMessageBar *msgbar, QWidget *parent=nullptr)
Remove all authentication configs.
static QColor yellowColor()
Yellow color representing caution regarding action.
static void fileFound(bool found, QWidget *widget)
Color a widget via a stylesheet if a file path is found or not.
static void setMasterPassword(QgsMessageBar *msgbar)
Sets the cached master password (and verifies it if its hash is in authentication database).
static QString getOpenFileName(QWidget *parent, const QString &title, const QString &extfilter)
Open file dialog for auth associated widgets.
static void passwordHelperDelete(QgsMessageBar *msgbar, QWidget *parent=nullptr)
Remove master password from wallet.
static QColor redColor()
Red color representing invalid, untrusted, etc. certificate.
A bar for displaying non-blocking messages to the user.