swift
form.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_EDITORS_FORM_H
7 #define SWIFT_GUI_EDITORS_FORM_H
8 
9 #include <QFrame>
10 #include <QObject>
11 
14 #include "gui/swiftguiexport.h"
15 #include "misc/datacache.h"
16 
17 class QWidget;
18 
19 namespace swift::misc::network
20 {
21  class CAuthenticatedUser;
22 }
23 namespace swift::gui::editors
24 {
27  {
28  Q_OBJECT
29 
30  public:
32  explicit CForm(QWidget *parent = nullptr);
33 
35  virtual ~CForm() override;
36 
38  virtual void setReadOnly(bool readOnly) = 0;
39 
42  virtual void setSelectOnly();
43 
45  virtual swift::misc::CStatusMessageList validate(bool withNestedObjects = true) const;
46 
50  validateAsOverlayMessage(bool withNestedObjects = true, bool appendOldMessages = false,
51  std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
52 
54  bool isReadOnly() const { return m_readOnly; }
55 
56  protected:
59  virtual void jsonPasted(const QString &json);
60 
62  void pasted();
63 
65  void forceStyleSheetUpdate();
66 
67  bool m_readOnly = false;
68  };
69 
72  {
73  Q_OBJECT
74 
75  public:
77  explicit CFormDbUser(QWidget *parent = nullptr);
78 
80  virtual ~CFormDbUser() override;
81 
83  swift::misc::network::CAuthenticatedUser getSwiftDbUser() const;
84 
85  protected:
87  virtual void userChanged();
88 
91  };
92  };
93 } // namespace swift::gui::editors
94 
95 #endif // SWIFT_GUI_EDITORS_FORM_H
Using this class provides a QFrame with the overlay functionality already integrated.
Form base class.
Definition: form.h:72
virtual void userChanged()
User has been changed.
Definition: form.cpp:55
Form base class.
Definition: form.h:27
virtual void setReadOnly(bool readOnly)=0
Set editable.
bool isReadOnly() const
Is read only?
Definition: form.h:54
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of an authentiated user.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.