2020-02-11 15:32:49 +08:00
|
|
|
#ifndef DockComponentsFactoryH
|
|
|
|
#define DockComponentsFactoryH
|
|
|
|
//============================================================================
|
|
|
|
/// \file DockComponentsFactory.h
|
|
|
|
/// \author Uwe Kindler
|
|
|
|
/// \date 10.02.2020
|
|
|
|
/// \brief Declaration of DockComponentsFactory
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
// INCLUDES
|
|
|
|
//============================================================================
|
2020-02-11 16:31:57 +08:00
|
|
|
#include "ads_globals.h"
|
|
|
|
|
2020-02-11 15:32:49 +08:00
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
class CDockWidgetTab;
|
|
|
|
class CDockAreaTitleBar;
|
|
|
|
class CDockAreaTabBar;
|
|
|
|
class CDockAreaWidget;
|
|
|
|
class CDockWidget;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Factory for creation of certain GUI elements for the docking framework.
|
|
|
|
* A default unique instance provided by CDockComponentsFactory is used for
|
|
|
|
* creation of all supported components. To inject your custom components,
|
|
|
|
* you can create your own derived dock components factory and register
|
|
|
|
* it via setDefaultFactory() function.
|
|
|
|
* \code
|
|
|
|
* CDockComponentsFactory::setDefaultFactory(new MyComponentsFactory()));
|
|
|
|
* \endcode
|
|
|
|
*/
|
2020-02-11 16:31:57 +08:00
|
|
|
class ADS_EXPORT CDockComponentsFactory
|
2020-02-11 15:32:49 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Force virtual destructor
|
|
|
|
*/
|
|
|
|
virtual ~CDockComponentsFactory() {}
|
|
|
|
|
2020-02-11 22:38:49 +08:00
|
|
|
/**
|
|
|
|
* This default implementation just creates a dock widget tab with
|
|
|
|
* new CDockWidgetTab(DockWIdget).
|
|
|
|
*/
|
2020-02-11 15:32:49 +08:00
|
|
|
virtual CDockWidgetTab* createDockWidgetTab(CDockWidget* DockWidget) const;
|
2020-02-11 22:38:49 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This default implementation just creates a dock area tab bar with
|
|
|
|
* new CDockAreaTabBar(DockArea).
|
|
|
|
*/
|
2020-02-11 15:32:49 +08:00
|
|
|
virtual CDockAreaTabBar* createDockAreaTabBar(CDockAreaWidget* DockArea) const;
|
2020-02-11 22:38:49 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This default implementation just creates a dock area title bar with
|
|
|
|
* new CDockAreaTitleBar(DockArea).
|
|
|
|
*/
|
2020-02-11 15:32:49 +08:00
|
|
|
virtual CDockAreaTitleBar* createDockAreaTitleBar(CDockAreaWidget* DockArea) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the default components factory
|
|
|
|
*/
|
2020-02-11 16:31:57 +08:00
|
|
|
static const CDockComponentsFactory* factory();
|
2020-02-11 15:32:49 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets a new default factory for creation of GUI elements.
|
|
|
|
* This function takes ownership of the given Factory.
|
|
|
|
*/
|
2020-02-11 16:31:57 +08:00
|
|
|
static void setFactory(CDockComponentsFactory* Factory);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Resets the current factory to the
|
|
|
|
*/
|
|
|
|
static void resetDefaultFactory();
|
2020-02-11 15:32:49 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience function to ease factory instance access
|
|
|
|
*/
|
|
|
|
inline const CDockComponentsFactory* componentsFactory()
|
|
|
|
{
|
2020-02-11 16:31:57 +08:00
|
|
|
return CDockComponentsFactory::factory();
|
2020-02-11 15:32:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace ads
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
#endif // DockComponentsFactoryH
|