LeechCraft 0.6.70-17769-g4e68d7fcba
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
12#include "tagsconfig.h"
13
14namespace LC::Util
15{
30 {
31 QString Separator_;
32 QList<QString> FilterTags_;
33 bool NormalMode_ = true;
34 public:
40 {
47
54 };
55 private:
56 TagsInclusionMode TagsMode_ = TagsInclusionMode::All;
57 public:
62 explicit TagsFilterModel (QObject *parent = nullptr);
63
64 void SetFilterString (const QString&) override;
65
79 void SetSeparator (const QString& separator);
80
88 void SetTagsInclusionMode (TagsInclusionMode mode);
89
96 void SetTagsMode (bool enabled);
97 protected:
100 bool filterAcceptsRow (int, const QModelIndex&) const override;
101
111 virtual QStringList GetTagsForIndex (int row) const = 0;
112 private:
113 bool FilterTagsMode (int, const QModelIndex&) const;
114 };
115}
Provides filter model with additional tags filter mode.
TagsInclusionMode
Describes the modes of matching two sets of tags.
@ All
Filter string tags should be a subset of row tags.
@ Any
Tags intersection should be non-empty.
TagsFilterModel(QObject *parent=nullptr)
Creates the model with the given parent.
virtual QStringList GetTagsForIndex(int row) const =0
Returns the list of tags for the given row.
#define UTIL_TAGS_API
Definition tagsconfig.h:16