swift
distributorform.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_DISTRIBUTORFORM_H
7 #define SWIFT_GUI_EDITORS_DISTRIBUTORFORM_H
8 
9 #include <QObject>
10 #include <QScopedPointer>
11 
12 #include "gui/editors/form.h"
13 #include "gui/swiftguiexport.h"
15 #include "misc/statusmessagelist.h"
16 #include "misc/variant.h"
17 
18 namespace Ui
19 {
20  class CDistributorForm;
21 }
22 namespace swift::gui::editors
23 {
28  {
29  Q_OBJECT
30 
31  public:
33  explicit CDistributorForm(QWidget *parent = nullptr);
34 
36  virtual ~CDistributorForm() override;
37 
40 
42  void allowDrop(bool allowDrop);
43 
45  bool isDropAllowed() const;
46 
49  virtual void setReadOnly(bool readonly) override;
50  virtual void setSelectOnly() override;
51  virtual swift::misc::CStatusMessageList validate(bool nested = false) const override;
53 
55  void clear();
56 
58  bool
60 
61  protected:
63  virtual void jsonPasted(const QString &json) override;
64 
65  private:
67  void onDroppedCode(const swift::misc::CVariant &variantDropped);
68 
70  bool hasAnyUiDetailsValues() const;
71 
72  QScopedPointer<Ui::CDistributorForm> ui;
73  swift::misc::simulation::CDistributor m_currentDistributor;
74  };
75 } // namespace swift::gui::editors
76 
77 #endif // SWIFT_GUI_EDITORS_DISTRIBUTORFORM_H
Form base class.
Definition: form.h:27
Status messages, e.g. from Core -> GUI.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Definition: variant.h:66
Value object encapsulating information of software distributor.
Definition: distributor.h:33
#define SWIFT_GUI_EXPORT
Export a class or function from the library.