File indexing completed on 2024-05-12 15:56:40

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 class QDockWidget;
0013 class QString;
0014 
0015 /**
0016  * Base class for factories used to create new dock widgets.
0017  * @see KoDockRegistry
0018  * @see KoCanvasObserverBase
0019  */
0020 class KRITAFLAKE_EXPORT KoDockFactoryBase
0021 {
0022 public:
0023     enum DockPosition {
0024         DockTornOff, ///< Floating as its own top level window
0025         DockTop,    ///< Above the central widget
0026         DockBottom, ///< Below the central widget
0027         DockRight,  ///< Right of the centra widget
0028         DockLeft,   ///< Left of the centra widget
0029         DockMinimized  ///< Not docked, but reachable via the menu
0030     };
0031 
0032     KoDockFactoryBase();
0033     virtual ~KoDockFactoryBase();
0034 
0035     /// @return the id of the dock widget
0036     virtual QString id() const = 0;
0037 
0038     /// @return the dock widget area the widget should appear in by default
0039     virtual DockPosition defaultDockPosition() const = 0;
0040 
0041     /// Creates the dock widget
0042     /// @return the created dock widget
0043     virtual QDockWidget* createDockWidget() = 0;
0044 };
0045 
0046 #endif