| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/services/abstract/gui/formcategorydetails.h`/ |
| 2 | |
| 3 | #ifndef FORMCATEGORYDETAILS_H |
| 4 | #define FORMCATEGORYDETAILS_Hcxx . . $ `src/librssguard/services/abstract/gui/formcategorydetails.h:4:9`! |
| 5 | |
| 6 | #include "3rd-party/boolinq/boolinq.h"cxx . . $ `<file>/src/librssguard/3rd-party/boolinq/boolinq.h`/ |
| 7 | #include "definitions/definitions.h"cxx . . $ `<file>/src/librssguard/definitions/definitions.h`/ |
| 8 | |
| 9 | #include <QDialog> |
| 10 | |
| 11 | namespace Uicxx . . $ Ui/ { |
| 12 | class FormCategoryDetailscxx . . $ Ui/FormCategoryDetails#; |
| 13 | } |
| 14 | |
| 15 | class Categorycxx . . $ Category#; |
| 16 | class ServiceRootcxx . . $ ServiceRoot#; |
| 17 | class FeedsModelcxx . . $ FeedsModel#; |
| 18 | class RootItemcxx . . $ RootItem#; |
| 19 | class QMenucxx . . $ QMenu#; |
| 20 | class QActioncxx . . $ QAction#; |
| 21 | class MultiFeedEditCheckBoxcxx . . $ MultiFeedEditCheckBox#; |
| 22 | |
| 23 | class RSSGUARD_DLLSPECcxx . . $ `<built-in>:525:9`! FormCategoryDetailscxx . . $ FormCategoryDetails# : public QDialogcxx . . $ QDialog# { |
| 24 | Q_OBJECTcxx . . $ FormCategoryDetails#QPrivateSignal# |
| 25 | |
| 26 | public: |
| 27 | explicit FormCategoryDetailscxx . . $ FormCategoryDetails#FormCategoryDetails(a58ef70f26615382).(ServiceRootcxx . . $ ServiceRoot#* service_root, |
| 28 | RootItemcxx . . $ RootItem#* parent_to_select = nullptr, |
| 29 | QWidgetcxx . . $ QWidget#* parent = nullptr); |
| 30 | virtual ~cxx . . $ FormCategoryDetails#`~FormCategoryDetails`(ced63f7c635d850d).FormCategoryDetailscxx . . $ FormCategoryDetails#(); |
| 31 | |
| 32 | template <class T> |
| 33 | QListcxx . . $ QList#<T*> addEditCategorycxx . . $ FormCategoryDetails#addEditCategory(375fdcae2aa48f4a).(const QListcxx . . $ QList#<Categorycxx . . $ Category#*>& cats_to_edit =cxx . . $ QList#QList(ced63f7c635d850d). {}); |
| 34 | |
| 35 | template <class T> |
| 36 | T* categorycxx . . $ FormCategoryDetails#category(5a2a78a048fb49a8).() const; |
| 37 | |
| 38 | // Returns all cats. |
| 39 | template <class T> |
| 40 | QListcxx . . $ QList#<T*> categoriescxx . . $ FormCategoryDetails#categories(1e5d3d3cd083a237).() const; |
| 41 | |
| 42 | protected: |
| 43 | bool isChangeAllowedcxx . . $ FormCategoryDetails#isChangeAllowed(a022fe814984cdb0).(MultiFeedEditCheckBoxcxx . . $ MultiFeedEditCheckBox#* mcb) const; |
| 44 | virtual void loadCategoryDatacxx . . $ FormCategoryDetails#loadCategoryData(49f6e7a06ebc5aa8).(); |
| 45 | |
| 46 | protected slotscxx . . $ `<external>/4830994369567095248/qtmetamacros.h:42:14`!: |
| 47 | virtual void applycxx . . $ FormCategoryDetails#apply(49f6e7a06ebc5aa8).(); |
| 48 | |
| 49 | private slotscxx . . $ `<external>/4830994369567095248/qtmetamacros.h:42:14`!: |
| 50 | |
| 51 | // Trigerred when title/description changes. |
| 52 | void onTitleChangedcxx . . $ FormCategoryDetails#onTitleChanged(3520e46b33348bf6).(const QStringcxx . . $ QString#& new_title); |
| 53 | void onDescriptionChangedcxx . . $ FormCategoryDetails#onDescriptionChanged(3520e46b33348bf6).(const QStringcxx . . $ QString#& new_description); |
| 54 | |
| 55 | // Icon selectors. |
| 56 | void onLoadIconFromFilecxx . . $ FormCategoryDetails#onLoadIconFromFile(49f6e7a06ebc5aa8).(); |
| 57 | void onUseDefaultIconcxx . . $ FormCategoryDetails#onUseDefaultIcon(49f6e7a06ebc5aa8).(); |
| 58 | |
| 59 | private: |
| 60 | void createConnectionscxx . . $ FormCategoryDetails#createConnections(49f6e7a06ebc5aa8).(); |
| 61 | void initializecxx . . $ FormCategoryDetails#initialize(49f6e7a06ebc5aa8).(); |
| 62 | |
| 63 | // Loads categories into the dialog + give root "category" |
| 64 | // and make sure that no childs of input category (including) |
| 65 | // input category are loaded. |
| 66 | void loadCategoriescxx . . $ FormCategoryDetails#loadCategories(7ff72cd165d54968).(const QListcxx . . $ QList#<Categorycxx . . $ Category#*>& categories, RootItemcxx . . $ RootItem#* root_item, Categorycxx . . $ Category#* input_category); |
| 67 | |
| 68 | private: |
| 69 | QScopedPointercxx . . $ QScopedPointer#<Uicxx . . $ Ui/::FormCategoryDetailscxx . . $ Ui/FormCategoryDetails#> m_uicxx . . $ FormCategoryDetails#m_ui.; |
| 70 | QListcxx . . $ QList#<Categorycxx . . $ Category#*> m_categoriescxx . . $ FormCategoryDetails#m_categories.; |
| 71 | ServiceRootcxx . . $ ServiceRoot#* m_serviceRootcxx . . $ FormCategoryDetails#m_serviceRoot.; |
| 72 | QMenucxx . . $ QMenu#* m_iconMenucxx . . $ FormCategoryDetails#m_iconMenu.{}; |
| 73 | QActioncxx . . $ QAction#* m_actionLoadIconFromFilecxx . . $ FormCategoryDetails#m_actionLoadIconFromFile.{}; |
| 74 | QActioncxx . . $ QAction#* m_actionUseDefaultIconcxx . . $ FormCategoryDetails#m_actionUseDefaultIcon.{}; |
| 75 | RootItemcxx . . $ RootItem#* m_parentToSelectcxx . . $ FormCategoryDetails#m_parentToSelect.; |
| 76 | bool m_creatingNewcxx . . $ FormCategoryDetails#m_creatingNew.; |
| 77 | bool m_isBatchEditcxx . . $ FormCategoryDetails#m_isBatchEdit.; |
| 78 | }; |
| 79 | |
| 80 | template <class T> |
| 81 | inline QListcxx . . $ QList#<T*> FormCategoryDetailscxx . . $ FormCategoryDetails#::addEditCategorycxx . . $ FormCategoryDetails#addEditCategory(375fdcae2aa48f4a).(const QListcxx . . $ QList#<Categorycxx . . $ Category#*>& cats_to_edit) { |
| 82 | m_creatingNewcxx . . $ FormCategoryDetails#m_creatingNew. = cats_to_edit.isEmptycxx . . $ QList#isEmpty(3482b152b9333168).(); |
| 83 | m_isBatchEditcxx . . $ FormCategoryDetails#m_isBatchEdit. = cats_to_edit.sizecxx . . $ QList#size(6b0412d51016192f).() > 1; |
| 84 | |
| 85 | if (m_creatingNewcxx . . $ FormCategoryDetails#m_creatingNew.) { |
| 86 | m_categoriescxx . . $ FormCategoryDetails#m_categories..appendcxx . . $ QList#append(e066ee4c4c55d0c4).(new T()); |
| 87 | } |
| 88 | else { |
| 89 | m_categoriescxx . . $ FormCategoryDetails#m_categories..appendcxx . . $ QList#append(3d2301cfd89f773a).(cats_to_edit); |
| 90 | } |
| 91 | |
| 92 | loadCategoryDatacxx . . $ FormCategoryDetails#loadCategoryData(49f6e7a06ebc5aa8).(); |
| 93 | |
| 94 | if (execcxx . . $ QDialog#exec(b126dc7c1de90089).() == QDialogcxx . . $ QDialog#::DialogCodecxx . . $ QDialog#DialogCode#::Acceptedcxx . . $ QDialog#Accepted.) { |
| 95 | return categoriescxx . . $ FormCategoryDetails#categories(1e5d3d3cd083a237).<T>(); |
| 96 | } |
| 97 | else { |
| 98 | return {}; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | template <class T> |
| 103 | inline T* FormCategoryDetailscxx . . $ FormCategoryDetails#::categorycxx . . $ FormCategoryDetails#category(5a2a78a048fb49a8).() const { |
| 104 | return qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<T*>(m_categoriescxx . . $ FormCategoryDetails#m_categories..firstcxx . . $ QList#first(2042464fc1fea03e).()); |
| 105 | } |
| 106 | |
| 107 | template <class T> |
| 108 | inline QListcxx . . $ QList#<T*> FormCategoryDetailscxx . . $ FormCategoryDetails#::categoriescxx . . $ FormCategoryDetails#categories(1e5d3d3cd083a237).() const { |
| 109 | stdcxx . . $ std/::listcxx . . $ std/__cxx11/list#<T*> std_cats = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(m_categoriescxx . . $ FormCategoryDetails#m_categories.) |
| 110 | .selectcxx . . $ boolinq/Linq#select(42b1d9758f09da81).([](Categorycxx . . $ Category#* fd) { |
| 111 | return qobject_castcxx . . $ qobject_cast(b43813ea30849ae3).<T*>(fd); |
| 112 | }) |
| 113 | .toStdList(); |
| 114 | |
| 115 | return FROM_STD_LISTcxx . . $ std/__cxx11/list#end(57ce810e58fbcab0).(QList<T*>, std_cats); |
| 116 | } |
| 117 | |
| 118 | #endif // FORMCATEGORYDETAILS_H |