SceneSwitcher/lib/macro/macro-list.hpp
WarmUpTill 7d0332dd0e Restructure library and plugins
The "core" macro conditions and actions have been extracted out to the
"base" plugin.

The library now mostly contains functionality which is required across
all plugins and (e.g. definitions for macro segments).

The goal is to reduce the complexity and cross-dependencies and group
the source files in a better way.

This should relsove the "library limit of 65535 objects exceeded" build
issue occuring in some Windows build environments.
2024-01-27 14:10:34 +01:00

49 lines
1016 B
C++

#pragma once
#include "macro-ref.hpp"
#include <QListWidget>
#include <QPushButton>
#include <QHBoxLayout>
namespace advss {
class ADVSS_EXPORT MacroList : public QWidget {
Q_OBJECT
public:
MacroList(QWidget *parent, bool allowDuplicates, bool reorder);
void SetContent(const std::vector<MacroRef> &);
void AddControl(QWidget *);
int CurrentRow();
private slots:
void MacroRename(const QString &oldName, const QString &newName);
void MacroRemove(const QString &name);
void Add();
void Remove();
void Up();
void Down();
void MacroItemClicked(QListWidgetItem *);
signals:
void Added(const std::string &);
void Removed(int);
void MovedUp(int);
void MovedDown(int);
void Replaced(int, const std::string &);
private:
int FindEntry(const std::string &macro);
void SetMacroListSize();
QListWidget *_list;
QPushButton *_add;
QPushButton *_remove;
QPushButton *_up;
QPushButton *_down;
QHBoxLayout *_controlsLayout;
const bool _allowDuplicates;
const bool _reorder;
};
} // namespace advss