File indexing completed on 2025-01-05 04:00:06

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2005-05-21
0007  * Description : Searches folder view
0008  *
0009  * SPDX-FileCopyrightText: 2005      by Renchi Raju <renchi at pooh dot tam dot uiuc dot edu>
0010  * SPDX-FileCopyrightText: 2008-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0011  * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0012  * SPDX-FileCopyrightText: 2009      by Johannes Wienke <languitar at semipol dot de>
0013  *
0014  * SPDX-License-Identifier: GPL-2.0-or-later
0015  *
0016  * ============================================================ */
0017 
0018 #ifndef DIGIKAM_SEARCH_FOLDER_VIEW_H
0019 #define DIGIKAM_SEARCH_FOLDER_VIEW_H
0020 
0021 // Local includes
0022 
0023 #include "editablesearchtreeview.h"
0024 
0025 namespace Digikam
0026 {
0027 
0028 /**
0029  * Tree view for all saved "normal" searches. Allows editing and creating
0030  * searches in the context menu.
0031  *
0032  * @author jwienke
0033  */
0034 class NormalSearchTreeView : public EditableSearchTreeView
0035 {
0036     Q_OBJECT
0037 public:
0038 
0039     /**
0040      * Constructor.
0041      *
0042      * @param parent qt parent
0043      * @param searchModel the model this view should act on
0044      * @param searchModificationHelper the modification helper object used to
0045      *                                 perform operations on the displayed
0046      *                                 searches
0047      */
0048     NormalSearchTreeView(QWidget* const parent, SearchModel* const searchModel,
0049                          SearchModificationHelper* const searchModificationHelper);
0050 
0051     /**
0052      * Destructor.
0053      */
0054     ~NormalSearchTreeView() override;
0055 
0056 Q_SIGNALS:
0057 
0058     /**
0059      * Emitted of a new search shall be created.
0060      */
0061     void newSearch();
0062 
0063     /**
0064      * Emitted if the given search shall be edited.
0065      *
0066      * @param album search to edit
0067      */
0068     void editSearch(SAlbum* album);
0069 
0070 protected:
0071 
0072     void addCustomContextMenuActions(ContextMenuHelper& cmh, Album* album)                override;
0073     void handleCustomContextMenuAction(QAction* action, const AlbumPointer<Album>& album) override;
0074 
0075 private:
0076 
0077     class Private;
0078     Private* d;
0079 };
0080 
0081 } // namespace Digikam
0082 
0083 #endif //  DIGIKAM_SEARCH_FOLDER_VIEW_H