perfmon/ui/hb/app/inc/datacontainer.h
branchRCL_3
changeset 21 b3cee849fa46
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/ui/hb/app/inc/datacontainer.h	Tue Aug 31 15:15:20 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* 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 DATACONTAINER_H
+#define DATACONTAINER_H
+
+#include <hbwidget.h>
+#include <enginewrapper.h>
+
+class DataContainer : public HbWidget
+{
+    Q_OBJECT
+
+public:
+    DataContainer(const EngineWrapper& engine, QGraphicsItem *parent = 0) :
+            HbWidget(parent),
+            mEngine(engine)
+    {
+    }
+
+    void hideContainer()
+        {
+        disconnect(&mEngine, SIGNAL(samplesUpdated()), this, SLOT(samplesUpdated()));
+        hide();
+        }
+    
+    void showContainer()
+        {
+        connect(&mEngine, SIGNAL(samplesUpdated()),this, SLOT(samplesUpdated()));
+        show();
+        }
+    
+    inline const EngineWrapper& engine() const { return mEngine; }
+
+public slots:
+    virtual void samplesUpdated()
+    {
+    update();
+    }
+
+private:
+    const EngineWrapper& mEngine;
+};
+
+#endif // DATACONTAINER_H