logsui/logsengine/tsrc/hbstubs/hbstubs.cpp
changeset 16 c5af8598d22c
parent 2 7119b73b84d6
--- a/logsui/logsengine/tsrc/hbstubs/hbstubs.cpp	Wed Aug 18 09:49:12 2010 +0300
+++ b/logsui/logsengine/tsrc/hbstubs/hbstubs.cpp	Thu Sep 02 20:27:05 2010 +0300
@@ -16,9 +16,13 @@
 */
 
 // Orbit classes
+#include <hbnotificationdialog.h>
 #include <hbicon.h>
 #include <hblineedit.h>
 #include <QVariant>
+#include <hbstringutil.h>
+#include "hbstubs_helper.h"
+
 
 
 QString mUTClipboard;
@@ -35,6 +39,31 @@
 }
 
 // -----------------------------------------------------------------------------
+// HbStubsHelper
+// -----------------------------------------------------------------------------
+//
+
+QString testNotifDialogText;
+bool testConversionEnabled = false;
+
+void HbStubHelper::reset()
+{
+    testNotifDialogText.clear();
+    testConversionEnabled = false;
+}
+
+QString HbStubHelper::notificationDialogTxt()
+{
+    return testNotifDialogText;
+}
+
+void HbStubHelper::stringUtilDigitConversion(bool enabled)
+{
+    testConversionEnabled = enabled;
+}
+
+
+// -----------------------------------------------------------------------------
 // HbIcon::HbIcon
 // -----------------------------------------------------------------------------
 //
@@ -70,7 +99,7 @@
 //
 HbIcon::HbIcon(const HbIcon &icon)
 {
-    mName = "c:\\data\\images\\designer.png";
+    mName = icon.mName;
     ENSURE_DEFAULT_ICON
 }
 
@@ -193,3 +222,34 @@
 {
 	return mText;
 }
+
+// -----------------------------------------------------------------------------
+// HbNotificationDialog::launchDialog
+// -----------------------------------------------------------------------------
+//
+void HbNotificationDialog::launchDialog(const QString &title, QGraphicsScene *scene)
+{
+    Q_UNUSED(scene);
+    testNotifDialogText = title;
+}
+
+// -----------------------------------------------------------------------------
+// HbStringUtil
+// -----------------------------------------------------------------------------
+//
+
+QString HbStringUtil::convertDigits( const QString str )
+{
+    // Normally this method converts to current locale digits but for testing purpose
+    // is enough to see just that some conversion occured.
+    return convertDigitsTo(str, WesternDigit);
+}
+
+QString HbStringUtil::convertDigitsTo( const QString str, const DigitType digitType )
+{
+    Q_UNUSED(digitType);
+    if ( testConversionEnabled && !str.isEmpty() ){
+        return ( QString("conv") + str );
+    }
+    return str;
+}