#ifndef SECTIONCONTENT_H #define SECTIONCONTENT_H #include #include #include #include #include #include "ads/API.h" ADS_NAMESPACE_BEGIN class ContainerWidget; class SectionContent { friend class ContainerWidget; private: SectionContent(); SectionContent(const SectionContent&); SectionContent& operator=(const SectionContent&); public: typedef QSharedPointer RefPtr; typedef QWeakPointer WeakPtr; /*! * Creates new content, associates it to container and takes ownership of * title- and content- widgets. * \param uniqueName An unique identifier across the entire process. * \param container The parent ContainerWidget in which this content will be active. * \param title The widget to use as title. * \param content The widget to use as content. * \return May return a invalid ref-pointer in case of invalid parameters. */ static RefPtr newSectionContent(const QString& uniqueName, ContainerWidget* container, QWidget* title, QWidget* content); virtual ~SectionContent(); int uid() const; QString uniqueName() const; ContainerWidget* containerWidget() const; QWidget* titleWidget() const; QWidget* contentWidget() const; private: const int _uid; QString _uniqueName; ContainerWidget* _container; QPointer _title; QPointer _content; static int NextUid; static QHash LookupMap; static QHash LookupMapByName; }; ADS_NAMESPACE_END #endif