You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB
C++

#ifndef ISHOPITEM_H
#define ISHOPITEM_H
#include "shop_global.h"
#include <QDecDouble.hh>
#include <QString>
#include <enums.h>
#include <QObject>
#include <QSharedPointer>
class SHOPSHARED_EXPORT IShopItem : public QObject
{
Q_OBJECT
Q_PROPERTY(QString code READ code)
Q_PROPERTY(QString name READ name)
Q_PROPERTY(QString shortName READ shortName)
Q_PROPERTY(QDecDouble unitPrice READ unitPrice)
Q_PROPERTY(Enums::VatType vatType READ vatType)
Q_PROPERTY(bool favorite READ favorite)
public:
explicit IShopItem(QObject* parent = nullptr);
~IShopItem() override = default;
virtual long id() const { return {}; }
virtual QString name() { return {}; }
virtual QString code() { return {}; }
virtual QString shortName() { return {}; }
virtual QDecDouble unitPrice() { return {}; }
virtual Enums::VatType vatType() { return {}; }
virtual QString pluginId() const { return {}; }
virtual QString color() { return {}; }
virtual QString category() { return {}; }
virtual bool favorite() { return false; }
};
inline bool operator==(const IShopItem& lhs, const IShopItem& rhs) {
return lhs.id() == rhs.id() && lhs.pluginId() == rhs.pluginId();
}
using IShopItemPtr = QSharedPointer<IShopItem>;
QX_REGISTER_HPP_SHOP(IShopItem, QObject, 0)
#endif // ISHOPITEM_H