registerShortcut
[apps/homescreen.git] / homescreen / src / toucharea.cpp
diff --git a/homescreen/src/toucharea.cpp b/homescreen/src/toucharea.cpp
new file mode 100644 (file)
index 0000000..1cf4384
--- /dev/null
@@ -0,0 +1,36 @@
+#include "toucharea.h"
+#include "hmi-debug.h"
+
+TouchArea::TouchArea()
+{
+}
+
+TouchArea::~TouchArea()
+{
+
+}
+
+void TouchArea::setWindow(QQuickWindow *window)
+{
+    myWindow = window;
+}
+
+void TouchArea::init()
+{
+    bitmapNormal = QPixmap(":/images/AGL_HMI_Normal_Background.png").createHeuristicMask();
+    bitmapFullscreen = QPixmap(":/images/AGL_HMI_Full_Background.png").createHeuristicMask();
+    myWindow->setMask(QRegion(bitmapNormal));
+}
+
+void TouchArea::switchArea(int areaType)
+{
+    if(areaType == NORMAL) {
+        myWindow->setMask(QRegion(bitmapNormal));
+        HMI_DEBUG("HomeScreen","TouchArea switchArea: %d.", areaType);
+    } else if (areaType == FULLSCREEN) {
+        HMI_DEBUG("HomeScreen","TouchArea switchArea: %d.", areaType);
+        myWindow->setMask(QRegion(bitmapFullscreen));
+    }
+}
+
+