File indexing completed on 2025-04-27 03:58:32

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2013-04-29
0007  * Description : digiKam XML GUI window - Private container.
0008  *
0009  * SPDX-FileCopyrightText: 2013-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_DXML_GUI_WINDOW_P_H
0016 #define DIGIKAM_DXML_GUI_WINDOW_P_H
0017 
0018 #include "dxmlguiwindow.h"
0019 
0020 // C++ includes
0021 
0022 #include <cmath>
0023 
0024 // Qt includes
0025 
0026 #include <QString>
0027 #include <QList>
0028 #include <QMap>
0029 #include <QVBoxLayout>
0030 #include <QCheckBox>
0031 #include <QToolButton>
0032 #include <QEvent>
0033 #include <QHoverEvent>
0034 #include <QApplication>
0035 #include <QKeySequence>
0036 #include <QMenuBar>
0037 #include <QStatusBar>
0038 #include <QScreen>
0039 #include <QMenu>
0040 #include <QUrl>
0041 #include <QDomDocument>
0042 #include <QUrlQuery>
0043 #include <QIcon>
0044 #include <QPushButton>
0045 #include <QDir>
0046 #include <QFileInfo>
0047 #include <QResource>
0048 #include <QStandardPaths>
0049 #include <QDesktopServices>
0050 #include <QDialogButtonBox>
0051 
0052 #ifdef HAVE_QWEBENGINE
0053 #   include "webbrowserdlg.h"
0054 #endif
0055 
0056 // KDE includes
0057 
0058 #if !defined(Q_OS_DARWIN) && defined(Q_CC_GNU)
0059 #   pragma GCC diagnostic push
0060 #   pragma GCC diagnostic ignored "-Wdeprecated-declarations"
0061 #endif
0062 
0063 #if defined(Q_CC_CLANG)
0064 #   pragma clang diagnostic push
0065 #   pragma clang diagnostic ignored "-Wdeprecated-declarations"
0066 #endif
0067 
0068 #include <kconfiggroup.h>
0069 #include <ktogglefullscreenaction.h>
0070 #include <ktoolbar.h>
0071 #include <ktoggleaction.h>
0072 #include <kstandardaction.h>
0073 #include <kactioncollection.h>
0074 #include <klocalizedstring.h>
0075 #include <kwindowconfig.h>
0076 #include <ksharedconfig.h>
0077 #include <kshortcutsdialog.h>
0078 #include <kedittoolbar.h>
0079 #include <kxmlguifactory.h>
0080 #include <kconfigwidgets_version.h>
0081 
0082 #ifdef HAVE_KNOTIFYCONFIG
0083 #   include <knotifyconfigwidget.h>
0084 #endif
0085 
0086 #if KCONFIGWIDGETS_VERSION > QT_VERSION_CHECK(5, 80, 0)
0087 #   include <khamburgermenu.h>
0088 #endif
0089 
0090 // Restore warnings
0091 #if !defined(Q_OS_DARWIN) && defined(Q_CC_GNU)
0092 #   pragma GCC diagnostic pop
0093 #endif
0094 
0095 #if defined(Q_CC_CLANG)
0096 #   pragma clang diagnostic pop
0097 #endif
0098 
0099 // Local includes
0100 
0101 #include "digikam_debug.h"
0102 #include "digikam_config.h"
0103 #include "digikam_globals.h"
0104 #include "daboutdata.h"
0105 #include "dpluginloader.h"
0106 #include "solidhardwaredlg.h"
0107 
0108 namespace Digikam
0109 {
0110 
0111 class Q_DECL_HIDDEN DXmlGuiWindow::Private
0112 {
0113 public:
0114 
0115     explicit Private()
0116       : fullScreenHideToolBars  (false),
0117         fullScreenHideThumbBar  (true),
0118         fullScreenHideSideBars  (false),
0119         fullScreenHideStatusBar (false),
0120         fsOptions               (FS_NONE),
0121         fullScreenAction        (nullptr),
0122         fullScreenParent        (nullptr),
0123         fullScreenBtn           (nullptr),
0124         dirtyMainToolBar        (false),
0125         thumbbarVisibility      (true),
0126         menubarVisibility       (true),
0127         statusbarVisibility     (true),
0128         dbStatAction            (nullptr),
0129         libsInfoAction          (nullptr),
0130         showMenuBarAction       (nullptr),
0131         showStatusBarAction     (nullptr),
0132         about                   (nullptr),
0133 
0134 #if KCONFIGWIDGETS_VERSION > QT_VERSION_CHECK(5, 80, 0)
0135 
0136         hamburgerMenu           (nullptr),
0137 
0138 #endif
0139         anim                    (nullptr)
0140     {
0141     }
0142 
0143 public:
0144 
0145     /**
0146      * Settings taken from managed window configuration to handle toolbar visibility in full-screen mode
0147      */
0148     bool                     fullScreenHideToolBars;
0149 
0150     /**
0151      * Settings taken from managed window configuration to handle thumbbar visibility in full-screen mode
0152      */
0153     bool                     fullScreenHideThumbBar;
0154 
0155     /**
0156      * Settings taken from managed window configuration to handle toolbar visibility in full-screen mode
0157      */
0158     bool                     fullScreenHideSideBars;
0159 
0160     /**
0161      * Settings taken from managed window configuration to handle statusbar visibility in full-screen mode
0162      */
0163     bool                     fullScreenHideStatusBar;
0164 
0165     /**
0166      * Full-Screen options. See FullScreenOptions enum and setFullScreenOptions() for details.
0167      */
0168     int                      fsOptions;
0169 
0170     /**
0171      * Action plug in managed window to switch fullscreen state
0172      */
0173     KToggleFullScreenAction* fullScreenAction;
0174 
0175     /**
0176      * Used under MacOS only. See bug #414117
0177      */
0178     QWidget*                 fullScreenParent;
0179 
0180     /**
0181      * Show only if toolbar is hidden
0182      */
0183     QToolButton*             fullScreenBtn;
0184 
0185     /**
0186      * Used by slotToggleFullScreen() to manage state of full-screen button on managed window
0187      */
0188     bool                     dirtyMainToolBar;
0189 
0190     /**
0191      * Store previous visibility of toolbars before ful-screen mode.
0192      */
0193     QMap<KToolBar*, bool>    toolbarsVisibility;
0194 
0195     /**
0196      * Store previous visibility of thumbbar before ful-screen mode.
0197      */
0198     bool                     thumbbarVisibility;
0199 
0200     /**
0201      * Store previous visibility of menubar before ful-screen mode.
0202      */
0203     bool                     menubarVisibility;
0204 
0205     /**
0206      * Store previous visibility of statusbar before ful-screen mode.
0207      */
0208     bool                     statusbarVisibility;
0209 
0210     // Common Help actions
0211     QAction*                 dbStatAction;
0212     QAction*                 libsInfoAction;
0213     QAction*                 showMenuBarAction;
0214     QAction*                 showStatusBarAction;
0215     DAboutData*              about;
0216 
0217 #if KCONFIGWIDGETS_VERSION > QT_VERSION_CHECK(5, 80, 0)
0218 
0219     KHamburgerMenu*          hamburgerMenu;
0220 
0221 #endif
0222 
0223     DLogoAction*             anim;
0224 
0225     QString                  configGroupName;
0226 
0227     QString                  handbookSection;
0228 };
0229 
0230 } // namespace Digikam
0231 
0232 #endif // DIGIKAM_DXML_GUI_WINDOW_P_H