#ifndef ARGDIALOG_H #define ARGDIALOG_H #include #include #include #include #include #include #include #include #include namespace Args { const QString HEADER_TYPE = "header"; const QString DESCRIPTION_TYPE = "description"; const QString HASHTAG_TYPE = "hashtag"; const QString PROMOTE_TYPE = "promote/share"; const QString LINK_BIO_TYPE = "link/bio"; const QString REQUESTED_BY_TYPE = "requested by"; } // namespace Args typedef std::string Str; typedef struct Task { int mask; std::vector args; } Task; typedef struct KFile { QString name; QString path; FileType type; } KFile; typedef struct IGPost { std::string header = "Learn to speak like native Korean speakers 🙆‍♀️🇰🇷"; std::string description; std::string datetime; std::string promote_share = "Share the post through IG story if you enjoy the phrase 🙋‍♀️"; std::string link_in_bio = "Subscribe to my YouTube channel (link 🔗in bio) to learn more about Korean language and culture ❤"; std::vector hashtags; std::vector requested_by; const char *requested_by_phrase = "The phrase was requested by "; std::vector files; bool is_video; bool isReady() { return header.size() > 0 && description.size() > 0 && datetime.size() > 0 && promote_share.size() > 0 && link_in_bio.size() > 0 && hashtags.size() > 0 && requested_by.size() > 0 && !files.empty() && files.at(0).path.size() > 0; } } IGPost; namespace Ui { class ArgDialog; } class ArgDialog : public QDialog { Q_OBJECT public: explicit ArgDialog(QWidget *parent = nullptr); virtual void keyPressEvent(QKeyEvent* e); ~ArgDialog(); signals: void uploadFiles(QVector files); void taskRequestReady(Task task, bool file_pending); private: void clearPost(); void defaultPost(); void clearTask(); void addToArgList(QString value, QString type); void addOrReplaceInArgList(QString value, QString type); void addHashtag(QString tag); void addRequestedBy(QString value); void setTaskArguments(); Ui::ArgDialog *ui; void addItem(QString value, QString type); void addFile(QString path); Task m_task; IGPost m_ig_post; }; #endif // ARGDIALOG_H