File indexing completed on 2025-01-05 03:51:14
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2002-16-10 0007 * Description : main digiKam interface implementation 0008 * 0009 * SPDX-FileCopyrightText: 2002-2005 by Renchi Raju <renchi dot raju at gmail dot com> 0010 * SPDX-FileCopyrightText: 2006 by Tom Albers <tomalbers at kde dot nl> 0011 * SPDX-FileCopyrightText: 2002-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0012 * SPDX-FileCopyrightText: 2009-2011 by Andi Clemens <andi dot clemens at gmail dot com> 0013 * SPDX-FileCopyrightText: 2013 by Michael G. Hansen <mike at mghansen dot de> 0014 * 0015 * SPDX-License-Identifier: GPL-2.0-or-later 0016 * 0017 * ============================================================ */ 0018 0019 #ifndef DIGIKAM_APP_H 0020 #define DIGIKAM_APP_H 0021 0022 // Qt includes 0023 0024 #include <QAction> 0025 #include <QString> 0026 #include <QMenu> 0027 0028 // Local includes 0029 0030 #include "digikam_config.h" 0031 #include "dxmlguiwindow.h" 0032 #include "digikam_export.h" 0033 #include "facetags.h" 0034 0035 namespace Digikam 0036 { 0037 0038 class Album; 0039 class ItemIconView; 0040 class FaceScanSettings; 0041 class FilterStatusBar; 0042 class ItemInfo; 0043 class ItemInfoList; 0044 class CameraType; 0045 0046 class DIGIKAM_GUI_EXPORT DigikamApp : public DXmlGuiWindow 0047 { 0048 Q_OBJECT 0049 0050 public: 0051 0052 explicit DigikamApp(); 0053 ~DigikamApp() override; 0054 0055 virtual void show(); 0056 void restoreSession(); 0057 0058 void enableZoomPlusAction(bool val); 0059 void enableZoomMinusAction(bool val); 0060 void enableAlbumBackwardHistory(bool enable); 0061 void enableAlbumForwardHistory(bool enable); 0062 0063 ItemIconView* view() const; 0064 0065 static DigikamApp* instance(); 0066 0067 public: 0068 0069 DInfoInterface* infoIface(DPluginAction* const ac) override; 0070 0071 Q_SIGNALS: 0072 0073 void signalEscapePressed(); 0074 void signalNextItem(); 0075 void signalPrevItem(); 0076 void signalFirstItem(); 0077 void signalLastItem(); 0078 void signalCutAlbumItemsSelection(); 0079 void signalCopyAlbumItemsSelection(); 0080 void signalPasteAlbumItemsSelection(); 0081 0082 void signalWindowHasMoved(); 0083 0084 protected: 0085 0086 bool queryClose() override; 0087 void moveEvent(QMoveEvent* e) override; 0088 void closeEvent(QCloseEvent* e) override; 0089 0090 private: 0091 0092 void showThumbBar(bool visible) override; 0093 void showSideBars(bool visible) override; 0094 bool thumbbarVisibility() const override; 0095 void customizedFullScreenMode(bool set) override; 0096 void customizedTrashView(bool set); 0097 void toggleShowBar(); 0098 0099 private Q_SLOTS: 0100 0101 void slotAlbumSelected(Album*); 0102 void slotImageSelected(const ItemInfoList&, const ItemInfoList&); 0103 void slotTrashSelectionChanged(const QString& text); 0104 void slotSelectionChanged(int selectionCount); 0105 void slotExit(); 0106 void slotDBStat() override; 0107 void slotComponentsInfo() override; 0108 void slotOnlineVersionCheck() override; 0109 0110 void slotRecurseAlbums(bool); 0111 void slotRecurseTags(bool); 0112 0113 void slotAllGroupsOpen(bool); 0114 0115 void slotAboutToShowForwardMenu(); 0116 void slotAboutToShowBackwardMenu(); 0117 0118 void slotColorManagementOptionsChanged(); 0119 void slotToggleColorManagedView(); 0120 void slotSetCheckedExifOrientationAction(const ItemInfo& info); 0121 void slotResetExifOrientationActions(); 0122 void slotTransformAction(); 0123 0124 void slotToggleLeftSideBar() override; 0125 void slotToggleRightSideBar() override; 0126 void slotPreviousLeftSideBarTab() override; 0127 void slotNextLeftSideBarTab() override; 0128 void slotPreviousRightSideBarTab() override; 0129 void slotNextRightSideBarTab() override; 0130 0131 void slotToggleShowBar(); 0132 0133 void slotZoomSliderChanged(int); 0134 void slotThumbSizeChanged(int); 0135 void slotZoomChanged(double); 0136 0137 void slotSwitchedToPreview(); 0138 void slotSwitchedToIconView(); 0139 void slotSwitchedToMapView(); 0140 void slotSwitchedToTableView(); 0141 void slotSwitchedToTrashView(); 0142 0143 //@{ 0144 /// Internal setup methods implemented in digikamapp_setup.cpp 0145 0146 private: 0147 0148 void setupView(); 0149 void setupViewConnections(); 0150 void setupStatusBar(); 0151 void setupActions(); 0152 void setupAccelerators(); 0153 void setupExifOrientationActions(); 0154 void setupImageTransformActions(); 0155 void populateThemes(); 0156 void preloadWindows(); 0157 void initGui(); 0158 //@} 0159 0160 //@{ 0161 /// Extra tool methods implemented in digikamapp_tools.cpp 0162 0163 private: 0164 0165 void setupSelectToolsAction(); 0166 0167 private Q_SLOTS: 0168 0169 void slotMaintenance(); 0170 void slotScanNewItems(); 0171 void slotMaintenanceDone(); 0172 void slotDatabaseMigration(); 0173 void slotDetectFaces(); 0174 //@} 0175 0176 //@{ 0177 /// Configure methods implemented in digikamapp_config.cpp 0178 0179 private: 0180 0181 bool setup(); 0182 bool setupICC(); 0183 0184 private Q_SLOTS: 0185 0186 void slotSetup() override; 0187 void slotSetupChanged(); 0188 void slotEditKeys() override; 0189 void slotThemeChanged(); 0190 //@} 0191 0192 //@{ 0193 // Import tools methods implemented in digikamapp_import.cpp 0194 0195 private: 0196 0197 void updateQuickImportAction(); 0198 0199 private Q_SLOTS: 0200 0201 void slotImportedImagefromScanner(const QUrl& url); 0202 void slotImportAddImages(); 0203 void slotImportAddFolders(); 0204 //@} 0205 0206 //@{ 0207 // Camera management methods implemented in digikamapp_camera.cpp 0208 0209 public: 0210 0211 void autoDetect(); 0212 void downloadFrom(const QString& cameraGuiPath); 0213 void downloadFromUdi(const QString& udi); 0214 0215 Q_SIGNALS: 0216 0217 void queuedOpenCameraUiFromPath(const QString& path); 0218 0219 private: 0220 0221 void loadCameras(); 0222 void updateCameraMenu(); 0223 0224 private Q_SLOTS: 0225 0226 void slotSetupCamera(); 0227 void slotOpenManualCamera(QAction*); 0228 void slotCameraAdded(CameraType*); 0229 void slotCameraRemoved(QAction*); 0230 void slotCameraAutoDetect(); 0231 void slotOpenCameraUiFromPath(const QString& path); 0232 void downloadImages(const QString& folder); 0233 void cameraAutoDetect(); 0234 //@} 0235 0236 //@{ 0237 // Solid based methods implemented in digikamapp_solid.cpp 0238 0239 Q_SIGNALS: 0240 0241 void queuedOpenSolidDevice(const QString& udi); 0242 0243 private: 0244 0245 void fillSolidMenus(); 0246 void connectToSolidNotifiers(); 0247 void openSolidCamera(const QString& udi, const QString& label = QString()); 0248 void openSolidUsmDevice(const QString& udi, const QString& label = QString()); 0249 0250 private Q_SLOTS: 0251 0252 void slotOpenSolidCamera(QAction*); 0253 void slotOpenSolidUsmDevice(QAction*); 0254 void slotOpenSolidDevice(const QString& udi); 0255 void slotSolidDeviceChanged(const QString& udi); 0256 //@} 0257 0258 private: 0259 0260 // Disable 0261 DigikamApp(QWidget*) = delete; 0262 0263 private: 0264 0265 class Private; 0266 Private* const d; 0267 0268 static DigikamApp* m_instance; 0269 }; 0270 0271 } // namespace Digikam 0272 0273 #endif // DIGIKAM_APP_H