File indexing completed on 2024-05-12 05:54:33
0001 /* 0002 SPDX-FileCopyrightText: 2005 Dirk Eschler <deschler@users.sourceforge.net> 0003 SPDX-FileCopyrightText: 2005-2022 Krusader Krew <https://krusader.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef SEARCHOBJECT_H 0009 #define SEARCHOBJECT_H 0010 0011 // QtCore 0012 #include <QList> 0013 #include <QString> 0014 0015 class SearchObject 0016 { 0017 public: 0018 SearchObject(); 0019 SearchObject(const QString &name, bool found, const QString ¬e); 0020 virtual ~SearchObject(); 0021 0022 const QString &getSearchName() const 0023 { 0024 return _searchName; 0025 } 0026 const QString &getNote() const 0027 { 0028 return _note; 0029 } 0030 bool getFound() const 0031 { 0032 return _found; 0033 } 0034 void setSearchName(const QString &s) 0035 { 0036 _searchName = s; 0037 } 0038 void setNote(const QString &s) 0039 { 0040 _note = s; 0041 } 0042 void setFound(const bool &b) 0043 { 0044 _found = b; 0045 } 0046 0047 protected: 0048 QString _searchName; 0049 bool _found; 0050 QString _note; 0051 }; 0052 0053 // ----------------------------------------------------------------------------- 0054 // ----------------------------------------------------------------------------- 0055 0056 class Application : public SearchObject 0057 { 0058 public: 0059 Application(); 0060 Application(const QString &searchName, bool found, const QString &appName, const QString &website = QString(), const QString ¬e = QString()); 0061 Application(const QString &searchName, const QString &website, bool found, const QString ¬e = QString()); 0062 virtual ~Application(); 0063 0064 const QString &getWebsite() const 0065 { 0066 return _website; 0067 } 0068 const QString &getAppName() const 0069 { 0070 return _appName; 0071 } 0072 const QString &getPath() const 0073 { 0074 return _path; 0075 } 0076 void setWebsite(const QString &s) 0077 { 0078 _website = s; 0079 } 0080 void setAppName(const QString &s) 0081 { 0082 _appName = s; 0083 } 0084 void setPath(const QString &s) 0085 { 0086 _path = s; 0087 } 0088 0089 protected: 0090 QString _appName; 0091 QString _website; 0092 QString _path; 0093 }; 0094 0095 // ----------------------------------------------------------------------------- 0096 // ----------------------------------------------------------------------------- 0097 0098 class Archiver : public Application 0099 { 0100 public: 0101 Archiver(); 0102 Archiver(const QString &searchName, const QString &website, bool found, bool isPacker, bool isUnpacker, const QString ¬e = QString()); 0103 ~Archiver(); 0104 0105 bool getIsPacker() const 0106 { 0107 return _isPacker; 0108 } 0109 bool getIsUnpacker() const 0110 { 0111 return _isUnpacker; 0112 } 0113 void setIsPacker(const bool &b) 0114 { 0115 _isPacker = b; 0116 } 0117 void setIsUnpacker(const bool &b) 0118 { 0119 _isUnpacker = b; 0120 } 0121 0122 protected: 0123 bool _isPacker; 0124 bool _isUnpacker; 0125 }; 0126 0127 // ----------------------------------------------------------------------------- 0128 // ----------------------------------------------------------------------------- 0129 0130 class ApplicationGroup : public SearchObject 0131 { 0132 public: 0133 ApplicationGroup(const QString &searchName, bool foundGroup, const QList<Application *> &apps, const QString ¬e = QString()); 0134 ~ApplicationGroup(); 0135 0136 const QList<Application *> &getAppVec() const 0137 { 0138 return _apps; 0139 } 0140 bool getFoundGroup() const 0141 { 0142 return _foundGroup; 0143 } 0144 0145 protected: 0146 QList<Application *> _apps; 0147 bool _foundGroup; 0148 }; 0149 0150 #endif