LeechCraft 0.6.70-14794-g33744ae6ce
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
tagsfiltermodel.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QSortFilterProxyModel>
12#include "tagsconfig.h"
13
14namespace LC::Util
15{
29 class UTIL_TAGS_API TagsFilterModel : public QSortFilterProxyModel
30 {
31 bool NormalMode_ = true;
32 QString Separator_;
33 public:
39 {
45 Any,
46
52 All
53 };
54 private:
55 TagsInclusionMode TagsMode_ = TagsInclusionMode::All;
56 public:
61 explicit TagsFilterModel (QObject *parent = nullptr);
62
76 void SetSeparator (const QString& separator);
77
85 void SetTagsInclusionMode (TagsInclusionMode mode);
86
93 void SetTagsMode (bool enabled);
94 protected:
97 bool filterAcceptsRow (int, const QModelIndex&) const override;
98
108 virtual QStringList GetTagsForIndex (int row) const = 0;
109 private:
110 bool FilterNormalMode (int, const QModelIndex&) const;
111 bool FilterTagsMode (int, const QModelIndex&) const;
112 };
113}
Provides filter model with additional tags filter mode.
TagsInclusionMode
Describes the modes of matching two sets of tags.
virtual QStringList GetTagsForIndex(int row) const =0
Returns the list of tags for the given row.
#define UTIL_TAGS_API
Definition: tagsconfig.h:16