digiKam
searchtabheader.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-02-26
7  * Description : Upper widget in the search sidebar
8  *
9  * Copyright (C) 2008-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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_SEARCH_TAB_HEADER_H
25 #define DIGIKAM_SEARCH_TAB_HEADER_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 
31 // Local includes
32 
33 #include "coredbalbuminfo.h"
34 
35 namespace Digikam
36 {
37 
38 class Album;
39 class SAlbum;
40 class SearchWindow;
41 
42 class SearchTabHeader : public QWidget
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit SearchTabHeader(QWidget* const parent);
49  ~SearchTabHeader() override;
50 
51 public Q_SLOTS:
52 
53  void selectedSearchChanged(Album* album);
54  void editSearch(SAlbum* album);
55  void newKeywordSearch();
56  void newAdvancedSearch();
57 
58 Q_SIGNALS:
59 
60  void searchShallBeSelected(const QList<Album*>& albums);
61 
62 private Q_SLOTS:
63 
64  void keywordChanged();
65  void keywordChangedTimer();
66  void slotEditCurrentSearch();
67  void saveSearch();
68  void storedKeywordChanged();
69  void editStoredAdvancedSearch();
70  void advancedSearchEdited(int id, const QString& query);
71 
72 private:
73 
74  void setCurrentSearch(DatabaseSearch::Type type, const QString& query, bool selectCurrentAlbum = true);
75  QString queryFromKeywords(const QString& keywords) const;
76  QString keywordsFromQuery(const QString& query) const;
77  SearchWindow* searchWindow() const;
78 
79 private:
80 
81  class Private;
82  Private* const d;
83 };
84 
85 } // namespace Digikam
86 
87 #endif // DIGIKAM_SEARCH_TAB_HEADER_H
Abstract base class for all album types.
Definition: album.h:67
Definition: album.h:493
Definition: searchtabheader.h:43
void editSearch(SAlbum *album)
Definition: searchtabheader.cpp:486
~SearchTabHeader() override
Definition: searchtabheader.cpp:412
void selectedSearchChanged(Album *album)
Definition: searchtabheader.cpp:436
void newAdvancedSearch()
Definition: searchtabheader.cpp:513
void searchShallBeSelected(const QList< Album * > &albums)
SearchTabHeader(QWidget *const parent)
Definition: searchtabheader.cpp:239
void newKeywordSearch()
Definition: searchtabheader.cpp:507
Definition: searchwindow.h:35
@ Album
Definition: coredbfields.h:58
Type
Definition: coredbconstants.h:60
Definition: datefolderview.cpp:43