2015-12-09 19:21:38 +08:00
|
|
|
#ifndef SECTIONCONTENT_H
|
|
|
|
#define SECTIONCONTENT_H
|
|
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QHash>
|
|
|
|
#include <QSharedPointer>
|
2016-02-11 21:33:02 +08:00
|
|
|
#include <QWeakPointer>
|
2015-12-09 19:21:38 +08:00
|
|
|
|
2016-02-02 22:01:48 +08:00
|
|
|
#include "ads/API.h"
|
2015-12-09 19:21:38 +08:00
|
|
|
|
|
|
|
ADS_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class SectionContent
|
|
|
|
{
|
2016-02-11 21:33:02 +08:00
|
|
|
friend class ContainerWidget;
|
|
|
|
|
|
|
|
private:
|
|
|
|
SectionContent(QWidget* title, QWidget* content, const QString& uniqueName = QString()); ///< Do not use!
|
|
|
|
|
2015-12-09 19:21:38 +08:00
|
|
|
public:
|
|
|
|
typedef QSharedPointer<SectionContent> RefPtr;
|
2016-02-11 21:33:02 +08:00
|
|
|
typedef QWeakPointer<SectionContent> WeakPtr;
|
2015-12-09 19:21:38 +08:00
|
|
|
|
|
|
|
virtual ~SectionContent();
|
|
|
|
int uid() const;
|
|
|
|
QString uniqueName() const;
|
|
|
|
QWidget* titleWidget() const;
|
|
|
|
QWidget* contentWidget() const;
|
|
|
|
|
2016-02-11 21:33:02 +08:00
|
|
|
static RefPtr newSectionContent(QWidget* title, QWidget* content, const QString& uniqueName = QString());
|
2015-12-09 19:21:38 +08:00
|
|
|
|
2016-02-11 21:33:02 +08:00
|
|
|
private:
|
2015-12-09 19:21:38 +08:00
|
|
|
const int _uid;
|
|
|
|
const QString _uniqueName;
|
|
|
|
QPointer<QWidget> _title;
|
|
|
|
QPointer<QWidget> _content;
|
|
|
|
|
|
|
|
static int NextUid;
|
2016-02-11 21:33:02 +08:00
|
|
|
static QHash<int, SectionContent::WeakPtr> LookupMap;
|
|
|
|
static QHash<QString, SectionContent::WeakPtr> LookupMapByName;
|
2015-12-09 19:21:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
ADS_NAMESPACE_END
|
2016-02-12 14:15:10 +08:00
|
|
|
#endif
|