digiKam
stackedview.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 : 2006-06-13
7  * Description : A widget stack to embedded album content view
8  * or the current image preview.
9  *
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_STACKED_VIEW_H
27 #define DIGIKAM_STACKED_VIEW_H
28 
29 // Qt includes
30 
31 #include <QMainWindow>
32 #include <QStackedWidget>
33 
34 // Local includes
35 
36 #include "digikam_config.h"
37 #include "digikam_export.h"
38 #include "iteminfo.h"
39 #include "thumbbardock.h"
40 
41 namespace Digikam
42 {
43 
44 class DigikamItemView;
45 class ItemCategorizedView;
46 class ItemPreviewView;
47 class ItemThumbnailBar;
48 class TableView;
49 class TrashView;
50 
51 #ifdef HAVE_MEDIAPLAYER
52 
53 class MediaPlayerView;
54 
55 #endif //HAVE_MEDIAPLAYER
56 
57 #ifdef HAVE_MARBLE
58 
59 class MapWidgetView;
60 
61 #endif // HAVE_MARBLE
62 
63 class StackedView : public QStackedWidget
64 {
65  Q_OBJECT
66 
67 public:
68 
70  {
80  };
81 
82 public:
83 
84  explicit StackedView(QWidget* const parent = nullptr);
85  ~StackedView() override;
86 
87  /* Attach the thumbnail dock widget to the specified QMainWindow. */
88  void setDockArea(QMainWindow*);
89 
90  ThumbBarDock* thumbBarDock() const;
91  ItemThumbnailBar* thumbBar() const;
94  TableView* tableView() const;
95  TrashView* trashView() const;
96 
97 #ifdef HAVE_MEDIAPLAYER
98 
99  MediaPlayerView* mediaPlayerView() const;
100 
101 #endif //HAVE_MEDIAPLAYER
102 
103 #ifdef HAVE_MARBLE
104 
105  MapWidgetView* mapWidgetView() const;
106 
107 #endif // HAVE_MARBLE
108 
114  bool isInSingleFileMode() const;
115  bool isInMultipleFileMode() const;
116  bool isInAbstractMode() const;
117 
118  void setPreviewItem(const ItemInfo& info = ItemInfo(),
119  const ItemInfo& previous = ItemInfo(),
120  const ItemInfo& next = ItemInfo());
121  StackedViewMode viewMode() const;
122  void setViewMode(const StackedViewMode mode);
123  void previewLoaded();
124 
125  void increaseZoom();
126  void decreaseZoom();
127  void fitToWindow();
128  void toggleFitToWindowOr100();
129  void zoomTo100Percents();
130  bool maxZoom();
131  bool minZoom();
132  void setZoomFactor(double z);
133  void setZoomFactorSnapped(double z);
134  double zoomFactor();
135  double zoomMin();
136  double zoomMax();
137 
138 Q_SIGNALS:
139 
148 
152 
153 public Q_SLOTS:
154 
155  void slotEscapePreview();
156 
157 private Q_SLOTS:
158 
159  void slotPreviewLoaded(bool);
160  void slotZoomFactorChanged(double);
161  void slotThumbBarSelectionChanged();
162  void slotIconViewSelectionChanged();
163 
164 private:
165 
166  void readSettings();
167  void syncSelection(ItemCategorizedView* const from, ItemCategorizedView* const to);
168 
169 private:
170 
171  class Private;
172  Private* const d;
173 };
174 
175 } // namespace Digikam
176 
177 #endif // DIGIKAM_STACKED_VIEW_H
Definition: digikamitemview.h:43
Definition: itemcategorizedview.h:49
Definition: iteminfo.h:78
Definition: itempreviewview.h:46
Definition: itemthumbnailbar.h:36
Class containing digiKam's central map view.
Definition: mapwidgetview.h:51
Definition: mediaplayerview.h:47
Definition: stackedview.h:64
void toggleFitToWindowOr100()
Definition: stackedview.cpp:576
void setDockArea(QMainWindow *)
Definition: stackedview.cpp:262
TrashView * trashView() const
Definition: stackedview.cpp:318
void signalGotoAlbumAndItem(const ItemInfo &)
ItemPreviewView * imagePreviewView() const
Definition: stackedview.cpp:299
bool isInMultipleFileMode() const
Definition: stackedview.cpp:338
bool isInSingleFileMode() const
Definition: stackedview.cpp:332
double zoomMin()
Definition: stackedview.cpp:607
TableView * tableView() const
Definition: stackedview.cpp:313
void decreaseZoom()
Definition: stackedview.cpp:561
void signalAddToExistingQueue(int)
double zoomMax()
Definition: stackedview.cpp:612
ItemThumbnailBar * thumbBar() const
Definition: stackedview.cpp:276
DigikamItemView * imageIconView() const
Definition: stackedview.cpp:294
~StackedView() override
Definition: stackedview.cpp:250
void zoomTo100Percents()
Definition: stackedview.cpp:566
bool maxZoom()
Definition: stackedview.cpp:581
void signalGotoDateAndItem(const ItemInfo &)
void setPreviewItem(const ItemInfo &info=ItemInfo(), const ItemInfo &previous=ItemInfo(), const ItemInfo &next=ItemInfo())
Definition: stackedview.cpp:350
void setZoomFactorSnapped(double z)
Definition: stackedview.cpp:597
void increaseZoom()
Definition: stackedview.cpp:556
StackedView(QWidget *const parent=nullptr)
Definition: stackedview.cpp:129
void setZoomFactor(double z)
Definition: stackedview.cpp:591
void slotEscapePreview()
Definition: stackedview.cpp:281
bool isInAbstractMode() const
Definition: stackedview.cpp:345
void signalZoomFactorChanged(double)
void setViewMode(const StackedViewMode mode)
Definition: stackedview.cpp:422
void previewLoaded()
Definition: stackedview.cpp:543
void signalGotoTagAndItem(int)
bool minZoom()
Definition: stackedview.cpp:586
void fitToWindow()
Definition: stackedview.cpp:571
ThumbBarDock * thumbBarDock() const
Definition: stackedview.cpp:271
StackedViewMode
Definition: stackedview.h:70
@ StackedViewModeLast
Definition: stackedview.h:79
@ StackedViewModeFirst
Definition: stackedview.h:71
@ PreviewImageMode
Definition: stackedview.h:73
@ MapWidgetMode
Definition: stackedview.h:77
@ TableViewMode
Definition: stackedview.h:75
@ MediaPlayerMode
Definition: stackedview.h:78
@ WelcomePageMode
Definition: stackedview.h:74
@ IconViewMode
Definition: stackedview.h:72
@ TrashViewMode
Definition: stackedview.h:76
StackedViewMode viewMode() const
Definition: stackedview.cpp:417
double zoomFactor()
Definition: stackedview.cpp:602
Definition: tableview.h:56
Definition: thumbbardock.h:84
Definition: trashview.h:38
Definition: datefolderview.cpp:43