X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fauthenticator.h;h=55930d9a547f40125104d5b02f2de0e25766dd29;hb=b1b970e71618cb2d2cf372ba55234000c6324d7f;hp=97091efabd2e655f315506081763d5e9290e20b3;hpb=f77a0b720ed58a2b68876b9320742b81b6df871f;p=quassel.git diff --git a/src/core/authenticator.h b/src/core/authenticator.h index 97091efa..55930d9a 100644 --- a/src/core/authenticator.h +++ b/src/core/authenticator.h @@ -32,8 +32,8 @@ class Authenticator : public QObject { Q_OBJECT public: - Authenticator(QObject *parent = 0); - virtual ~Authenticator() {}; + using QObject::QObject; + ~Authenticator() override = default; enum State { IsReady, // ready to go @@ -52,24 +52,30 @@ public slots: */ virtual bool isAvailable() const = 0; + //! Returns the identifier of the authenticator backend + /** \return A string that can be used by the client to identify the authenticator backend */ + virtual QString backendId() const = 0; + //! Returns the display name of the authenticator backend /** \return A string that can be used by the client to name the authenticator backend */ - virtual QString backendId() const = 0; + virtual QString displayName() const = 0; //! Returns a description of this authenticator backend /** \return A string that can be displayed by the client to describe the authenticator */ virtual QString description() const = 0; - //! Returns a list of properties required to use the authenticator backend - virtual QStringList setupKeys() const = 0; + //! Returns data required to configure the authenticator backend + /** + * A list of flattened triples for each field: {key, translated field name, default value} + * The default value's type determines the kind of input widget to be shown + * (int -> QSpinBox; QString -> QLineEdit) + * \return A list of triples defining the data to be shown in the configuration dialog + */ + virtual QVariantList setupData() const = 0; //! Checks if the authenticator allows manual password changes from inside quassel. virtual bool canChangePassword() const = 0; - //! Returns a map where the keys are are properties to use the authenticator backend - /* the values are QVariants with default values */ - virtual QVariantMap setupDefaults() const = 0; - //! Setup the authenticator provider. /** This prepares the authenticator provider (e.g. create tables, etc.) for use within Quassel. * \param settings Hostname, port, username, password, ... @@ -89,7 +95,4 @@ public slots: * \return A valid UserId if the password matches the username; 0 else */ virtual UserId validateUser(const QString &user, const QString &password) = 0; - -private: - };