"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/core/libs/album/widgets/albumselectwidget.h" (4 Sep 2019, 3096 Bytes) of package /linux/misc/digikam-6.3.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "albumselectwidget.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 6.2.0_vs_6.3.0.

    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-2019 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 "searchtextbar.h"
   37 
   38 class QTreeWidget;
   39 
   40 namespace Digikam
   41 {
   42 
   43 class PAlbum;
   44 class AlbumModificationHelper;
   45 
   46 /**
   47  * Enables a simple context menu only for creating a new album.
   48  *
   49  * @author jwienke
   50  */
   51 class AlbumSelectTreeView: public AlbumTreeView
   52 {
   53     Q_OBJECT
   54 
   55 public:
   56 
   57     /**
   58      * Constructor.
   59      *
   60      * @param model album model to work with
   61      * @param albumModificationHelper helper object for modifying albums
   62      * @param parent parent for Qt's parent child mechanism
   63      */
   64     AlbumSelectTreeView(AlbumModel* const model, AlbumModificationHelper* const albumModificationHelper, QWidget* const parent = nullptr);
   65 
   66     /**
   67      * Destructor.
   68      */
   69     ~AlbumSelectTreeView();
   70 
   71     virtual void addCustomContextMenuActions(ContextMenuHelper& cmh, Album* album) override;
   72     virtual void handleCustomContextMenuAction(QAction* action, AlbumPointer<Album> album) override;
   73 
   74 public Q_SLOTS:
   75 
   76     /**
   77      * Shows a dialog to create a new album under the selected album in this
   78      * view.
   79      */
   80     void slotNewAlbum();
   81 
   82 private:
   83 
   84     class Private;
   85     Private* d;
   86 };
   87 
   88 // -----------------------------------------------------------------------------------------------
   89 
   90 class AlbumSelectWidget : public QWidget
   91 {
   92     Q_OBJECT
   93 
   94 public:
   95 
   96     explicit AlbumSelectWidget(QWidget* const parent = nullptr,
   97                                PAlbum* const albumToSelect = nullptr, bool completerSelect = false);
   98     ~AlbumSelectWidget();
   99 
  100     void setCurrentAlbumUrl(const QUrl& albumUrl);
  101     QUrl currentAlbumUrl() const;
  102 
  103     PAlbum* currentAlbum() const;
  104     void    setCurrentAlbum(PAlbum* const albumToSelect);
  105 
  106 Q_SIGNALS:
  107 
  108     void itemSelectionChanged();
  109     void completerActivated();
  110 
  111 private Q_SLOTS:
  112 
  113     void slotCompleterTimer();
  114     void slotAlbumRenamed(Album*);
  115     void slotCompleterHighlighted(int albumId);
  116 
  117 private:
  118 
  119     class Private;
  120     Private* const d;
  121 };
  122 
  123 } // namespace Digikam
  124 
  125 #endif // DIGIKAM_ALBUM_SELECT_WIDGET_H