2015-12-09 19:21:38 +08:00
|
|
|
#ifndef SECTION_CONTENT_WIDGET_H
|
|
|
|
#define SECTION_CONTENT_WIDGET_H
|
2017-02-20 17:06:55 +08:00
|
|
|
/*******************************************************************************
|
|
|
|
** QtAdcancedDockingSystem
|
|
|
|
** Copyright (C) 2017 Uwe Kindler
|
|
|
|
**
|
|
|
|
** This program is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** This program is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
2015-12-09 19:21:38 +08:00
|
|
|
#include <QFrame>
|
|
|
|
|
2016-02-02 22:01:48 +08:00
|
|
|
#include "ads/API.h"
|
|
|
|
#include "ads/SectionContent.h"
|
2015-12-09 19:21:38 +08:00
|
|
|
|
2017-02-23 05:33:48 +08:00
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
class CMainContainerWidget;
|
2015-12-09 19:21:38 +08:00
|
|
|
class SectionWidget;
|
2017-02-23 05:33:48 +08:00
|
|
|
class SectionTitleWidget;
|
|
|
|
|
|
|
|
|
|
|
|
struct SectionContentWidgetPrivate;
|
2015-12-09 19:21:38 +08:00
|
|
|
|
2017-02-23 05:33:48 +08:00
|
|
|
|
|
|
|
class CSectionContentWidget : public QFrame
|
2015-12-09 19:21:38 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2017-02-23 05:33:48 +08:00
|
|
|
private:
|
|
|
|
SectionContentWidgetPrivate* d;
|
|
|
|
friend class SectionContentWidgetPrivate;
|
|
|
|
friend class CMainContainerWidget;
|
2016-02-15 18:13:58 +08:00
|
|
|
|
2015-12-09 19:21:38 +08:00
|
|
|
public:
|
2017-02-23 05:33:48 +08:00
|
|
|
enum Flag
|
|
|
|
{
|
|
|
|
None = 0,
|
|
|
|
Closeable = 1,
|
|
|
|
Maximizable = 2,
|
|
|
|
AllFlags = Closeable | Maximizable
|
|
|
|
};
|
|
|
|
Q_DECLARE_FLAGS(Flags, Flag)
|
|
|
|
|
|
|
|
CSectionContentWidget(SectionContent::RefPtr c = SectionContent::RefPtr(), QWidget* parent = 0);
|
|
|
|
virtual ~CSectionContentWidget();
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Creates new content, associates it to <em>container</em> and takes ownership of
|
|
|
|
* <em>title</em>- and <em>content</em>- 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 CSectionContentWidget* newSectionContent(const QString& uniqueName,
|
|
|
|
CMainContainerWidget* container, QWidget* title, QWidget* content);
|
|
|
|
|
|
|
|
int uid() const;
|
|
|
|
QString uniqueName() const;
|
|
|
|
CMainContainerWidget* containerWidget() const;
|
|
|
|
QWidget* titleWidgetContent() const;
|
|
|
|
QWidget* contentWidget() const;
|
|
|
|
Flags flags() const;
|
|
|
|
|
|
|
|
QString visibleTitle() const;
|
|
|
|
QString title() const;
|
|
|
|
void setTitle(const QString& title);
|
|
|
|
void setFlags(const Flags f);
|
2015-12-09 19:21:38 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
SectionContent::RefPtr _content;
|
|
|
|
};
|
|
|
|
|
2017-02-23 05:33:48 +08:00
|
|
|
} // namespace ads
|
2016-02-12 14:15:10 +08:00
|
|
|
#endif
|