LeechCraft  0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
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 
14 namespace LC::Util
15 {
30  {
31  QString Separator_;
32  QList<QString> FilterTags_;
33  int TagsRole_ = -1;
34  bool NormalMode_ = true;
35  public:
40  enum class TagsInclusionMode
41  {
47  Any,
48 
54  All
55  };
56  private:
57  TagsInclusionMode TagsMode_ = TagsInclusionMode::All;
58  public:
63  explicit TagsFilterModel (QObject *parent = nullptr);
64 
65  void SetFilterString (const QString&) override;
66 
67  void SetTagsRole (int role);
68 
82  void SetSeparator (const QString& separator);
83 
91  void SetTagsInclusionMode (TagsInclusionMode mode);
92 
99  void SetTagsMode (bool enabled);
100  protected:
103  bool filterAcceptsRow (int, const QModelIndex&) const override;
104 
114  virtual QStringList GetTagsForIndex (int row) const;
115  private:
116  bool FilterTagsMode (int, const QModelIndex&) const;
117  };
118 }
#define UTIL_TAGS_API
Definition: tagsconfig.h:16
Provides filter model with additional tags filter mode.
TagsInclusionMode
Describes the modes of matching two sets of tags.