homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp
changeset 39 4e8ebe173323
parent 35 f9ce957a272c
child 46 23b5d6a29cce
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp	Fri Apr 16 14:54:01 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp	Mon May 03 12:24:59 2010 +0300
@@ -25,10 +25,41 @@
 #include <HbToolBar>
 #include <HbView>
 #include <HbWidget>
+#include <HbStaticVkbHost>
+#include <HbMainWindow>
+#include <HbInputMethod>
 
 #include "hsmenuviewbuilder.h"
 #include "hsmenustates_global.h"
 
+// TODO this class is temprary solution, proper one should come from Orbit
+class HsVkbHost : public HbStaticVkbHost {
+public:
+	explicit HsVkbHost(HbWidget *target):
+		HbStaticVkbHost(target), mWidget(target) {}
+
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT skipped: its very temporary TODO
+	void openFinished() {		
+		updateViewHeight(applicationArea().height());
+	}
+
+	void closeFinished(){				
+		updateViewHeight(-1);
+	}
+
+	void updateViewHeight(qreal height) {		
+		HbView* view = mWidget->mainWindow()->currentView();
+		view->setMaximumHeight(height);
+	}
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
+	
+	HbWidget * mWidget;
+};
+
 /*!
     \class HsMenuViewBuilder
     \ingroup group_hsmenustateplugin
@@ -72,12 +103,22 @@
         result = parseSection(mSections[mViewOptions]);
 
         if (visible) {
+			// TODO this is temprary solution, proper solution should come from Orbit
+                        if (!HbVkbHost::getVkbHost(searchPanel()))
+                                {
+                                new HsVkbHost(searchPanel());
+                                }
             HbLineEdit *const lineEdit(searchPanelLineEdit());
 
             lineEdit->setText("");
         }
+        else {
+           if (static_cast<HsVkbHost *>(HbVkbHost::getVkbHost(searchPanel()))) {
+             static_cast<HsVkbHost *>(HbVkbHost::getVkbHost(searchPanel()))->
+                     updateViewHeight(-1);
+            }
+       }
     }
-
     return result;
 }