instagram_task.hpp 3.4 KB

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