mngfortune.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef MNGFORTUNE_H
  2. #define MNGFORTUNE_H
  3. #include <QStringList>
  4. #include <QDateTime>
  5. #include <QVariant>
  6. #include <QSharedDataPointer>
  7. #include <TGlobal>
  8. #include <TAbstractModel>
  9. class TModelObject;
  10. class MngFortuneObject;
  11. class QJsonArray;
  12. class T_MODEL_EXPORT MngFortune : public TAbstractModel
  13. {
  14. public:
  15. MngFortune();
  16. MngFortune(const MngFortune &other);
  17. MngFortune(const MngFortuneObject &object);
  18. ~MngFortune();
  19. int id() const;
  20. QString message() const;
  21. void setMessage(const QString &message);
  22. MngFortune &operator=(const MngFortune &other);
  23. bool create() { return TAbstractModel::create(); }
  24. bool update() { return TAbstractModel::update(); }
  25. bool save() { return TAbstractModel::save(); }
  26. bool remove() { return TAbstractModel::remove(); }
  27. static MngFortune create(const QString &message);
  28. static MngFortune create(const QVariantMap &values);
  29. static MngFortune get(const QString &id);
  30. static int count();
  31. static QList<MngFortune> getAll();
  32. static QJsonArray getAllJson();
  33. private:
  34. QSharedDataPointer<MngFortuneObject> d;
  35. TModelObject *modelData();
  36. const TModelObject *modelData() const;
  37. };
  38. Q_DECLARE_METATYPE(MngFortune)
  39. Q_DECLARE_METATYPE(QList<MngFortune>)
  40. #endif // MNGFORTUNE_H