digiKam
albumselectwidget.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 : 2009-26-02
7  * Description : a widget to select a physical album
8  *
9  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2010 by Johannes Wienke <languitar at semipol dot de>
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_ALBUM_SELECT_WIDGET_H
26 #define DIGIKAM_ALBUM_SELECT_WIDGET_H
27 
28 // Qt includes
29 
30 #include <QWidget>
31 
32 // Local includes
33 
34 #include "albummanager.h"
35 #include "albumtreeview.h"
36 #include "searchtextbardb.h"
37 
38 class QTreeWidget;
39 
40 namespace Digikam
41 {
42 
43 class PAlbum;
44 class AlbumModificationHelper;
45 
52 {
53  Q_OBJECT
54 
55 public:
56 
64  AlbumSelectTreeView(AlbumModel* const model,
65  AlbumModificationHelper* const albumModificationHelper,
66  QWidget* const parent = nullptr);
67 
71  ~AlbumSelectTreeView() override;
72 
73  void addCustomContextMenuActions(ContextMenuHelper& cmh, Album* album) override;
74  void handleCustomContextMenuAction(QAction* action, const AlbumPointer<Album>& album) override;
75 
76 public Q_SLOTS:
77 
82  void slotNewAlbum();
83 
84 private:
85 
86  class Private;
87  Private* d;
88 };
89 
90 // -----------------------------------------------------------------------------------------------
91 
92 class AlbumSelectWidget : public QWidget
93 {
94  Q_OBJECT
95 
96 public:
97 
98  explicit AlbumSelectWidget(QWidget* const parent = nullptr,
99  PAlbum* const albumToSelect = nullptr,
100  bool completerSelect = false);
101  ~AlbumSelectWidget() override;
102 
103  void setCurrentAlbumUrl(const QUrl& albumUrl);
104  QUrl currentAlbumUrl() const;
105 
106  PAlbum* currentAlbum() const;
107  void setCurrentAlbum(PAlbum* const albumToSelect);
108 
109 Q_SIGNALS:
110 
113 
114 private Q_SLOTS:
115 
116  void slotCompleterTimer();
117  void slotAlbumRenamed(Album*);
118  void slotCompleterHighlighted(int albumId);
119 
120 private:
121 
122  class Private;
123  Private* const d;
124 };
125 
126 } // namespace Digikam
127 
128 #endif // DIGIKAM_ALBUM_SELECT_WIDGET_H
Definition: albummodel.h:40
Definition: albummodificationhelper.h:46
Definition: albumpointer.h:48
Definition: albumselectwidget.h:52
AlbumSelectTreeView(AlbumModel *const model, AlbumModificationHelper *const albumModificationHelper, QWidget *const parent=nullptr)
Definition: albumselectwidget.cpp:70
void handleCustomContextMenuAction(QAction *action, const AlbumPointer< Album > &album) override
Definition: albumselectwidget.cpp:93
~AlbumSelectTreeView() override
Definition: albumselectwidget.cpp:82
void addCustomContextMenuActions(ContextMenuHelper &cmh, Album *album) override
Definition: albumselectwidget.cpp:87
void slotNewAlbum()
Definition: albumselectwidget.cpp:104
Definition: albumselectwidget.h:93
QUrl currentAlbumUrl() const
Definition: albumselectwidget.cpp:247
void setCurrentAlbumUrl(const QUrl &albumUrl)
Definition: albumselectwidget.cpp:259
void setCurrentAlbum(PAlbum *const albumToSelect)
Definition: albumselectwidget.cpp:242
PAlbum * currentAlbum() const
Definition: albumselectwidget.cpp:237
AlbumSelectWidget(QWidget *const parent=nullptr, PAlbum *const albumToSelect=nullptr, bool completerSelect=false)
Definition: albumselectwidget.cpp:146
~AlbumSelectWidget() override
Definition: albumselectwidget.cpp:230
Definition: albumtreeview.h:37
Abstract base class for all album types.
Definition: album.h:67
A helper class to add actions and special menus to the context menu.
Definition: contextmenuhelper.h:80
Definition: album.h:357
Definition: datefolderview.cpp:43