Warning, file /office/calligra/libs/widgets/KoResourceFiltering.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 0002 /* This file is part of the KDE project 0003 0004 Copyright (c) 2013 Sascha Suelzer <s.suelzer@gmail.com> 0005 0006 This library is free software; you can redistribute it and/or 0007 modify it under the terms of the GNU Lesser General Public 0008 License as published by the Free Software Foundation; either 0009 version 2.1 of the License, or (at your option) any later version. 0010 0011 This library is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 Lesser General Public License for more details. 0015 0016 You should have received a copy of the GNU Lesser General Public 0017 License along with this library; if not, write to the Free Software 0018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 0019 */ 0020 0021 #ifndef KORESOURCEFILTER_H 0022 #define KORESOURCEFILTER_H 0023 0024 #include "kowidgets_export.h" 0025 0026 #include <QList> 0027 0028 class KoResourceServerBase; 0029 class KoResource; 0030 class QStringList; 0031 class QString; 0032 0033 class KOWIDGETS_EXPORT KoResourceFiltering 0034 { 0035 0036 public: 0037 KoResourceFiltering(); 0038 virtual ~KoResourceFiltering(); 0039 void configure(int filterType, bool enable); 0040 bool hasFilters() const; 0041 bool filtersHaveChanged() const; 0042 void setTagSetFilenames(const QStringList& filenames); 0043 void setCurrentTag(const QString& tagSet); 0044 void rebuildCurrentTagFilenames(); 0045 void setResourceServer(KoResourceServerBase *resourceServer); 0046 void setFilters(const QString& searchString); 0047 QList<KoResource*> filterResources(QList< KoResource* > resources); 0048 void setInclusions(const QStringList &inclusions); 0049 void setExclusions(const QStringList &exclusions); 0050 0051 private: 0052 0053 void setDoneFiltering(); 0054 bool presetMatchesSearch(KoResource * resource) const; 0055 void setChanged(); 0056 bool excludeFilterIsValid(const QString &exclusion); 0057 bool matchesResource(const QStringList& filtered,const QStringList &filterList) const; 0058 void populateIncludeExcludeFilters(const QStringList& filteredNames); 0059 void sanitizeExclusionList(); 0060 QStringList tokenizeSearchString(const QString& searchString) const; 0061 0062 class Private; 0063 Private * const d; 0064 0065 }; 0066 0067 #endif // KORESOURCEFILTER_H