digiKam
importview.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-26-07
7  * Description : Main view for import tool
8  *
9  * Copyright (C) 2012 by Islam Wazery <wazery at ubuntu dot com>
10  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
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_IMPORTVIEW_H
26 #define DIGIKAM_IMPORTVIEW_H
27 
28 // Local includes
29 
30 #include "dlayoutbox.h"
31 #include "camiteminfo.h"
32 #include "sidebarwidget.h"
33 #include "importui.h"
34 #include "importstackedview.h"
35 
36 namespace Digikam
37 {
38 
39 class ImportUI;
40 
41 class ImportView : public DHBox
42 {
43  Q_OBJECT
44 
45 public:
46 
47  ImportView(Digikam::ImportUI* const ui, QWidget* const parent);
48  ~ImportView() override;
49 
50  void applySettings();
51  void refreshView();
52  void clearHistory();
53  void getForwardHistory(QStringList& titles);
54  void getBackwardHistory(QStringList& titles);
55  void showSideBars();
56  void hideSideBars();
57  void setThumbSize(int size);
58  void toggleShowBar(bool b);
59  void toggleFullScreen(bool set);
60  void updateIconView();
61 
62  void scrollTo(const QString& folder, const QString& file);
63 
64  CamItemInfo camItemInfo(const QString& folder, const QString& file) const;
65  CamItemInfo& camItemInfoRef(const QString& folder, const QString& file) const;
66  bool hasImage(const CamItemInfo& info) const;
67 
68  QList<QUrl> allUrls() const;
69  QList<QUrl> selectedUrls() const;
72  void setSelectedCamItemInfos(const CamItemInfoList& infos) const;
73  int downloadedCamItemInfos() const;
74  bool hasCurrentItem() const;
75  bool isSelected(const QUrl& url) const;
76 
77  double zoomMin() const;
78  double zoomMax() const;
82 
83 Q_SIGNALS:
84 
85  void signalImageSelected(const CamItemInfoList& selectedImage, const CamItemInfoList& allImages);
86  void signalNewSelection(bool hasSelection);
88  void signalSelectionChanged(int numberOfSelectedItems);
90  void signalZoomChanged(double);
94 
95 public Q_SLOTS:
96 
97  void setZoomFactor(double zoom);
98 
100  void slotZoomIn();
101  void slotZoomOut();
102  void slotZoomTo100Percents();
103  void slotFitToWindow();
104 
105  void slotImagePreview();
106  void slotMapWidgetView();
107  void slotIconView();
108 
109  void slotSelectAll();
110  void slotSelectNone();
111  void slotSelectInvert();
112 
113  void slotImageRename();
114 
115  void slotSortImagesBy(int sortBy);
116  void slotSortImagesOrder(int order);
117  void slotSeparateImages(int mode);
118 
119 private Q_SLOTS:
120 
121  void slotImageSelected();
122  void slotTogglePreviewMode(const CamItemInfo& info, bool downloadPreview);
123  void slotDispatchImageSelected();
124 
125  void slotFirstItem();
126  void slotPrevItem();
127  void slotNextItem();
128  void slotLastItem();
129  void slotSelectItemByUrl(const QUrl&);
130 
131  void slotViewModeChanged();
132  void slotEscapePreview();
133 
134  void slotThumbSizeEffect();
135  void slotZoomFactorChanged(double);
136 
137  void slotImageChangeFailed(const QString& message, const QStringList& fileNames);
138 
139 private:
140 
141  void toggleZoomActions();
142  void setupConnections();
143  void loadViewState();
144  void saveViewState();
145 
146 private:
147 
148  class Private;
149  Private* const d;
150 };
151 
152 } // namespace Digikam
153 
154 #endif // DIGIKAM_IMPORTVIEW_H
Definition: camiteminfo.h:48
Definition: dlayoutbox.h:45
Definition: importfiltermodel.h:101
StackedViewMode
Definition: importstackedview.h:61
Definition: importui.h:62
Definition: importview.h:42
void signalZoomChanged(double)
ImportFilterModel * importFilterModel() const
Definition: importview.cpp:902
void slotFitToWindow()
Definition: importview.cpp:647
void signalSwitchedToPreview()
void slotZoomIn()
View Action slots.
Definition: importview.cpp:611
ImportView(Digikam::ImportUI *const ui, QWidget *const parent)
Definition: importview.cpp:134
void slotSelectAll()
Definition: importview.cpp:802
void slotIconView()
Definition: importview.cpp:684
CamItemInfo camItemInfo(const QString &folder, const QString &file) const
Definition: importview.cpp:361
void getBackwardHistory(QStringList &titles)
~ImportView() override
Definition: importview.cpp:185
QList< QUrl > selectedUrls() const
Definition: importview.cpp:381
void setZoomFactor(double zoom)
Definition: importview.cpp:520
void slotImageRename()
Definition: importview.cpp:797
void scrollTo(const QString &folder, const QString &file)
Definition: importview.cpp:865
bool hasImage(const CamItemInfo &info) const
Definition: importview.cpp:371
ThumbnailSize thumbnailSize() const
Definition: importview.cpp:559
void slotImagePreview()
Definition: importview.cpp:700
void slotSortImagesOrder(int order)
Definition: importview.cpp:830
void getForwardHistory(QStringList &titles)
double zoomMax() const
Definition: importview.cpp:515
CamItemInfo & camItemInfoRef(const QString &folder, const QString &file) const
Definition: importview.cpp:366
void signalThumbSizeChanged(int)
double zoomMin() const
Definition: importview.cpp:510
void signalImageSelected(const CamItemInfoList &selectedImage, const CamItemInfoList &allImages)
bool hasCurrentItem() const
Definition: importview.cpp:887
void slotMapWidgetView()
Definition: importview.cpp:679
void signalSelectionChanged(int numberOfSelectedItems)
void setSelectedCamItemInfos(const CamItemInfoList &infos) const
Definition: importview.cpp:396
QList< CamItemInfo > allItems() const
Definition: importview.cpp:391
void applySettings()
Definition: importview.cpp:191
bool isSelected(const QUrl &url) const
Definition: importview.cpp:417
QList< QUrl > allUrls() const
Definition: importview.cpp:376
void toggleFullScreen(bool set)
Definition: importview.cpp:912
void signalNewSelection(bool hasSelection)
QList< CamItemInfo > selectedCamItemInfos() const
Definition: importview.cpp:386
void slotSelectNone()
Definition: importview.cpp:807
void setThumbSize(int size)
Definition: importview.cpp:531
void signalSwitchedToMapView()
void slotSeparateImages(int mode)
Definition: importview.cpp:843
int downloadedCamItemInfos() const
Definition: importview.cpp:401
void slotSelectInvert()
Definition: importview.cpp:812
void signalSwitchedToIconView()
void slotZoomOut()
Definition: importview.cpp:625
void slotZoomTo100Percents()
Definition: importview.cpp:639
void toggleShowBar(bool b)
Definition: importview.cpp:856
void updateIconView()
Definition: importview.cpp:917
ImportStackedView::StackedViewMode viewMode() const
Definition: importview.cpp:907
void slotSortImagesBy(int sortBy)
Definition: importview.cpp:817
void refreshView()
Definition: importview.cpp:198
Definition: thumbnailsize.h:42
Definition: datefolderview.cpp:43