activityfw/testapplications/nftapps/lptapp/basewidget.h
changeset 117 c63ee96dbe5f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/testapplications/nftapps/lptapp/basewidget.h	Thu Sep 16 12:11:40 2010 +0100
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2009 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 BASEWIDGET_H_
+#define BASEWIDGET_H_
+
+#include <hbwidget.h>
+#include <QGraphicsLinearLayout>
+#include <QGraphicsGridLayout>
+#include <HbPushButton>
+#include <hblabel.h>
+#include <HbComboBox>
+#include <hbcheckbox.h>
+#include <hblineedit.h>
+#include <HbValidator>
+#include <QPixmap>
+#include <QByteArray>
+#include <QTimer>
+#include <QTextStream>
+#include <afactivitystorage.h>
+#include <afstorageglobals.h>
+
+class basewidget: public HbWidget
+{
+    Q_OBJECT
+public:
+    basewidget(QObject* activityStorage, QObject* activityManager, QTextStream* stream, QGraphicsItem *parent = 0);
+    ~basewidget();
+    
+
+protected:
+
+
+protected:
+    
+    QGraphicsGridLayout *mGridLayout;
+    HbPushButton *mStartTestButton;
+    HbPushButton *mChangeTestButton;
+    HbPushButton *mBreakButton;
+    HbCheckBox* mTestCheckBox;
+    HbLineEdit* mItemsEdid;
+    HbLineEdit* mTimesEdid;
+    HbLineEdit* mKBytesEdid;
+    HbLabel* mClientMemBeforeLabel;
+    HbLabel* mClientMemAfterLabel;
+    HbLabel* mClientMemDiffLabel;
+    HbLabel* mDbMemBeforeLabel;
+    HbLabel* mDbMemAfterLabel;
+    HbLabel* mDbMemDiffLabel;
+    HbLabel* mActionLabel;
+    HbLabel* mIterLabel;
+    HbLabel* mTimesLabel;
+    HbLabel* mStatusLabel;
+    HbLabel* mStatusValueLabel;
+    HbLabel* mTimesEditLabel;
+    HbLabel* mBytesEditLabel;
+    HbLabel* mItemsEditLabel;
+    
+    QIntValidator* mQItemsValidator;
+    HbValidator* mItemsValidator;
+    QIntValidator* mQTimesValidator;
+    HbValidator* mTimesValidator;
+    QIntValidator* mQKBytesValidator;
+    HbValidator* mKBytesValidator;
+    
+    QObject* mActivityStorage;
+    QObject* mActivityManager;
+    QPixmap* mPixmap;
+    QByteArray* mByteArray;
+    
+    int mItemsCounter;
+    int mTimesCounter;
+    int mItems;
+    int mTimes;
+    int mClientMemBefore;
+    int mDbMemBefore;
+    
+    QTimer* mTimer;
+    QTextStream* mStream;
+    
+    QVariant* mSaveVariant;
+    QVariantHash* mSaveMetadata;
+    QStringList mActivities; 
+    QString mAction;   
+    
+    
+signals:
+    void viewChangedRequest();
+    void testEnded(int reason);
+
+protected slots:
+    virtual void timeout();
+    virtual void test();
+    void breakTest();
+    
+public:
+
+protected:
+	bool TestCheckBoxChecked() const;
+	int Bytes() const;
+	int Times() const;
+	int Items() const;
+	int Edit2Int(const HbLineEdit* lineedit) const;
+	void prepareSave();
+	void clearSaveData();
+	bool saveActivity(int name);
+	bool removeActivity(const QString& name);
+	bool privateData(const QString& name);
+	bool getThumbnail(const QString& name);
+	bool activities();
+	int dbSize();
+	int ClientHeapSize();
+	void enableControls(bool enable);
+	void logFirst();
+	void logLast();
+	void logBaseMessage();
+	void logErrorMessage(const QString& mess);
+	void updateItemLabel(int item);
+	void updateTimeLabel(int time);
+	void updateActionLabel();
+	bool checkActNum();
+	void releaseMem();
+	virtual void endTest(int reason);
+	void setError(const QString& mess);
+	void endNormally();
+	void logSettings();
+	void clearLabels();
+	
+
+    
+};
+
+#endif /* BASEWIDGET_H_*/