homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h
branchRCL_3
changeset 82 5f0182e07bfb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h	Tue Aug 31 15:06:34 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef HSPAGENEWWIDGETLAYOUT_H
+#define HSPAGENEWWIDGETLAYOUT_H
+
+#include <QGraphicsLayout>
+#include "hstest_global.h"
+
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
+class HsWidgetHost;
+class HsPageNewWidgetLayout : public QGraphicsLayout 
+{
+public: 
+    HsPageNewWidgetLayout(const QPointF &touchPoint = QPointF(),
+                          QGraphicsLayoutItem *parent = 0);
+    ~HsPageNewWidgetLayout();
+        
+    int count() const;
+    QGraphicsLayoutItem *itemAt(int i) const;
+    void removeAt(int index);
+    QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
+    void setGeometry(const QRectF &rect);
+    void addItem(HsWidgetHost *item);
+    enum sortOrder { height, width};
+
+private:
+#ifdef HSWIDGETORGANIZER_ALGORITHM
+    QList<HsWidgetHost*> sortWidgets(sortOrder order);
+#endif    
+private:
+    QSizeF mSize;
+    QList<HsWidgetHost*> mNewWidgets;
+    QPointF mTouchPoint;
+
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
+};
+
+#endif