File indexing completed on 2024-05-19 04:24:48

0001 /* This file is part of the KDE project
0002    SPDX-FileCopyrightText: 2006 Peter Simonsson <peter.simonsson@gmail.com>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KODOCKFACTORY_H
0008 #define KODOCKFACTORY_H
0009 
0010 #include "kritaflake_export.h"
0011 
0012 #include <QString>
0013 
0014 class QDockWidget;
0015 
0016 /**
0017  * Base class for factories used to create new dock widgets.
0018  * @see KoDockRegistry
0019  * @see KoCanvasObserverBase
0020  */
0021 class KRITAFLAKE_EXPORT KoDockFactoryBase
0022 {
0023 public:
0024     enum DockPosition {
0025         DockTornOff, ///< Floating as its own top level window
0026         DockTop,    ///< Above the central widget
0027         DockBottom, ///< Below the central widget
0028         DockRight,  ///< Right of the centra widget
0029         DockLeft,   ///< Left of the centra widget
0030         DockMinimized  ///< Not docked, but reachable via the menu
0031     };
0032 
0033     KoDockFactoryBase();
0034     virtual ~KoDockFactoryBase();
0035 
0036     /// @return the id of the dock widget
0037     virtual QString id() const = 0;
0038 
0039     /// @return the dock widget area the widget should appear in by default
0040     virtual DockPosition defaultDockPosition() const = 0;
0041 
0042     /// Creates the dock widget
0043     /// @return the created dock widget
0044     virtual QDockWidget* createDockWidget() = 0;
0045 };
0046 
0047 #endif