swift
dblogincomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_COMPONENTS_DBLOGINCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_DBLOGINCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QObject>
11 #include <QScopedPointer>
12 
13 #include "core/data/globalsetup.h"
15 #include "gui/loadindicator.h"
16 #include "gui/swiftguiexport.h"
17 #include "misc/statusmessagelist.h"
18 
19 namespace swift::misc::network
20 {
21  class CAuthenticatedUser;
22 }
23 namespace Ui
24 {
25  class CDbLoginComponent;
26 }
27 namespace swift::gui::components
28 {
34  {
35  Q_OBJECT
36 
37  public:
39  explicit CDbLoginComponent(QWidget *parent = nullptr);
40 
42  virtual ~CDbLoginComponent() override;
43 
46 
48  bool isUserAuthenticated() const;
49 
50  private:
51  QScopedPointer<Ui::CDbLoginComponent> ui;
52  swift::core::db::CDatabaseAuthenticationService m_loginService { this };
53 
55  void displayOverlayMessages(const swift::misc::CStatusMessageList &msgs);
56 
58  void setModeLogin(bool modeLogin);
59 
61  void setUserInfo(const swift::misc::network::CAuthenticatedUser &user);
62 
64  void onLoginClicked();
65 
67  void onLogoffClicked();
68 
70  void onAuthenticationFinished(const swift::misc::network::CAuthenticatedUser &user,
71  const swift::misc::CStatusMessageList &statusMsgs);
72  };
73 } // namespace swift::gui::components
74 
75 #endif // SWIFT_GUI_COMPONENTS_DBLOGINCOMPONENT_H
Database user used with swift DB. Features role and cookie handling.
Enable widget class for load indicator.
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of an authentiated user.
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.