digiKam
searchgroup.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 : 2008-01-20
7  * Description : User interface for searches
8  *
9  * Copyright (C) 2008-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_SEARCH_GROUP_H
26 #define DIGIKAM_SEARCH_GROUP_H
27 
28 // Qt includes
29 
30 #include <QWidget>
31 #include <QList>
32 
33 // Local includes
34 
35 #include "dexpanderbox.h"
36 #include "searchview.h"
37 #include "coredbsearchxml.h"
38 
39 class QVBoxLayout;
40 
41 namespace Digikam
42 {
43 
44 class SearchGroupLabel;
45 class SearchFieldGroup;
46 class SearchFieldGroupLabel;
47 
49 {
50  Q_OBJECT
51 
52 public:
53 
54  enum Type
55  {
58  };
59 
60 public:
61 
62  explicit SearchGroup(SearchView* const parent);
63 
64  void setup(Type type = FirstGroup);
65 
66  void read(SearchXmlCachingReader& reader);
67  void write(SearchXmlWriter& writer);
68  void reset();
69 
70  Type groupType() const;
71 
73 
74 Q_SIGNALS:
75 
77 
78 protected:
79 
80  SearchGroup* createSearchGroup() override;
81  void addGroupToLayout(SearchGroup* group) override;
82 
83 protected:
84 
86 
89 
90  QVBoxLayout* m_layout;
92  QVBoxLayout* m_subgroupLayout;
93 
95 };
96 
97 // -------------------------------------------------------------------------
98 
99 class SearchGroupLabel : public QWidget
100 {
101  Q_OBJECT
102 
103 public:
104 
106  SearchGroup::Type type,
107  QWidget* const parent = nullptr);
108  ~SearchGroupLabel() override;
109 
112 
115 
116 Q_SIGNALS:
117 
119 
120 protected Q_SLOTS:
121 
122  void toggleShowOptions();
123  void toggleGroupOperator();
124  void boxesToggled();
125 
126 protected:
127 
128  void setExtended(bool extended);
129  void adjustOperatorOptions();
130  void updateGroupLabel();
131 
132  void paintEvent(QPaintEvent*) override;
133 
134 private:
135 
136  class Private;
137  Private* const d;
138 };
139 
140 } // namespace Digikam
141 
142 #endif // DIGIKAM_SEARCH_GROUP_H
Definition: searchview.h:62
Definition: searchgroup.h:100
void boxesToggled()
Definition: searchgroup_label.cpp:254
SearchXml::Operator defaultFieldOperator() const
Definition: searchgroup_label.cpp:375
void updateGroupLabel()
Definition: searchgroup_label.cpp:300
void toggleShowOptions()
Definition: searchgroup_label.cpp:227
~SearchGroupLabel() override
Definition: searchgroup_label.cpp:190
SearchGroupLabel(SearchViewThemedPartsCache *const cache, SearchGroup::Type type, QWidget *const parent=nullptr)
Definition: searchgroup_label.cpp:69
void setDefaultFieldOperator(SearchXml::Operator op)
Definition: searchgroup_label.cpp:315
void toggleGroupOperator()
Definition: searchgroup_label.cpp:232
void setExtended(bool extended)
Definition: searchgroup_label.cpp:195
void adjustOperatorOptions()
Definition: searchgroup_label.cpp:321
void paintEvent(QPaintEvent *) override
Definition: searchgroup_label.cpp:387
SearchXml::Operator groupOperator() const
Definition: searchgroup_label.cpp:370
void setGroupOperator(SearchXml::Operator op)
Definition: searchgroup_label.cpp:293
Definition: searchgroup.h:49
SearchGroup * createSearchGroup() override
Re-implement: create and setup a search group.
Definition: searchgroup.cpp:301
void write(SearchXmlWriter &writer)
Definition: searchgroup.cpp:318
Type m_groupType
Definition: searchgroup.h:94
void reset()
Definition: searchgroup.cpp:336
QVBoxLayout * m_layout
Definition: searchgroup.h:90
QList< QRect > startupAnimationArea() const
Definition: searchgroup.cpp:352
void addGroupToLayout(SearchGroup *group) override
Re-implement: Adds a newly created group to the layout structures.
Definition: searchgroup.cpp:311
QList< SearchFieldGroupLabel * > m_fieldLabels
Definition: searchgroup.h:88
SearchGroup(SearchView *const parent)
Definition: searchgroup.cpp:30
void read(SearchXmlCachingReader &reader)
Definition: searchgroup.cpp:244
SearchView * m_view
Definition: searchgroup.h:85
void setup(Type type=FirstGroup)
Definition: searchgroup.cpp:40
Type
Definition: searchgroup.h:55
@ FirstGroup
Definition: searchgroup.h:56
@ ChainGroup
Definition: searchgroup.h:57
QVBoxLayout * m_subgroupLayout
Definition: searchgroup.h:92
SearchGroupLabel * m_label
Definition: searchgroup.h:91
Type groupType() const
Definition: searchgroup.cpp:347
QList< SearchFieldGroup * > m_fieldGroups
Definition: searchgroup.h:87
Definition: searchview.h:47
Definition: searchview.h:116
Definition: coredbsearchxml.h:376
Definition: coredbsearchxml.h:224
Definition: piwigotalker.h:48
Operator
Definition: coredbsearchxml.h:48
Definition: datefolderview.cpp:43
Type
Definition: gpsitemcontainer.h:45