Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.6 KB
Raw Blame
/* This file is part of the KDE project
   SPDX-FileCopyrightText: 2006 Peter Simonsson <[email protected]>

   SPDX-License-Identifier: LGPL-2.0-or-later
*/

#ifndef KODOCKFACTORY_H
#define KODOCKFACTORY_H

#include "kritaflake_export.h"

#include <QString>

class QDockWidget;

/**
 * Base class for factories used to create new dock widgets.
 * @see KoDockRegistry
 * @see KoCanvasObserverBase
 */
class KRITAFLAKE_EXPORT KoDockFactoryBase
{
public:
    static constexpr int DEFAULT_PRIORITY = 100;
    static constexpr int HIGHEST_PRIORITY = 0;

    enum DockPosition {
        DockTornOff, ///< Floating as its own top level window
        DockTop,    ///< Above the central widget
        DockBottom, ///< Below the central widget
        DockRight,  ///< Right of the centra widget
        DockLeft,   ///< Left of the centra widget
        DockMinimized  ///< Not docked, but reachable via the menu
    };

    KoDockFactoryBase();
    virtual ~KoDockFactoryBase();

    /// @return the id of the dock widget
    virtual QString id() const = 0;

    /// @return the priority of the dock widget, lower numbers have higher
    // priority, HIGHEST_PRIORITY is the highest. Only the log docker should
    // have that priority so that it starts logging at the earliest chance.
    virtual int priority() const
    {
        return DEFAULT_PRIORITY;
    }

    /// @return the dock widget area the widget should appear in by default
    virtual DockPosition defaultDockPosition() const = 0;

    /// Creates the dock widget
    /// @return the created dock widget
    virtual QDockWidget* createDockWidget() = 0;
};

#endif