/usr/include/libmediawiki/edit.h is in libmediawiki-dev 1.0~digikam3.5.0-0ubuntu10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | /** ===========================================================
* @file
*
* This file is a part of KDE project
* <a href="https://projects.kde.org/projects/extragear/libs/libmediawiki">libmediawiki</a>
*
* @date 2011-03-22
* @brief a MediaWiki C++ interface for KDE
*
* @author Copyright (C) 2011-2012 by Gilles Caulier
* <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
* @author Copyright (C) 2011 by Manuel Campomanes
* <a href="mailto:campomanes dot manuel at gmail dot com">campomanes dot manuel at gmail dot com</a>
* @author Copyright (C) 2011 by Hormiere Guillaume
* <a href="mailto:hormiere dot guillaume at gmail dot com">hormiere dot guillaume at gmail dot com</a>
* @author Copyright (C) 2010 by Alexandre Mendes
* <a href="mailto:alex dot mendes1988 at gmail dot com">alex dot mendes1988 at gmail dot com</a>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation;
* either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* ============================================================ */
#ifndef MEDIAWIKI_EDIT_H
#define MEDIAWIKI_EDIT_H
// Qt includes
#include <QtCore/QDateTime>
#include <QtCore/QString>
#include <QtCore/QUrl>
#include <QtCore/QVariant>
#include <QtNetwork/QNetworkCookieJar>
// Local includes
#include "job.h"
#include "queryinfo.h"
#include "mediawiki_export.h"
namespace mediawiki
{
class MediaWiki;
class EditPrivate;
/**
* @brief Edit job.
*
* Uses for create or edit a wiki.
*/
class MEDIAWIKI_EXPORT Edit : public Job
{
Q_OBJECT
Q_DECLARE_PRIVATE(Edit)
public:
/**
* @brief Indicates all possible error conditions found during the processing of the edit.
*/
enum
{
/**
* @brief Text is missing.
*/
TextMissing = Job::UserDefinedError+1,
/**
* @brief The section is invalid.
*/
InvalidSection,
/**
* @brief The page name is protected.
*/
TitleProtected,
/**
* @brief The permission for create page is missing.
*/
CreatePagePermissionMissing,
/**
* @brief The permission for create page is missing for anonymous.
*/
AnonymousCreatePagePermissionMissing,
/**
* @brief The article already exist.
*/
ArticleDuplication,
/**
* @brief The permission for create image is missing for anonymous.
*/
AnonymousCreateImagePermissionMissing,
/**
* @brief The permission for create image is missing.
*/
CreateImagePermissionMissing,
/**
* @brief The mediawiki considers you are spamming.
*/
SpamDetected,
/**
* @brief The mediawiki refuses your edit.
*/
Filtered,
/**
* @brief The size of the article exceed.
*/
ArticleSizeExceed,
/**
* @brief The permission for edit page is missing for anonymous.
*/
AnonymousEditPagePermissionMissing,
/**
* @brief The permission for edit page is missing.
*/
EditPagePermissionMissing,
/**
* @brief The page is deleted.
*/
PageDeleted,
/**
* @brief The page is empty.
*/
EmptyPage,
/**
* @brief The section is empty.
*/
EmptySection,
/**
* @brief Mediwiki detect an edit conflict.
*/
EditConflict,
/**
* @brief The revision isn't a valid revision.
*/
RevWrongPage,
/**
* @brief The undo failed.
*/
UndoFailed
};
/**
* @brief Constructs an Edit job.
* @param parent the QObject parent
*/
explicit Edit(MediaWiki& media, QObject* parent = 0);
/**
* @brief Destroys the Edit job.
*/
virtual ~Edit();
/**
* @brief Starts the job asynchronously.
*/
virtual void start();
/**
* @brief Specify how the watchlist is affected by this edit.
*/
enum Watchlist
{
/**
* @brief Add the page to the watchlist
*/
watch,
/**
* @brief Remove the page from the watchlist
*/
unwatch,
/**
* @brief Use the preference settings
*/
preferences,
/**
* @brief Don't change the watchlist
*/
nochange
};
/**
* @brief Specify how the watchlist is affected by this edit.
* @param watchlist Specify how the watchlist is affected by this edit
*/
void setWatchList(Edit::Watchlist watchlist);
/**
* @brief If set, suppress errors about the page having been deleted in the meantime and recreate it.
* @param recreate if set, suppress errors about the page having been deleted in the meantime and recreate it
*/
void setRecreate(bool recreate);
/**
* @brief If set, throw an error if the page already exists.
* @param if set, throw an error if the page already exists
*/
void setCreateonly(bool createonly);
/**
* @brief If set, throw a missingtitle error if the page doesn't exist.
* @param norecreate if set, throw a missingtitle error if the page doesn't exist
*/
void setNocreate(bool norecreate);
/**
* @brief If set to true, mark the edit as minor
* @param minor if set to true, mark the edit as minor
*/
void setMinor(bool minor);
/**
* @brief Set the section.
* @param section new section or integer
*/
void setSection(const QString& section);
/**
* @brief Set the summary.
* @param summary the summary
*/
void setSummary(const QString& summary);
/**
* @brief Undo all revisions from undo to this one. If not set, just undo one revision.
* @param undoafter if true set the undo after property
*/
void setUndoAfter(int undoafter);
/**
* @brief Undo this revision. Overrides text, prependtext and appendtext.
* @param undo if true set the undo
*/
void setUndo(int undo);
/**
* @brief Set the text added to the beginning of the page. Overrides text.
* @param prependText the text added to the beginning of the page
*/
void setPrependText(const QString& prependText);
/**
* @brief Set the text added to the end of the page. Overrides text.
* @param appendText the text added to the end of the page
*/
void setAppendText(const QString& appendText);
/**
* @brief Set the page title.
* @param pageName the page title
*/
void setPageName(const QString& pageName);
/**
* @brief Set the edit token. Retrieve from QueryInfo.
* @param token the edit token
*/
void setToken(const QString& token);
/**
* @brief Set the timestamp of the base revision. Leave unset to ignore conflit.
* @param baseTimestamp the timestamp of the base revision
*/
void setBaseTimestamp(const QDateTime& baseTimestamp);
/**
* @brief Set the timestamp when you obtained the edit token.
* @param startTimestamp the timestamp when you obtained the edit token
*/
void setStartTimestamp(const QDateTime& startTimestamp);
/**
* @brief Set the page content.
* @param text the page content.
*/
void setText(const QString& text);
Q_SIGNALS:
/**
* @brief Emit the captcha question.
* @param captcha the captcha question
*/
void resultCaptcha(const QVariant& captcha);
private Q_SLOTS:
void doWorkSendRequest(Page page);
void finishedEdit();
public Q_SLOTS:
/**
* @brief Put the captcha answer.
* @param captcha the captcha answer
*/
void finishedCaptcha(const QString& captcha);
};
} // namespace mediawiki
#endif // EDIT_H
|