aboutsummaryrefslogtreecommitdiff
path: root/libs/installer_bsplugins/src/MOPlugin/IPluginPanel.h
blob: 0c73a9c038cad4647deb81e381f3501863461e72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef IPLUGINPANEL_H
#define IPLUGINPANEL_H

#include "IPanelInterface.h"

#include <iplugin.h>

class IPluginPanel : public QObject, public MOBase::IPlugin
{
  Q_INTERFACES(MOBase::IPlugin)

public:
  enum class Order
  {
    Before,
    AtStart,
    InPlaceOf,
    After,
    AtEnd,
  };

  struct Position
  {
    Order order_;
    QString reference_;

    static Position before(const QString& panelName);
    static Position after(const QString& panelName);
    static Position inPlaceOf(const QString& panelName);
    static Position atStart();
    static Position atEnd();
  };

  bool init(MOBase::IOrganizer* organizer) final;

  virtual bool initPlugin(MOBase::IOrganizer* organizer) = 0;

  virtual QWidget* createWidget(IPanelInterface* callbacks, QWidget* parent) = 0;

  virtual QString label() const = 0;

  virtual Position position() const = 0;
};

Q_DECLARE_INTERFACE(IPluginPanel, "org.tannin.IPluginPanel/1.0")

#endif  // IPLUGINPANEL_H