Do some refactoring for public api logic
This commit is contained in:
@@ -52,6 +52,18 @@ public:
|
||||
*/
|
||||
QMenu* createContextMenu() const;
|
||||
|
||||
/*!
|
||||
* Serializes the current state of contents and returns it as a plain byte array.
|
||||
* \see restoreState(const QByteArray&)
|
||||
*/
|
||||
QByteArray saveState() const;
|
||||
|
||||
/*!
|
||||
* Deserilizes the state of contents from <em>data</em>, which was written with <em>saveState()</em>.
|
||||
* \see saveState()
|
||||
*/
|
||||
bool restoreState(const QByteArray& data);
|
||||
|
||||
//
|
||||
// Internal Stuff Begins Here
|
||||
//
|
||||
@@ -70,11 +82,8 @@ public:
|
||||
QRect outerBottomDropRect() const;
|
||||
QRect outerLeftDropRect() const;
|
||||
|
||||
// Geometry and state serialization
|
||||
QByteArray saveState() const;
|
||||
bool restoreState(const QByteArray& data);
|
||||
|
||||
private:
|
||||
SectionWidget* dropContentOuterHelper(QLayout* l, const InternalContentData& data, Qt::Orientation orientation, bool append);
|
||||
void saveGeometryWalk(QDataStream& out, QWidget* widget) const;
|
||||
bool restoreGeometryWalk(QDataStream& in, QSplitter* currentSplitter = NULL);
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ class FloatingWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class ContainerWidget;
|
||||
|
||||
public:
|
||||
FloatingWidget(ContainerWidget* container, SectionContent::RefPtr sc, SectionTitleWidget* titleWidget, SectionContentWidget* contentWidget, QWidget* parent = NULL);
|
||||
virtual ~FloatingWidget();
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
|
||||
ADS_NAMESPACE_BEGIN
|
||||
|
||||
class ContainerWidget;
|
||||
class SectionWidget;
|
||||
|
||||
class SectionContentWidget : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class ContainerWidget;
|
||||
|
||||
public:
|
||||
SectionContentWidget(SectionContent::RefPtr c, QWidget* parent = 0);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "ads/SectionContent.h"
|
||||
|
||||
ADS_NAMESPACE_BEGIN
|
||||
|
||||
class ContainerWidget;
|
||||
class SectionWidget;
|
||||
class FloatingWidget;
|
||||
|
||||
@@ -17,6 +17,7 @@ class SectionTitleWidget : public QFrame
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool activeTab MEMBER _activeTab NOTIFY activeTabChanged)
|
||||
|
||||
friend class ContainerWidget;
|
||||
friend class SectionWidget;
|
||||
|
||||
SectionContent::RefPtr _content;
|
||||
|
||||
@@ -25,9 +25,11 @@ class InternalContentData;
|
||||
class SectionWidget : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class ContainerWidget;
|
||||
|
||||
explicit SectionWidget(ContainerWidget* parent);
|
||||
|
||||
public:
|
||||
explicit SectionWidget(ContainerWidget* parent);
|
||||
virtual ~SectionWidget();
|
||||
|
||||
int uid() const;
|
||||
@@ -39,7 +41,7 @@ public:
|
||||
const QList<SectionContent::RefPtr>& contents() const { return _contents; }
|
||||
void addContent(SectionContent::RefPtr c);
|
||||
void addContent(const InternalContentData& data, bool autoActivate);
|
||||
bool take(int uid, InternalContentData& data);
|
||||
bool takeContent(int uid, InternalContentData& data);
|
||||
int indexOfContent(SectionContent::RefPtr c) const;
|
||||
int indexOfContentByTitlePos(const QPoint& pos, QWidget* exclude = NULL) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user