File indexing completed on 2025-01-05 03:53:37
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2011-03-22 0007 * Description : a Iface C++ interface 0008 * 0009 * SPDX-FileCopyrightText: 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * SPDX-FileCopyrightText: 2011 by Ludovic Delfau <ludovicdelfau at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_MEDIAWIKI_QUERYSITEINFOUSERGROUPS_H 0017 #define DIGIKAM_MEDIAWIKI_QUERYSITEINFOUSERGROUPS_H 0018 0019 // Local includes 0020 0021 #include "mediawiki_job.h" 0022 #include "mediawiki_usergroup.h" 0023 0024 namespace MediaWiki 0025 { 0026 0027 class Iface; 0028 class QuerySiteinfoUsergroupsPrivate; 0029 0030 /** 0031 * @brief UserGroups job. 0032 * 0033 * Uses for fetch a list of all user groups and their permissions. 0034 */ 0035 class QuerySiteinfoUsergroups : public Job 0036 { 0037 Q_OBJECT 0038 Q_DECLARE_PRIVATE(QuerySiteinfoUsergroups) 0039 0040 public: 0041 0042 /** 0043 * @brief Constructs a UserGroups job. 0044 * @param MediaWiki the MediaWiki concerned by the job 0045 * @param parent the QObject parent 0046 */ 0047 explicit QuerySiteinfoUsergroups(Iface& MediaWiki, QObject* const parent = nullptr); 0048 0049 /** 0050 * @brief Destroys the UserGroups job. 0051 */ 0052 ~QuerySiteinfoUsergroups() override; 0053 0054 /** 0055 * @brief If true number of users of each user group is included 0056 * @param includeNumber if true number of users of each user group is included 0057 */ 0058 void setIncludeNumber(bool includeNumber); 0059 0060 /** 0061 * @brief Starts the job asynchronously. 0062 */ 0063 void start() override; 0064 0065 Q_SIGNALS: 0066 0067 /** 0068 * @brief Provides a list of all user groups. 0069 * @param usergroups list of all user groups 0070 * @see QuerySiteinfoUsergroups::Result 0071 */ 0072 void usergroups(const QList<UserGroup>& usergroups); 0073 0074 private Q_SLOTS: 0075 0076 void doWorkSendRequest(); 0077 void doWorkProcessReply(); 0078 }; 0079 0080 } // namespace MediaWiki 0081 0082 #endif // DIGIKAM_MEDIAWIKI_QUERYSITEINFOUSERGROUPS_H