#ifndef CAMPWIZARD_H #define CAMPWIZARD_H #include #include "data/camp-data.h" #include #include #include #include class AddressHelper : public QObject { Q_OBJECT Q_PROPERTY(QSharedPointer address READ address WRITE setAddress) public: AddressHelper(QObject *parent = NULL); QSharedPointer address() const; void setAddress(const QSharedPointer &address); AddressbookDataPtr addr() const; void setAddr(const AddressbookDataPtr &address); AddressbookDataPtr newAddress(); AddressbookDataPtr copyAddress(); private: AddressbookDataPtr m_address; AddressbookDataPtr m_copyAddress; }; class SaleHelper : public QObject { Q_OBJECT Q_PROPERTY(QSharedPointer sale READ sale WRITE setSale NOTIFY saleChanged) public: SaleHelper(QObject *parent = NULL); SalePtr salePtr() const; void setSalePtr(const SalePtr &sale); QSharedPointer sale() const; void setSale(const QSharedPointer &sale); signals: void saleChanged(); private: SalePtr m_sale; }; namespace Ui { class CampWizard; } class CampWizard : public QWizard { Q_OBJECT public: explicit CampWizard(QWidget *parent = 0); ~CampWizard(); void setData(const CampDataPtr &data); void setNewRecord(bool newRecord); private slots: void on_btnAdd_clicked(); void on_address_currentIndexChanged(int index); void on_btnRemove_clicked(); void on_btnOwner_clicked(); void on_groupNew_clicked(bool checked); void on_CampWizard_currentIdChanged(int id); void on_btnAddService_clicked(); void on_btnRemoveService_clicked(); void on_checkSale_clicked(); void applySale(); void on_sale_currentIndexChanged(int index); private: Ui::CampWizard *ui; CampDataPtr m_data; ObjectBinder *m_dataBinder; ObjectBinder *m_addrHelperBinder; ObjectBinder *m_addressBinder; AddressHelper *m_addrHelper; ObjectBinder *m_saleBinder; SaleHelper *m_saleHelper; AutoTableModel *m_peopleModel; AutoTableModel *m_servicesModel; AutoTableModel *m_itemsModel; bool m_bindAddrCombo; bool m_newRecord; // QWizard interface public: bool validateCurrentPage(); public slots: void accept(); }; #endif // CAMPWIZARD_H