digiKam
tagmngrlistitem.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 20013-08-22
7  * Description : List View Item for List View Model
8  *
9  * Copyright (C) 2013 by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_TAG_MNGR_LIST_ITEM_H
25 #define DIGIKAM_TAG_MNGR_LIST_ITEM_H
26 
27 // Qt includes
28 
29 #include <QList>
30 #include <QVariant>
31 
32 namespace Digikam
33 {
34 
35 class ListItem : public QObject
36 {
37  Q_OBJECT
38 
39 public:
40 
41  explicit ListItem(QList<QVariant>& data, ListItem* const parent = nullptr);
42  ~ListItem() override;
43 
44  void appendChild(ListItem* const child);
45  void removeTagId(int tagId);
46  void deleteChild(int row);
47  void setData(const QList<QVariant>& data);
48  void removeAll();
49  void appendList(const QList<ListItem*>& items);
50  void deleteChild(ListItem* const item);
51 
52  ListItem* child(int row) const;
53  QVariant data(int column) const;
54  ListItem* parent() const;
55  int childCount() const;
56  int columnCount() const;
57  int row() const;
58  QList<int> getTagIds() const;
60  bool equal(ListItem* const item) const;
61 
70  ListItem* containsItem(ListItem* const item) const;
71 
72 private:
73 
74  class Private;
75  Private* const d;
76 };
77 
78 } // namespace Digikam
79 
80 #endif // DIGIKAM_TAG_MNGR_LIST_ITEM_H
Definition: tagmngrlistitem.h:36
ListItem * parent() const
Definition: tagmngrlistitem.cpp:186
void appendList(const QList< ListItem * > &items)
Definition: tagmngrlistitem.cpp:128
ListItem * containsItem(ListItem *const item) const
containsItem - search child items if contains a ListItem with the same data as item
Definition: tagmngrlistitem.cpp:201
~ListItem() override
Definition: tagmngrlistitem.cpp:69
ListItem(QList< QVariant > &data, ListItem *const parent=nullptr)
Definition: tagmngrlistitem.cpp:55
void removeAll()
Definition: tagmngrlistitem.cpp:122
QList< ListItem * > allChildren() const
Definition: tagmngrlistitem.cpp:87
void deleteChild(int row)
Definition: tagmngrlistitem.cpp:117
void appendChild(ListItem *const child)
Definition: tagmngrlistitem.cpp:97
QList< int > getTagIds() const
Definition: tagmngrlistitem.cpp:92
bool equal(ListItem *const item) const
Definition: tagmngrlistitem.cpp:216
void removeTagId(int tagId)
Definition: tagmngrlistitem.cpp:102
int row() const
Definition: tagmngrlistitem.cpp:191
int columnCount() const
Definition: tagmngrlistitem.cpp:133
ListItem * child(int row) const
Definition: tagmngrlistitem.cpp:107
void setData(const QList< QVariant > &data)
Definition: tagmngrlistitem.cpp:181
int childCount() const
Definition: tagmngrlistitem.cpp:112
QVariant data(int column) const
Definition: tagmngrlistitem.cpp:138
Definition: datefolderview.cpp:43