LeechCraft 0.6.70-19424-g027e980fd1
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
13#include "tagsconfig.h"
14
15namespace LC::Util
16{
31 {
32 QString Separator_;
33 QList<QString> FilterTags_;
34 int TagsRole_ = -1;
35 const ITagsManager *TagsManager_ = nullptr;
36 bool NormalMode_ = true;
37 public:
43 {
49 Any,
50
56 All
57 };
58 private:
59 TagsInclusionMode TagsMode_ = TagsInclusionMode::All;
60 public:
65 explicit TagsFilterModel (QObject *parent = nullptr);
66
76 void SetTagsRole (int role, const ITagsManager& tm);
77
89 void SetSeparator (const QString& separator);
90
97 void SetTagsInclusionMode (TagsInclusionMode mode);
98
105 void SetTagsMode (bool enabled);
106 protected:
107 void UpdateDerivedFilter (const QString&) override;
108
109 bool filterAcceptsRow (int, const QModelIndex&) const override;
110
120 virtual QStringList GetTagsForIndex (int row) const;
121 private:
122 bool FilterTagsMode (int, const QModelIndex&) const;
123 };
124}
Tags manager's interface.
Provides filter model with additional tags filter mode.
TagsInclusionMode
Describes the modes of matching two sets of tags.
TagsFilterModel(QObject *parent=nullptr)
Creates the model with the given parent.
#define UTIL_TAGS_API
Definition tagsconfig.h:16