LeechCraft
0.6.70-19424-g027e980fd1
Modular cross-platform feature rich live environment.
Toggle main menu visibility
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 <
util/models/fixedstringfilterproxymodel.h
>
12
#include <
interfaces/core/itagsmanager.h
>
13
#include "
tagsconfig.h
"
14
15
namespace
LC::Util
16
{
30
class
UTIL_TAGS_API
TagsFilterModel
:
public
FixedStringFilterProxyModel
31
{
32
QString Separator_;
33
QList<QString>
FilterTags_;
34
int
TagsRole_ = -1;
35
const
ITagsManager
*TagsManager_ =
nullptr
;
36
bool
NormalMode_ =
true
;
37
public
:
42
enum class
TagsInclusionMode
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
}
ITagsManager
Tags manager's interface.
Definition
itagsmanager.h:91
LC::Util::FixedStringFilterProxyModel::FixedStringFilterProxyModel
FixedStringFilterProxyModel(QObject *=nullptr)
Definition
fixedstringfilterproxymodel.cpp:24
LC::Util::TagsFilterModel
Provides filter model with additional tags filter mode.
Definition
tagsfiltermodel.h:31
LC::Util::TagsFilterModel::TagsInclusionMode
TagsInclusionMode
Describes the modes of matching two sets of tags.
Definition
tagsfiltermodel.h:43
LC::Util::TagsFilterModel::TagsFilterModel
TagsFilterModel(QObject *parent=nullptr)
Creates the model with the given parent.
Definition
tagsfiltermodel.cpp:17
QList
Definition
ianrulesstorage.h:16
fixedstringfilterproxymodel.h
itagsmanager.h
LC::Util
Definition
icoreproxy.h:34
tagsconfig.h
UTIL_TAGS_API
#define UTIL_TAGS_API
Definition
tagsconfig.h:16
src
util
tags
tagsfiltermodel.h
Generated by
1.18.0