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.

73 lines
1.8 KiB
C++

#ifndef FAVORITITEM_H
#define FAVORITITEM_H
#include "../ishopitem.h"
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QDecDouble.hh>
//#include <QxOrm.h>
#include <enums.h>
class FavoritItem : public IShopItem
{
Q_OBJECT
QX_REGISTER_FRIEND_CLASS(FavoritItem)
Q_PROPERTY(int id READ id WRITE setId)
Q_PROPERTY(int refId READ refId WRITE setRefId)
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(QString shortName READ shortName WRITE setShortName)
Q_PROPERTY(QDecDouble unitPrice READ unitPrice WRITE setUnitPrice)
Q_PROPERTY(Enums::VatType vatType READ vatType WRITE setVatType)
Q_PROPERTY(QString pluginId READ pluginId WRITE setPluginId)
Q_PROPERTY(QString favButtonName READ favButtonName WRITE setFavButtonName)
public:
FavoritItem() = default;
// IShopItem interface
public:
long id() const override;
void setId(long id);
QString name() override;
void setName(const QString &name);
QString shortName() override;
void setShortName(const QString &shortName);
QDecDouble unitPrice() override;
void setUnitPrice(QDecDouble unitPrice);
Enums::VatType vatType() override;
void setVatType(const Enums::VatType &vatType);
QString pluginId() const override;
void setPluginId(const QString &pluginId);
QString favButtonName() const;
void setFavButtonName(const QString &favButtonName);
long refId() const;
void setRefId(long refId);
private:
long m_id{0};
long m_refId{0};
QString m_name;
int m_unitPrice{0};
Enums::VatType m_vatType{Enums::NONE};
QString m_pluginId;
QString m_favButtonName;
QString m_shortName;
};
typedef QSharedPointer<FavoritItem> FavoritItemPtr;
QX_REGISTER_HPP_SHOP(FavoritItem, QObject, 0)
#endif // FAVORITITEM_H