You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB
C

#ifndef SARIBBONELEMENTMANAGER_H
#define SARIBBONELEMENTMANAGER_H
#include "SARibbonElementFactory.h"
#include "SARibbonGlobal.h"
/**
@brief SARibbonElementFactory
ElementFactory
@code
class MyRibbonElementFactory : public SARibbonElementFactory{
public:
...
virtual SARibbonPannel* createRibbonPannel(QWidget* parent){
return new MyRibbonPannel(parent);
}
};
@endcode
ribbonbarElementFactory
main
@code
SARibbonElementManager::instance()->setupFactory(new MyRibbonElementFactory);
@endcode
SARibbonpannelMyRibbonPannel
*/
class SA_RIBBON_EXPORT SARibbonElementManager
{
protected:
SARibbonElementManager();
public:
virtual ~SARibbonElementManager();
static SARibbonElementManager* instance();
SARibbonElementFactory* factory();
void setupFactory(SARibbonElementFactory* fac);
private:
QScopedPointer< SARibbonElementFactory > mFactory;
};
#ifndef RibbonSubElementMgr
#define RibbonSubElementMgr SARibbonElementManager::instance()
#endif
#ifndef RibbonSubElementFactory
#define RibbonSubElementFactory SARibbonElementManager::instance()->factory()
#endif
#endif // SARIBBONELEMENTMANAGER_H