Huggle  build:^490^dce1e5c
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
revertquery.hpp
1 //This program is free software: you can redistribute it and/or modify
2 //it under the terms of the GNU General Public License as published by
3 //the Free Software Foundation, either version 3 of the License, or
4 //(at your option) any later version.
5 
6 //This program is distributed in the hope that it will be useful,
7 //but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 //GNU General Public License for more details.
10 
11 #ifndef REVERTQUERY_H
12 #define REVERTQUERY_H
13 
14 #include <QString>
15 #include <QtXml>
16 #include <QTimer>
17 #include "configuration.hpp"
18 #include "core.hpp"
19 #include "editquery.hpp"
20 #include "wikiedit.hpp"
21 #include "apiquery.hpp"
22 
23 namespace Huggle
24 {
25  class ApiQuery;
26  class EditQuery;
27  class WikiEdit;
28 
29  /*!
30  * \brief The RevertQuery class can be used to rollback any edit
31  */
32  class RevertQuery : public Query
33  {
34  Q_OBJECT
35  public:
36  static QString GetCustomRevertStatus(QString RevertData);
37  RevertQuery();
38  RevertQuery(WikiEdit *Edit);
39  void Process();
40  void Kill();
41  ~RevertQuery();
42  QString QueryTargetToString();
43  bool Processed();
44  //! Whether software rollback should be used instead of regular rollback
45  bool UsingSR;
46  QString Summary;
47  //! Rollback with no check if it's a good idea or not (revert even whitelisted users, sysops etc)
49  QString Token;
50  bool MinorEdit;
51  public slots:
52  void OnTick();
53  private:
54  ApiQuery *qPreflight;
55  ApiQuery *qRevert;
56  ApiQuery *qRetrieve;
57  EditQuery *EditQuerySoftwareRollback;
58  WikiEdit* edit;
59  QTimer *timer;
60  bool RollingBack;
61  bool PreflightFinished;
62  void Preflight();
63  void CheckPreflight();
64  bool CheckRevert();
65  void Cancel();
66  bool ProcessRevert();
67  void Rollback();
68  void Revert();
69  void Exit();
70  };
71 }
72 
73 #endif // REVERTQUERY_H
bool UsingSR
Whether software rollback should be used instead of regular rollback.
Definition: revertquery.hpp:45
The RevertQuery class can be used to rollback any edit.
Definition: revertquery.hpp:32
void Kill()
Terminates a query.
Definition: revertquery.cpp:74
QString QueryTargetToString()
Return a target of a query.
bool Processed()
Returns true in case that query is processed.
Modifications of mediawiki pages can be done using this query.
Definition: editquery.hpp:25
void Process()
Execute query.
Definition: revertquery.cpp:53
bool IgnorePreflightCheck
Rollback with no check if it&#39;s a good idea or not (revert even whitelisted users, sysops etc) ...
Definition: revertquery.hpp:48
Wiki edit.
Definition: wikiedit.hpp:67
This class can be used to execute any kind of api query on any wiki.
Definition: apiquery.hpp:55
Query base class for all http queries executed by huggle.
Definition: query.hpp:64