File indexing completed on 2024-05-05 16:49:31

0001 /** ===========================================================
0002  * @file
0003  *
0004  * This file is a part of KDE project
0005  * <a href="https://commits.kde.org/libmediawiki">libmediawiki</a>
0006  *
0007  * @date   2011-03-22
0008  * @brief  a MediaWiki C++ interface for KDE
0009  *
0010  * @author Copyright (C) 2011-2013 by Gilles Caulier
0011  *         <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
0012  * @author Copyright (C) 2010 by Alexandre Mendes
0013  *         <a href="mailto:alex dot mendes1988 at gmail dot com">alex dot mendes1988 at gmail dot com</a>
0014  * @author Copyright (C) 2011 by Guillaume Hormiere
0015  *         <a href="mailto:hormiere dot guillaume at gmail dot com">hormiere dot guillaume at gmail dot com</a>
0016  *
0017  * This program is free software; you can redistribute it
0018  * and/or modify it under the terms of the GNU General
0019  * Public License as published by the Free Software Foundation;
0020  * either version 2, or (at your option)
0021  * any later version.
0022  *
0023  * This program is distributed in the hope that it will be useful,
0024  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0025  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0026  * GNU General Public License for more details.
0027  *
0028  * ============================================================ */
0029 
0030 #ifndef MAINWINDOW_H
0031 #define MAINWINDOW_H
0032 
0033 #include <QMainWindow>
0034 #include <QMessageBox>
0035 
0036 #include <MediaWiki/Edit>
0037 #include <MediaWiki/MediaWiki>
0038 #include <MediaWiki/Login>
0039 #include <MediaWiki/QueryInfo>
0040 #include <MediaWiki/QueryRevision>
0041 
0042 namespace Ui
0043 {
0044     class MainWindow;
0045 }
0046 
0047 using namespace mediawiki;
0048 
0049 class MainWindow : public QMainWindow
0050 {
0051     Q_OBJECT
0052 
0053 public:
0054 
0055     explicit MainWindow(QWidget* const parent = nullptr);
0056     ~MainWindow();
0057 
0058 private Q_SLOTS:
0059 
0060     void on_plainTextEdit_textChanged();
0061     void on_mPageEdit_textChanged(QString);
0062     void on_mWikiEdit_textChanged(QString);
0063     void on_pushButton1_clicked();
0064     void on_pushButton2_clicked();
0065     void loginHandle(KJob* login);
0066     void revisionHandle(const QList<Revision>& revisions);
0067     void editError(KJob* job);
0068     void revisionError(KJob* job);
0069 
0070 private:
0071 
0072     Ui::MainWindow* ui;
0073     MediaWiki*      mediawiki;
0074 };
0075 
0076 #endif // MAINWINDOW_H