digiKam
importstackedview.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 : 2012-05-07
7  * Description : QStackedWidget to handle different types of views
8  * (icon view, items preview, media view)
9  *
10  * Copyright (C) 2012 by Islam Wazery <wazery at ubuntu dot com>
11  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
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_IMPORT_STACKED_VIEW_H
27 #define DIGIKAM_IMPORT_STACKED_VIEW_H
28 
29 // Qt includes
30 
31 #include <QStackedWidget>
32 
33 // Local includes
34 
35 #include "digikam_config.h"
36 #include "importthumbnailbar.h"
37 #include "importpreviewview.h"
38 #include "thumbbardock.h"
39 #include "camiteminfo.h"
40 #include "importiconview.h"
41 #include "digikam_export.h"
42 
43 #ifdef HAVE_MEDIAPLAYER
44 # include "mediaplayerview.h"
45 #endif //HAVE_MEDIAPLAYER
46 
47 #ifdef HAVE_MARBLE
48 # include "mapwidgetview.h"
49 #endif // HAVE_MARBLE
50 
51 namespace Digikam
52 {
53 
54 class DIGIKAM_GUI_EXPORT ImportStackedView : public QStackedWidget
55 {
56  Q_OBJECT
57 
58 public:
59 
61  {
62  PreviewCameraMode = 0,
64 
65 #ifdef HAVE_MARBLE
66 
67  MapWidgetMode,
68  MediaPlayerMode
69 
70 #else
71 
73  MapWidgetMode
74 
75 #endif // HAVE_MARBLE
76 
77  };
78 
79 public:
80 
81  explicit ImportStackedView(QWidget* const parent = nullptr);
82  ~ImportStackedView() override;
83 
84  void setDockArea(QMainWindow*);
85 
86  ThumbBarDock* thumbBarDock() const;
87  ImportThumbnailBar* thumbBar() const;
88  ImportIconView* importIconView() const;
89  ImportPreviewView* importPreviewView() const;
90 
91 #ifdef HAVE_MARBLE
92 
93  MapWidgetView* mapWidgetView() const;
94 
95 #endif // HAVE_MARBLE
96 
97 #ifdef HAVE_MEDIAPLAYER
98 
99  MediaPlayerView* mediaPlayerView() const;
100 
101 #endif //HAVE_MEDIAPLAYER
102 
103  bool isInSingleFileMode() const;
104  bool isInMultipleFileMode() const;
105 /*
106  FIXME
107  bool isInAbstractMode() const;
108 */
109  void setPreviewItem(const CamItemInfo& info = CamItemInfo(),
110  const CamItemInfo& previous = CamItemInfo(),
111  const CamItemInfo& next = CamItemInfo());
112 
113  StackedViewMode viewMode() const;
114  void setViewMode(const StackedViewMode mode);
115  void previewLoaded();
116 
117  void increaseZoom();
118  void decreaseZoom();
119  void fitToWindow();
120  void toggleFitToWindowOr100();
121  void zoomTo100Percents();
122  void setZoomFactor(double z);
123  void setZoomFactorSnapped(double z);
124 
125  bool maxZoom() const;
126  bool minZoom() const;
127  double zoomFactor() const;
128  double zoomMin() const;
129  double zoomMax() const;
130 
131 Q_SIGNALS:
132 
138 /*
139  FIXME
140  void signalGotoAlbumAndItem(const CamItemInfo&);
141  void signalGotoDateAndItem(const CamItemInfo&);
142  void signalGotoTagAndItem(int);
143 */
144 public Q_SLOTS:
145 
146  void slotEscapePreview();
147 
148 private Q_SLOTS:
149 
150  void slotPreviewLoaded(bool);
151  void slotZoomFactorChanged(double);
152  void slotThumbBarSelectionChanged();
153  void slotIconViewSelectionChanged();
154 
155 private:
156 
157  void readSettings();
158  void syncSelection(ImportCategorizedView* const from, ImportCategorizedView* const to);
159 
161  QString identifyCategoryforMime(const QString& mime) const;
162 
163 private:
164 
165  class Private;
166  Private* const d;
167 };
168 
169 } // namespace Digikam
170 
171 #endif // DIGIKAM_IMPORT_STACKED_VIEW_H
Definition: camiteminfo.h:48
Definition: importcategorizedview.h:44
Definition: importiconview.h:38
Definition: importpreviewview.h:36
Definition: importstackedview.h:55
StackedViewMode
Definition: importstackedview.h:61
@ PreviewImageMode
Definition: importstackedview.h:63
@ MediaPlayerMode
Definition: importstackedview.h:72
void signalZoomFactorChanged(double)
Definition: importthumbnailbar.h:36
Class containing digiKam's central map view.
Definition: mapwidgetview.h:51
Definition: mediaplayerview.h:47
Definition: thumbbardock.h:84
Definition: datefolderview.cpp:43