instagram_task.hpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #ifndef __INSTAGRAM_TASK_HPP__
  2. #define __INSTAGRAM_TASK_HPP__
  3. #include <include/task/task.hpp>
  4. #include <type_traits>
  5. namespace Scheduler {
  6. namespace Args {
  7. const QString HEADER_TYPE = "header";
  8. const QString DESCRIPTION_TYPE = "description";
  9. const QString HASHTAG_TYPE = "hashtag";
  10. const QString PROMOTE_TYPE = "promote/share";
  11. const QString LINK_BIO_TYPE = "link/bio";
  12. const QString REQUESTED_BY_TYPE = "requested by";
  13. } // namespace Args
  14. } // namespace Scheduler
  15. /**
  16. * @brief The InstagramTask class
  17. *
  18. * Class to organize and transport data necessary to perform an Instagram Task.
  19. */
  20. class InstagramTask : public Scheduler::Task {
  21. public:
  22. /**
  23. * @constructor
  24. */
  25. InstagramTask();
  26. /**
  27. * Overrides @abstract Task::defineTaskArguments
  28. *
  29. * Useful for avoiding repetitive input of data.
  30. */
  31. virtual void defineTaskArguments() override;
  32. /**
  33. * Overrides @abstract Task::getTaskArguments
  34. *
  35. * Use this method to take over ownership of the task's arguments.
  36. */
  37. virtual const Scheduler::TaskArguments&& getTaskArguments() override;
  38. /**
  39. * Overrides @abstract Task::getTaskArgument
  40. *
  41. * Easy access to an argument's value.
  42. */
  43. virtual const Scheduler::TypeVariant getTaskArgument(QString name) override;
  44. /**
  45. * Overrides @abstract Task::getArgumentValues
  46. *
  47. * Easy access to all of the arguments that can be represented as a string.
  48. */
  49. virtual Scheduler::ArgumentValues getArgumentValues() override;
  50. /**
  51. * Overrides @abstract Task::getFiles
  52. *
  53. * Easy access to the task's files.
  54. */
  55. virtual const QVector<Scheduler::KFileData> getFiles() override;
  56. /**
  57. * Overrides @abstract Task::getType
  58. *
  59. * Informs the caller of the task's type.
  60. */
  61. virtual Scheduler::TaskType getType() override;
  62. /**
  63. * Overrides @abstract Task::setArgument
  64. *
  65. * Set the value of an existing argument.
  66. */
  67. virtual void setArgument(QString name, Scheduler::TypeVariant arg) override;
  68. /**
  69. * Overrides @abstract Task::addArgument
  70. *
  71. * Add an additional value to a file container argument.
  72. */
  73. virtual void addArgument(QString name, Scheduler::KFileData file) override;
  74. /**
  75. * Overrides @abstract Task::addArgument
  76. *
  77. * Add an additional value to a string container argument.
  78. */
  79. virtual void addArgument(QString name, QString string) override;
  80. /**
  81. * Overrides @abstract Task::hasFiles
  82. *
  83. * Tells the caller if the task has files.
  84. */
  85. virtual bool hasFiles() override;
  86. /**
  87. * Overrides @abstract Task::isReady
  88. *
  89. * Informs the caller if the prerequisite arguments have values.
  90. */
  91. virtual bool isReady() override;
  92. /**
  93. * Overrides @abstract Task::clear
  94. *
  95. * Clears the values of all arguments, without removing the arguments.
  96. */
  97. virtual void clear() override;
  98. /**
  99. * Overrides @abstract Task::setDefaultValues
  100. *
  101. * Set default values for the arguments.
  102. */
  103. virtual void setDefaultValues() override;
  104. /**
  105. * Overrides @abstract Task::~Task
  106. * @destructor
  107. */
  108. virtual ~InstagramTask() override;
  109. private:
  110. /**
  111. * @brief m_arguments
  112. *
  113. * A container storing the task's arguments
  114. */
  115. Scheduler::TaskArguments m_arguments;
  116. };
  117. #endif // __INSTAGRAM_TASK_HPP