summaryrefslogtreecommitdiffstats
path: root/hyperui
diff options
context:
space:
mode:
authorAdriano Rezende <adriano.rezende@openbossa.org>2009-10-27 11:18:35 -0300
committerAdriano Rezende <adriano.rezende@openbossa.org>2009-10-27 12:40:51 -0300
commit775e9418abad450a0a069497577489e55680d140 (patch)
treeb4aca2cd117cf6c1c5d6ed0e57977947744e55f8 /hyperui
parent2c58484742ae91424254c6a2c02874193011236d (diff)
Renamed project name from hiperui to hyperui
Diffstat (limited to 'hyperui')
-rw-r--r--hyperui/button.cpp118
-rw-r--r--hyperui/button.h73
-rw-r--r--hyperui/clockwidget.cpp218
-rw-r--r--hyperui/clockwidget.h84
-rw-r--r--hyperui/dialerwidget.cpp161
-rw-r--r--hyperui/dialerwidget.h73
-rw-r--r--hyperui/draggablepreview.cpp189
-rw-r--r--hyperui/draggablepreview.h93
-rw-r--r--hyperui/global.cpp67
-rw-r--r--hyperui/global.h52
-rw-r--r--hyperui/hyperui.pro41
-rw-r--r--hyperui/label.cpp112
-rw-r--r--hyperui/label.h64
-rw-r--r--hyperui/main.cpp74
-rw-r--r--hyperui/mainwindow.cpp122
-rw-r--r--hyperui/mainwindow.h64
-rw-r--r--hyperui/menuview.cpp96
-rw-r--r--hyperui/menuview.h49
-rw-r--r--hyperui/pagemenu.cpp82
-rw-r--r--hyperui/pagemenu.h60
-rw-r--r--hyperui/pageview.cpp307
-rw-r--r--hyperui/pageview.h87
-rw-r--r--hyperui/phoneview.cpp532
-rw-r--r--hyperui/phoneview.h78
-rw-r--r--hyperui/resource/640x360/hyperui.ini75
-rw-r--r--hyperui/resource/640x360/hyperui.qrc65
-rw-r--r--hyperui/resource/640x360/images/background.pngbin0 -> 173172 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/background.pngbin0 -> 2197 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/bottom_left_key.pngbin0 -> 1151 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/bottom_left_key_pressed.pngbin0 -> 1272 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/bottom_right_key.pngbin0 -> 1121 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/bottom_right_key_pressed.pngbin0 -> 1242 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/middle_key.pngbin0 -> 967 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/middle_key_pressed.pngbin0 -> 1034 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/top_left_key.pngbin0 -> 1107 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/top_left_key_pressed.pngbin0 -> 1227 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/top_right_key.pngbin0 -> 1161 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer/top_right_key_pressed.pngbin0 -> 1286 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bk_bottom.pngbin0 -> 1358 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bk_lineexpand.pngbin0 -> 157 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bk_top.pngbin0 -> 1221 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bt_call.pngbin0 -> 3045 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bt_call_over.pngbin0 -> 2978 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bt_contacts.pngbin0 -> 4169 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bt_dialer.pngbin0 -> 8107 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bt_endcall.pngbin0 -> 2771 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bt_endcall_over.pngbin0 -> 2715 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bt_mute.pngbin0 -> 7967 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bt_speaker.pngbin0 -> 7186 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_bullet_phone.pngbin0 -> 2017 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_display_background.pngbin0 -> 1854 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_display_bt_cancel.pngbin0 -> 1976 bytes
-rw-r--r--hyperui/resource/640x360/images/dialer_photo.pngbin0 -> 118676 bytes
-rw-r--r--hyperui/resource/640x360/images/idle_clock_pointer_hour.pngbin0 -> 560 bytes
-rw-r--r--hyperui/resource/640x360/images/idle_clock_pointer_minutes.pngbin0 -> 665 bytes
-rw-r--r--hyperui/resource/640x360/images/idle_clock_pointers_middle.pngbin0 -> 1177 bytes
-rw-r--r--hyperui/resource/640x360/images/idle_clock_structure.pngbin0 -> 79037 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_calendar.pngbin0 -> 8001 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_camera.pngbin0 -> 7990 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_chat.pngbin0 -> 7542 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_email.pngbin0 -> 7394 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_folder.pngbin0 -> 7261 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_games.pngbin0 -> 8076 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_music.pngbin0 -> 8263 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_navigation.pngbin0 -> 9991 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_phone.pngbin0 -> 7211 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_settings.pngbin0 -> 9038 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_twitter.pngbin0 -> 8626 bytes
-rw-r--r--hyperui/resource/640x360/images/menu_bt_web.pngbin0 -> 9269 bytes
-rwxr-xr-xhyperui/resource/640x360/images/screen_unlock.pngbin0 -> 190267 bytes
-rw-r--r--hyperui/resource/640x360/images/top_bar_active.pngbin0 -> 1514 bytes
-rw-r--r--hyperui/resource/640x360/images/top_bt_back.pngbin0 -> 1424 bytes
-rw-r--r--hyperui/resource/640x360/images/top_bt_back_disabled.pngbin0 -> 1093 bytes
-rw-r--r--hyperui/resource/640x360/images/top_bt_options.pngbin0 -> 1414 bytes
-rw-r--r--hyperui/resource/640x360/images/top_bt_options_disabled.pngbin0 -> 1101 bytes
-rw-r--r--hyperui/resource/864x480/hyperui.ini75
-rw-r--r--hyperui/resource/864x480/hyperui.qrc65
-rw-r--r--hyperui/resource/864x480/images/background.pngbin0 -> 293501 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/background.pngbin0 -> 2640 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/bottom_left_key.pngbin0 -> 1543 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/bottom_left_key_pressed.pngbin0 -> 1659 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/bottom_right_key.pngbin0 -> 1499 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/bottom_right_key_pressed.pngbin0 -> 1554 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/middle_key.pngbin0 -> 1383 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/middle_key_pressed.pngbin0 -> 1338 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/top_left_key.pngbin0 -> 1501 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/top_left_key_pressed.pngbin0 -> 1590 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/top_right_key.pngbin0 -> 1515 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer/top_right_key_pressed.pngbin0 -> 1561 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bk_bottom.pngbin0 -> 1352 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bk_lineexpand.pngbin0 -> 128 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bk_top.pngbin0 -> 1445 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bt_call.pngbin0 -> 4240 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bt_call_over.pngbin0 -> 4015 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bt_contacts.pngbin0 -> 5186 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bt_dialer.pngbin0 -> 8073 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bt_endcall.pngbin0 -> 3843 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bt_endcall_over.pngbin0 -> 3747 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bt_mute.pngbin0 -> 8473 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bt_speaker.pngbin0 -> 7480 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_bullet_phone.pngbin0 -> 2869 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_display_background.pngbin0 -> 2078 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_display_bt_cancel.pngbin0 -> 1992 bytes
-rw-r--r--hyperui/resource/864x480/images/dialer_photo.pngbin0 -> 205239 bytes
-rw-r--r--hyperui/resource/864x480/images/idle_clock_pointer_hour.pngbin0 -> 661 bytes
-rw-r--r--hyperui/resource/864x480/images/idle_clock_pointer_minutes.pngbin0 -> 761 bytes
-rw-r--r--hyperui/resource/864x480/images/idle_clock_pointers_middle.pngbin0 -> 1268 bytes
-rw-r--r--hyperui/resource/864x480/images/idle_clock_structure.pngbin0 -> 102537 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_calendar.pngbin0 -> 11512 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_camera.pngbin0 -> 11656 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_chat.pngbin0 -> 10839 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_email.pngbin0 -> 10853 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_folder.pngbin0 -> 10526 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_games.pngbin0 -> 11658 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_music.pngbin0 -> 12090 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_navigation.pngbin0 -> 14429 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_phone.pngbin0 -> 10637 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_settings.pngbin0 -> 12871 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_twitter.pngbin0 -> 12368 bytes
-rw-r--r--hyperui/resource/864x480/images/menu_bt_web.pngbin0 -> 12973 bytes
-rwxr-xr-xhyperui/resource/864x480/images/screen_unlock.pngbin0 -> 344220 bytes
-rw-r--r--hyperui/resource/864x480/images/top_bar_active.pngbin0 -> 1899 bytes
-rw-r--r--hyperui/resource/864x480/images/top_bt_back.pngbin0 -> 1425 bytes
-rw-r--r--hyperui/resource/864x480/images/top_bt_back_disabled.pngbin0 -> 1112 bytes
-rw-r--r--hyperui/resource/864x480/images/top_bt_options.pngbin0 -> 1450 bytes
-rw-r--r--hyperui/resource/864x480/images/top_bt_options_disabled.pngbin0 -> 1145 bytes
-rw-r--r--hyperui/view.cpp63
-rw-r--r--hyperui/view.h65
128 files changed, 3304 insertions, 0 deletions
diff --git a/hyperui/button.cpp b/hyperui/button.cpp
new file mode 100644
index 0000000..abc95f4
--- /dev/null
+++ b/hyperui/button.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QPainter>
+#include <QStyleOptionGraphicsItem>
+#include <QGraphicsSceneMouseEvent>
+
+#include "global.h"
+#include "button.h"
+
+
+Button::Button(const QPixmap &normal, const QPixmap &pressed,
+ const QPixmap &disabled, QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_isPressed(false),
+ m_normalPixmap(normal),
+ m_pressedPixmap(pressed),
+ m_disabledPixmap(disabled)
+{
+ setMinimumSize(normal.size());
+ setMaximumSize(normal.size());
+
+ QFont font(Resource::stringValue("default/font-family"));
+ font.setBold(true);
+ font.setPixelSize(Resource::intValue("button/font-size"));
+ setFont(font);
+}
+
+QString Button::text() const
+{
+ return m_text;
+}
+
+void Button::setText(const QString &value)
+{
+ if (m_text != value) {
+ m_text = value;
+ update();
+ }
+}
+
+void Button::mousePressEvent(QGraphicsSceneMouseEvent *e)
+{
+ if (e->button() == Qt::LeftButton) {
+ m_isPressed = true;
+ update();
+ emit pressed();
+ }
+}
+
+void Button::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
+{
+ if (e->button() == Qt::LeftButton) {
+ const bool isClick = m_isPressed;
+
+ m_isPressed = false;
+ update();
+ emit released();
+
+ if (isClick && contains(e->pos()))
+ emit clicked();
+ }
+}
+
+void Button::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+{
+ Q_UNUSED(widget);
+
+ if (!(option->state & QStyle::State_Enabled)) {
+ const bool support = !m_disabledPixmap.isNull();
+ painter->drawPixmap(0, 0, support ? m_disabledPixmap : m_normalPixmap);
+ } else if (m_isPressed && !m_pressedPixmap.isNull())
+ painter->drawPixmap(0, 0, m_pressedPixmap);
+ else
+ painter->drawPixmap(0, 0, m_normalPixmap);
+
+
+ if (!m_text.isEmpty()) {
+ const QRect &textRect = boundingRect().toRect();
+
+ QFontMetrics metrics(font());
+ const QString &elidedText = metrics.elidedText(m_text, Qt::ElideRight,
+ textRect.width());
+
+ painter->setFont(font());
+ painter->setPen(Qt::white);
+ painter->drawText(textRect, Qt::TextSingleLine | Qt::AlignCenter, elidedText);
+ }
+}
diff --git a/hyperui/button.h b/hyperui/button.h
new file mode 100644
index 0000000..f857636
--- /dev/null
+++ b/hyperui/button.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BUTTON_H
+#define BUTTON_H
+
+#include <QPixmap>
+#include <QGraphicsWidget>
+
+QT_BEGIN_NAMESPACE
+class QGraphicsSceneMouseEvent;
+QT_END_NAMESPACE
+
+
+class Button : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ Button(const QPixmap &normal, const QPixmap &pressed = QPixmap(),
+ const QPixmap &disabled = QPixmap(), QGraphicsItem *parent = 0);
+
+ QString text() const;
+ void setText(const QString &value);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+signals:
+ void clicked();
+ void pressed();
+ void released();
+
+protected:
+ QString m_text;
+ bool m_isPressed;
+ QPixmap m_normalPixmap;
+ QPixmap m_pressedPixmap;
+ QPixmap m_disabledPixmap;
+
+ void mousePressEvent(QGraphicsSceneMouseEvent *e);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *e);
+};
+
+#endif
diff --git a/hyperui/clockwidget.cpp b/hyperui/clockwidget.cpp
new file mode 100644
index 0000000..f6c2283
--- /dev/null
+++ b/hyperui/clockwidget.cpp
@@ -0,0 +1,218 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QPainter>
+#include <QDateTime>
+#include <QRadialGradient>
+
+#include "global.h"
+#include "clockwidget.h"
+
+
+class ClockEvent
+{
+public:
+ ClockEvent(const QDateTime &begin, const QDateTime &end, const QColor &color)
+ : begin(begin), end(end), color(color) { }
+
+ QDateTime begin;
+ QDateTime end;
+ QColor color;
+};
+
+
+ClockWidget::ClockWidget(QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_background(Resource::pixmap("idle_clock_structure.png")),
+ m_middleKnob(Resource::pixmap("idle_clock_pointers_middle.png")),
+ m_hourPointer(Resource::pixmap("idle_clock_pointer_hour.png")),
+ m_minutePointer(Resource::pixmap("idle_clock_pointer_minutes.png"))
+{
+ QFont defaultFont(Resource::stringValue("default/font-family"));
+ m_fontColor = QColor(Resource::stringValue("clock-widget/font-color"));
+
+ m_dayFont = defaultFont;
+ m_dayFont.setBold(true);
+ m_dayFont.setPixelSize(Resource::intValue("clock-widget/day-font-size"));
+
+ m_weekDayFont = defaultFont;
+ m_weekDayFont.setPixelSize(Resource::intValue("clock-widget/wday-font-size"));
+
+ m_knobPoint = Resource::value("clock-widget/knob-pos").toPoint();
+ m_middlePoint = Resource::value("clock-widget/middle-pos").toPoint();
+ m_dayRect = Resource::value("clock-widget/day-label-rect").toRect();
+ m_weekDayRect = Resource::value("clock-widget/wday-label-rect").toRect();
+ m_eventsPixmapRect = Resource::value("clock-widget/events-pixmap-rect").toRect();
+ m_eventsInnerOffset = Resource::intValue("clock-widget/events-inner-offset");
+ m_eventsInnerDiameter = Resource::intValue("clock-widget/events-inner-diameter");
+
+ setMinimumSize(m_background.size());
+ setMaximumSize(m_background.size());
+
+ connect(&m_timer, SIGNAL(timeout()), SLOT(updateTime()));
+ m_timer.start(Resource::intValue("clock-widget/update-timeout"));
+
+ m_eventsPixmap = QPixmap(m_eventsPixmapRect.size());
+}
+
+ClockWidget::~ClockWidget()
+{
+ qDeleteAll(m_events);
+}
+
+void ClockWidget::addEvent(const QDateTime &begin, const QDateTime &end,
+ const QColor &color)
+{
+ m_events.append(new ClockEvent(begin, end, color));
+ updateEvents();
+ update();
+}
+
+void ClockWidget::updateTime()
+{
+ update();
+}
+
+void ClockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+{
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+
+ // store and adjust render hints
+ const QPainter::RenderHints hints = painter->renderHints();
+ painter->setRenderHints(hints | QPainter::SmoothPixmapTransform);
+
+ // draw clock base pixmap
+ painter->drawPixmap(0, 0, m_background);
+
+ // draw day information
+ const QDateTime &dateTime = QDateTime::currentDateTime();
+ painter->setPen(m_fontColor);
+ painter->setFont(m_dayFont);
+ painter->drawText(m_dayRect, Qt::AlignHCenter | Qt::AlignVCenter,
+ dateTime.toString("dd"));
+ painter->setFont(m_weekDayFont);
+ painter->drawText(m_weekDayRect, Qt::AlignHCenter | Qt::AlignVCenter,
+ dateTime.toString("ddd").toUpper());
+
+ painter->drawPixmap(m_eventsPixmapRect.x(), m_eventsPixmapRect.y(),
+ m_eventsPixmap);
+
+ // calculate min/hour pointer angles
+ const QTime &time = dateTime.time();
+ const int hourAngle = 180 + qRound(30.0 * (time.hour() + time.minute() / 60.0));
+ const int minuteAngle = 180 + qRound(6.0 * (time.minute() + time.second() / 60.0));
+
+ // paint minute pointer
+ painter->save();
+ painter->translate(m_middlePoint);
+ painter->rotate(minuteAngle);
+ painter->drawPixmap(-m_minutePointer.width() / 2, 0, m_minutePointer);
+ painter->restore();
+
+ // paint hour pointer
+ painter->save();
+ painter->translate(m_middlePoint);
+ painter->rotate(hourAngle);
+ painter->drawPixmap(-m_hourPointer.width() / 2, 0, m_hourPointer);
+ painter->restore();
+
+ // paint middle knob
+ painter->drawPixmap(m_knobPoint, m_middleKnob);
+
+ // restore render hints
+ painter->setRenderHints(hints);
+}
+
+
+void ClockWidget::updateEvents()
+{
+ // clear the cache
+ m_eventsPixmap.fill(Qt::transparent);
+
+ QPainter painter(&m_eventsPixmap);
+ painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
+
+ painter.setOpacity(0.9);
+ painter.setPen(Qt::NoPen);
+
+ const int inner = m_eventsInnerOffset;
+ const int diameter = m_eventsInnerDiameter;
+
+ foreach (ClockEvent *event, m_events) {
+ painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
+
+ // calculate start angle
+ const QTime &ta = event->begin.time();
+ int ia = qRound(30.0 * (ta.hour() + ta.minute() / 60.0));
+
+ // calculate end angle
+ const QTime &tb = event->end.time();
+ int ib = qRound(30.0 * (tb.hour() + tb.minute() / 60.0)) - ia;
+
+ // drawPie parameters must be specified in 1/16th of a degree
+ // and it's counter-clockwise. so we must adjust to the right values.
+ ia = ia * -16 + 90 * 16;
+ ib = ib * -16;
+
+ // draw the event pie
+ painter.setBrush(event->color);
+ painter.drawPie(0, 0, diameter, diameter, ia, ib);
+
+ // draw some gradients to simulate light effects
+ QRadialGradient gradient(diameter / 2, diameter / 2, diameter / 2 - 35);
+ gradient.setColorAt(0.9, QColor::fromRgbF(1, 1, 1, 0.5));
+ gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0.0));
+ painter.setBrush(gradient);
+ painter.drawPie(0, 0, diameter, diameter, ia, ib);
+
+ QRadialGradient gradient2(diameter / 2, diameter / 2, diameter / 2);
+ gradient2.setColorAt(0.98, QColor::fromRgbF(0, 0, 0, 0.0));
+ gradient2.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0.5));
+ painter.setBrush(gradient2);
+ painter.drawPie(0, 0, diameter, diameter, ia, ib);
+
+ QRadialGradient gradient3(diameter / 2, diameter / 2, diameter / 2);
+ gradient3.setColorAt(0, QColor::fromRgbF(1, 1, 1, 0.4));
+ gradient3.setColorAt(1, QColor::fromRgbF(1, 1, 1, 0.0));
+
+ gradient3.setFocalPoint(100, 100);
+ painter.setBrush(gradient3);
+ painter.drawPie(0, 0, diameter, diameter, ia, ib);
+ }
+
+ // clear the middle of the pies
+ painter.setBrush(Qt::transparent);
+ painter.setCompositionMode(QPainter::CompositionMode_Clear);
+ painter.drawPie(inner, inner, diameter - inner * 2,
+ diameter - inner * 2, 0, 360 * 16);
+}
diff --git a/hyperui/clockwidget.h b/hyperui/clockwidget.h
new file mode 100644
index 0000000..e076707
--- /dev/null
+++ b/hyperui/clockwidget.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CLOCKWIDGET_H
+#define CLOCKWIDGET_H
+
+#include <QFont>
+#include <QTimer>
+#include <QPixmap>
+#include <QGraphicsWidget>
+
+class ClockEvent;
+
+
+class ClockWidget : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ ClockWidget(QGraphicsItem *parent = 0);
+ ~ClockWidget();
+
+ void addEvent(const QDateTime &begin, const QDateTime &end,
+ const QColor &color);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+private slots:
+ void updateTime();
+ void updateEvents();
+
+private:
+ QFont m_dayFont;
+ QFont m_weekDayFont;
+ QColor m_fontColor;
+ QPixmap m_background;
+
+ QTimer m_timer;
+ QPoint m_knobPoint;
+ QPoint m_middlePoint;
+ QRectF m_dayRect;
+ QRectF m_weekDayRect;
+ QRect m_eventsPixmapRect;
+ int m_eventsInnerOffset;
+ int m_eventsInnerDiameter;
+
+ QPixmap m_middleKnob;
+ QPixmap m_hourPointer;
+ QPixmap m_minutePointer;
+
+ QPixmap m_eventsPixmap;
+ QList<ClockEvent *> m_events;
+};
+
+#endif
diff --git a/hyperui/dialerwidget.cpp b/hyperui/dialerwidget.cpp
new file mode 100644
index 0000000..99291c9
--- /dev/null
+++ b/hyperui/dialerwidget.cpp
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGraphicsGridLayout>
+#include <QGraphicsPixmapItem>
+
+#include "global.h"
+#include "dialerwidget.h"
+#include "button.h"
+
+#define MAX_ROWS 4
+#define MAX_COLUMNS 3
+
+
+DialerWidget::DialerWidget(QGraphicsItem *parent)
+ : QGraphicsWidget(parent)
+{
+ QGraphicsPixmapItem *background =
+ new QGraphicsPixmapItem(Resource::pixmap("dialer/background.png"), this);
+ background->setPos(0, 0);
+ background->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
+
+ const int margin = Resource::intValue("dialer-widget/margin");
+ const int spacing = Resource::intValue("dialer-widget/spacing");
+
+ m_layout = new QGraphicsGridLayout();
+ m_layout->setSpacing(spacing);
+ m_layout->setContentsMargins(margin, margin, margin, margin);
+
+ addButton("1", 0, 0, SLOT(oneClicked()));
+ addButton("2", 0, 1, SLOT(twoClicked()));
+ addButton("3", 0, 2, SLOT(threeClicked()));
+ addButton("4", 1, 0, SLOT(fourClicked()));
+ addButton("5", 1, 1, SLOT(fiveClicked()));
+ addButton("6", 1, 2, SLOT(sixClicked()));
+ addButton("7", 2, 0, SLOT(sevenClicked()));
+ addButton("8", 2, 1, SLOT(eightClicked()));
+ addButton("9", 2, 2, SLOT(nineClicked()));
+ addButton("*", 3, 0, SLOT(starClicked()));
+ addButton("0", 3, 1, SLOT(zeroClicked()));
+ addButton("#", 3, 2, SLOT(hashClicked()));
+
+ setLayout(m_layout);
+}
+
+void DialerWidget::addButton(const QString &label, int row, int col, const char *slot)
+{
+ QPixmap normalPixmap;
+ QPixmap pressedPixmap;
+
+ if (row == 0 && col == 0) {
+ normalPixmap = Resource::pixmap("dialer/top_left_key.png");
+ pressedPixmap = Resource::pixmap("dialer/top_left_key_pressed.png");
+ } else if (row == 0 && col == MAX_COLUMNS - 1) {
+ normalPixmap = Resource::pixmap("dialer/top_right_key.png");
+ pressedPixmap = Resource::pixmap("dialer/top_right_key_pressed.png");
+ } else if (row == MAX_ROWS - 1 && col == 0) {
+ normalPixmap = Resource::pixmap("dialer/bottom_left_key.png");
+ pressedPixmap = Resource::pixmap("dialer/bottom_left_key_pressed.png");
+ } else if (row == MAX_ROWS - 1 && col == MAX_COLUMNS - 1) {
+ normalPixmap = Resource::pixmap("dialer/bottom_right_key.png");
+ pressedPixmap = Resource::pixmap("dialer/bottom_right_key_pressed.png");
+ } else {
+ normalPixmap = Resource::pixmap("dialer/middle_key.png");
+ pressedPixmap = Resource::pixmap("dialer/middle_key_pressed.png");
+ }
+
+ Button *button = new Button(normalPixmap, pressedPixmap);
+ button->setText(label);
+ connect(button, SIGNAL(clicked()), slot);
+
+ m_layout->addItem(button, row, col);
+}
+
+void DialerWidget::oneClicked()
+{
+ emit buttonClicked("1");
+}
+
+void DialerWidget::twoClicked()
+{
+ emit buttonClicked("2");
+}
+
+void DialerWidget::threeClicked()
+{
+ emit buttonClicked("3");
+}
+
+void DialerWidget::fourClicked()
+{
+ emit buttonClicked("4");
+}
+
+void DialerWidget::fiveClicked()
+{
+ emit buttonClicked("5");
+}
+
+void DialerWidget::sixClicked()
+{
+ emit buttonClicked("6");
+}
+
+void DialerWidget::sevenClicked()
+{
+ emit buttonClicked("7");
+}
+
+void DialerWidget::eightClicked()
+{
+ emit buttonClicked("8");
+}
+
+void DialerWidget::nineClicked()
+{
+ emit buttonClicked("9");
+}
+
+void DialerWidget::starClicked()
+{
+ emit buttonClicked("*");
+}
+
+void DialerWidget::zeroClicked()
+{
+ emit buttonClicked("0");
+}
+
+void DialerWidget::hashClicked()
+{
+ emit buttonClicked("#");
+}
diff --git a/hyperui/dialerwidget.h b/hyperui/dialerwidget.h
new file mode 100644
index 0000000..a237668
--- /dev/null
+++ b/hyperui/dialerwidget.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DIALERWIDGET_H
+#define DIALERWIDGET_H
+
+#include <QGraphicsWidget>
+
+QT_BEGIN_NAMESPACE
+class QGraphicsGridLayout;
+QT_END_NAMESPACE
+
+
+class DialerWidget : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ DialerWidget(QGraphicsItem *parent = 0);
+
+signals:
+ void buttonClicked(const QString &value);
+
+protected:
+ void addButton(const QString &label, int row, int col, const char *slot);
+
+private slots:
+ void oneClicked();
+ void twoClicked();
+ void threeClicked();
+ void fourClicked();
+ void fiveClicked();
+ void sixClicked();
+ void sevenClicked();
+ void eightClicked();
+ void nineClicked();
+ void starClicked();
+ void zeroClicked();
+ void hashClicked();
+
+private:
+ QGraphicsGridLayout *m_layout;
+};
+
+#endif
diff --git a/hyperui/draggablepreview.cpp b/hyperui/draggablepreview.cpp
new file mode 100644
index 0000000..c8d22fa
--- /dev/null
+++ b/hyperui/draggablepreview.cpp
@@ -0,0 +1,189 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QPropertyAnimation>
+#include <QParallelAnimationGroup>
+#include <QGraphicsSceneMouseEvent>
+
+#include "global.h"
+#include "draggablepreview.h"
+
+
+DraggablePreview::DraggablePreview(QGraphicsWidget *item, const QSize &screenSize,
+ QGraphicsItem *parent)
+ : QGraphicsWidget(parent), m_screenSize(screenSize),
+ m_isMaximizeAnimation(false), m_item(item)
+{
+ readSettings();
+ setupInterface();
+
+ m_animation = new QParallelAnimationGroup(this);
+ connect(m_animation, SIGNAL(finished()), SLOT(animationFinished()));
+}
+
+void DraggablePreview::readSettings()
+{
+ m_border = Resource::intValue("draggable-preview/border");
+ m_topMargin = Resource::intValue("draggable-preview/margin-top");
+ m_leftMargin = Resource::intValue("draggable-preview/margin-left");
+ m_restoreTime = Resource::intValue("draggable-preview/restore-time");
+ m_maximizeTime = Resource::intValue("draggable-preview/maximize-time");
+ m_minimumScale = Resource::doubleValue("draggable-preview/minimum-scale");
+ m_maximizeThreshold = Resource::doubleValue("draggable-preview/maximize-threshold");
+}
+
+void DraggablePreview::setupInterface()
+{
+ setFlag(QGraphicsItem::ItemHasNoContents);
+
+ // add background item
+ QPixmap backgroundPixmap = Resource::pixmap("screen_unlock.png");
+ m_background = new QGraphicsPixmapItem(backgroundPixmap, this);
+ m_background->setPos(0, 0);
+ m_background->setFlag(QGraphicsItem::ItemStacksBehindParent);
+ m_background->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
+
+ // add embedded widget
+ m_item->setParentItem(this);
+ m_item->setFlag(QGraphicsItem::ItemStacksBehindParent);
+ m_item->setPos(m_leftMargin + m_border, m_topMargin + m_border);
+ m_item->resize(m_screenSize);
+
+ // resize to the background size
+ resize(backgroundPixmap.size());
+
+ // scale and position
+ const int sw = m_screenSize.width();
+ const int sh = m_screenSize.height();
+ const int scaledHeight = (sh + m_topMargin) * m_minimumScale * 0.5;
+
+ scale(m_minimumScale, m_minimumScale);
+ setPos(qRound(sw / 2.0 - (sw / 2.0 + m_leftMargin) * m_minimumScale),
+ qRound(sh - scaledHeight));
+
+ m_minimumOffset = sh / 2 - scaledHeight;
+ m_maximumOffset = pos().y();
+}
+
+bool DraggablePreview::isAnimating() const
+{
+ return (m_animation->state() == QAbstractAnimation::Running);
+}
+
+void DraggablePreview::animateRestore()
+{
+ m_animation->clearAnimations();
+
+ m_isMaximizeAnimation = false;
+
+ QPointF finalPos(pos().x(), m_maximumOffset);
+ m_animation->addAnimation(createMoveAnimation(finalPos, m_restoreTime));
+ m_animation->start();
+}
+
+void DraggablePreview::animateMaximize()
+{
+ m_animation->clearAnimations();
+
+ m_isMaximizeAnimation = true;
+
+ qreal finalScale = 1.0 / m_minimumScale;
+ QPointF finalPos(-m_leftMargin - m_border, -m_topMargin - m_border);
+ m_animation->addAnimation(createMoveAnimation(finalPos, m_maximizeTime));
+ m_animation->addAnimation(createScaleAnimation(finalScale, m_maximizeTime));
+ m_animation->start();
+}
+
+QAbstractAnimation *DraggablePreview::createScaleAnimation(qreal scale, int time)
+{
+ QPropertyAnimation *animation = new QPropertyAnimation(this, "scale");
+ animation->setDuration(time);
+ animation->setEasingCurve(QEasingCurve::OutQuad);
+ animation->setStartValue(1.0);
+ animation->setEndValue(scale);
+ return animation;
+}
+
+QAbstractAnimation *DraggablePreview::createMoveAnimation(const QPointF &to, int time)
+{
+ QPropertyAnimation *animation = new QPropertyAnimation(this, "pos");
+ animation->setDuration(time);
+ animation->setEasingCurve(QEasingCurve::OutQuad);
+ animation->setStartValue(pos());
+ animation->setEndValue(to);
+ return animation;
+}
+
+void DraggablePreview::animationFinished()
+{
+ if (m_isMaximizeAnimation) {
+ // hide background
+ m_background->hide();
+ // move menu to front to not block events
+ m_item->setFlag(QGraphicsItem::ItemStacksBehindParent, false);
+
+ emit maximizeFinished();
+
+ // detach from parent to avoid inherit transformations
+ m_item->setParentItem(0);
+ m_item->setPos(0, 0);
+ }
+}
+
+void DraggablePreview::mousePressEvent(QGraphicsSceneMouseEvent *e)
+{
+ if (isAnimating())
+ return;
+
+ m_lastPos = e->scenePos();
+}
+
+void DraggablePreview::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
+{
+ if (isAnimating())
+ return;
+
+ const int offset = qRound(pos().y() + e->scenePos().y() - m_lastPos.y());
+
+ m_lastPos = e->scenePos();
+ setPos(pos().x(), qBound(m_minimumOffset, offset, m_maximumOffset));
+}
+
+void DraggablePreview::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
+{
+ if (isAnimating())
+ return;
+
+ if (pos().y() < m_minimumOffset + m_maximizeThreshold)
+ animateMaximize();
+ else
+ animateRestore();
+}
diff --git a/hyperui/draggablepreview.h b/hyperui/draggablepreview.h
new file mode 100644
index 0000000..69e46e9
--- /dev/null
+++ b/hyperui/draggablepreview.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DRAGGABLEPREVIEW_H
+#define DRAGGABLEPREVIEW_H
+
+#include <QGraphicsWidget>
+
+QT_BEGIN_NAMESPACE
+class QAbstractAnimation;
+class QParallelAnimationGroup;
+QT_END_NAMESPACE
+
+
+class DraggablePreview : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ DraggablePreview(QGraphicsWidget *item, const QSize &screenSize,
+ QGraphicsItem *parent = 0);
+
+ bool isAnimating() const;
+
+signals:
+ void maximizeFinished();
+
+private slots:
+ void animationFinished();
+
+private:
+ void readSettings();
+ void setupInterface();
+
+ void animateRestore();
+ void animateMaximize();
+
+ void mousePressEvent(QGraphicsSceneMouseEvent *e);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *e);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *e);
+
+ QAbstractAnimation *createScaleAnimation(qreal scale, int time);
+ QAbstractAnimation *createMoveAnimation(const QPointF &to, int time);
+
+ QPointF m_lastPos;
+ QSize m_screenSize;
+ int m_minimumOffset;
+ int m_maximumOffset;
+
+ int m_border;
+ int m_topMargin;
+ int m_leftMargin;
+ int m_restoreTime;
+ int m_maximizeTime;
+ qreal m_minimumScale;
+ int m_maximizeThreshold;
+ bool m_isMaximizeAnimation;
+
+ QGraphicsWidget *m_item;
+ QGraphicsPixmapItem *m_background;
+ QParallelAnimationGroup *m_animation;
+};
+
+
+#endif
diff --git a/hyperui/global.cpp b/hyperui/global.cpp
new file mode 100644
index 0000000..f8a49f0
--- /dev/null
+++ b/hyperui/global.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QSettings>
+
+#include "global.h"
+
+
+QPixmap Resource::pixmap(const QString &path)
+{
+ return QPixmap(QString(":/images/%1").arg(path));
+}
+
+QVariant Resource::value(const QString &key, const QVariant &value)
+{
+ static QSettings settings(":hyperui.ini", QSettings::IniFormat);
+
+ if (settings.contains(key))
+ return settings.value(key, value);
+ else {
+ qWarning("Resource: key '%s' not found", key.toLatin1().data());
+ return QVariant();
+ }
+}
+
+int Resource::intValue(const QString &key, int value)
+{
+ return Resource::value(key, value).toInt();
+}
+
+double Resource::doubleValue(const QString &key, double value)
+{
+ return Resource::value(key, value).toDouble();
+}
+
+QString Resource::stringValue(const QString &key, const QString &value)
+{
+ return Resource::value(key, value).toString();
+}
diff --git a/hyperui/global.h b/hyperui/global.h
new file mode 100644
index 0000000..9315cb2
--- /dev/null
+++ b/hyperui/global.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GLOBAL_H
+#define GLOBAL_H
+
+#include <QString>
+#include <QPixmap>
+#include <QVariant>
+
+
+class Resource
+{
+public:
+ static QPixmap pixmap(const QString &path);
+
+ static QVariant value(const QString &key, const QVariant &value = QVariant());
+
+ static int intValue(const QString &key, int value = 0);
+ static double doubleValue(const QString &key, double value = 0);
+ static QString stringValue(const QString &key, const QString &value = QString());
+};
+
+#endif
diff --git a/hyperui/hyperui.pro b/hyperui/hyperui.pro
new file mode 100644
index 0000000..336ab05
--- /dev/null
+++ b/hyperui/hyperui.pro
@@ -0,0 +1,41 @@
+TEMPLATE = app
+TARGET = hyperui
+DEPENDPATH += .
+INCLUDEPATH += .
+
+symbian {
+ LIBS += -lconnmon -lcone -lavkon
+}
+
+HEADERS += mainwindow.h \
+ button.h \
+ global.h \
+ pagemenu.h \
+ view.h \
+ pageview.h \
+ menuview.h \
+ phoneview.h \
+ dialerwidget.h \
+ label.h \
+ draggablepreview.h \
+ clockwidget.h
+
+SOURCES += main.cpp \
+ mainwindow.cpp \
+ button.cpp \
+ global.cpp \
+ pagemenu.cpp \
+ view.cpp \
+ pageview.cpp \
+ menuview.cpp \
+ phoneview.cpp \
+ dialerwidget.cpp \
+ label.cpp \
+ draggablepreview.cpp \
+ clockwidget.cpp
+
+isEmpty(RESOLUTION) {
+ RESOLUTION = "640x360"
+}
+
+RESOURCES = resource/$$RESOLUTION/hyperui.qrc
diff --git a/hyperui/label.cpp b/hyperui/label.cpp
new file mode 100644
index 0000000..14c9fbc
--- /dev/null
+++ b/hyperui/label.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QPainter>
+
+#include "global.h"
+#include "label.h"
+
+
+Label::Label(QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_fontColor(Qt::white),
+ m_alignment(Qt::AlignLeft),
+ m_elideMode(Qt::ElideRight)
+{
+ setFont(QFont(Resource::stringValue("default/font-family")));
+}
+
+QString Label::text() const
+{
+ return m_text;
+}
+
+void Label::setText(const QString &value)
+{
+ if (m_text != value) {
+ m_text = value;
+ update();
+ }
+}
+
+QColor Label::fontColor() const
+{
+ return m_fontColor;
+}
+
+void Label::setFontColor(const QColor &color)
+{
+ if (m_fontColor != color) {
+ m_fontColor = color;
+ update();
+ }
+}
+
+Qt::TextElideMode Label::elideMode() const
+{
+ return m_elideMode;
+}
+
+void Label::setElideMode(Qt::TextElideMode mode)
+{
+ if (m_elideMode != mode) {
+ m_elideMode = mode;
+ update();
+ }
+}
+
+void Label::setAlignment(Qt::Alignment alignment)
+{
+ if (m_alignment != alignment) {
+ m_alignment = alignment;
+ update();
+ }
+}
+
+void Label::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+{
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+
+ if (m_text.isEmpty())
+ return;
+
+ const QRect &textRect = boundingRect().toRect();
+
+ QFontMetrics metrics(font());
+ const QString &elidedText = metrics.elidedText(m_text, m_elideMode,
+ textRect.width());
+
+ painter->setFont(font());
+ painter->setPen(m_fontColor);
+ painter->drawText(textRect, Qt::TextSingleLine | m_alignment, elidedText);
+}
diff --git a/hyperui/label.h b/hyperui/label.h
new file mode 100644
index 0000000..e568797
--- /dev/null
+++ b/hyperui/label.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LABEL_H
+#define LABEL_H
+
+#include <QGraphicsWidget>
+
+
+class Label : public QGraphicsWidget
+{
+public:
+ Label(QGraphicsItem *parent = 0);
+
+ QString text() const;
+ void setText(const QString &value);
+
+ QColor fontColor() const;
+ void setFontColor(const QColor &color);
+
+ Qt::TextElideMode elideMode() const;
+ void setElideMode(Qt::TextElideMode mode);
+
+ void setAlignment(Qt::Alignment alignment);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+private:
+ QString m_text;
+ QColor m_fontColor;
+ Qt::Alignment m_alignment;
+ Qt::TextElideMode m_elideMode;
+};
+
+#endif
diff --git a/hyperui/main.cpp b/hyperui/main.cpp
new file mode 100644
index 0000000..b54a6b9
--- /dev/null
+++ b/hyperui/main.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QGraphicsScene>
+#include <QGraphicsView>
+
+#include "global.h"
+#include "mainwindow.h"
+
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ const int width = Resource::intValue("window/width");
+ const int height = Resource::intValue("window/height");
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+
+ view.setWindowTitle(QObject::tr("Hiper UI"));
+ view.setFrameShape(QFrame::NoFrame);
+ view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
+
+ view.resize(width, height);
+ scene.setSceneRect(0, 0, width, height);
+
+ view.setBackgroundBrush(Resource::pixmap("background.png"));
+ view.setCacheMode(QGraphicsView::CacheBackground);
+
+ MainWindow mainWindow;
+ scene.addItem(&mainWindow);
+ mainWindow.setGeometry(0, 0, width, height);
+
+#ifdef Q_OS_SYMBIAN
+ view.showFullScreen();
+#else
+ view.setFixedSize(width, height);
+ view.show();
+#endif
+
+ return app.exec();
+}
diff --git a/hyperui/mainwindow.cpp b/hyperui/mainwindow.cpp
new file mode 100644
index 0000000..4f48fe3
--- /dev/null
+++ b/hyperui/mainwindow.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDateTime>
+
+#include "global.h"
+#include "mainwindow.h"
+#include "pageview.h"
+#include "menuview.h"
+#include "clockwidget.h"
+#include "draggablepreview.h"
+
+#ifdef Q_OS_SYMBIAN
+#include <eikenv.h>
+#include <coemain.h>
+#include <aknappui.h>
+#endif
+
+
+MainWindow::MainWindow(QGraphicsItem *parent)
+ : QGraphicsWidget(parent)
+{
+ setFlag(QGraphicsItem::ItemHasNoContents);
+
+ m_clockWidget = new ClockWidget(this);
+ m_clockWidget->setPos(0, 0);
+
+ // cache the clock into a pixmap to improve drag performance
+ m_clockWidget->setCacheMode(QGraphicsItem::ItemCoordinateCache);
+
+ const int width = Resource::intValue("window/width");
+ const int height = Resource::intValue("window/height");
+
+ m_mainView = new PageView();
+ m_mainView->add(new MenuView());
+ m_preview = new DraggablePreview(m_mainView, QSize(width, height), this);
+ connect(m_preview, SIGNAL(maximizeFinished()), SLOT(onMaximizeFinished()));
+
+ createDummyDailyEvents();
+
+#ifdef Q_OS_SYMBIAN
+ // The line below is necessary, since CAknAppUi object is only
+ // available in the main loop.
+ QTimer::singleShot(0, this, SLOT(lockPortraitMode()));
+#endif
+}
+
+void MainWindow::onMaximizeFinished()
+{
+ m_clockWidget->hide();
+}
+
+void MainWindow::createDummyDailyEvents()
+{
+ QColor color1("#80A2BF");
+ QColor color2("#FF5E74");
+ QColor color3("#A05284");
+
+ const QDate &cd = QDate::currentDate();
+
+ m_clockWidget->addEvent(QDateTime(cd, QTime(3, 20, 0)),
+ QDateTime(cd, QTime(4, 30, 0)), color1);
+ m_clockWidget->addEvent(QDateTime(cd, QTime(4, 34, 0)),
+ QDateTime(cd, QTime(5, 15, 0)), color1);
+ m_clockWidget->addEvent(QDateTime(cd, QTime(5, 19, 0)),
+ QDateTime(cd, QTime(6, 17, 0)), color1);
+ m_clockWidget->addEvent(QDateTime(cd, QTime(6, 25, 0)),
+ QDateTime(cd, QTime(6, 53, 0)), color1);
+
+ m_clockWidget->addEvent(QDateTime(cd, QTime(7, 55, 0)),
+ QDateTime(cd, QTime(8, 45, 0)), color2);
+ m_clockWidget->addEvent(QDateTime(cd, QTime(9, 25, 0)),
+ QDateTime(cd, QTime(10, 20, 0)), color2);
+
+ m_clockWidget->addEvent(QDateTime(cd, QTime(6, 40, 0)),
+ QDateTime(cd, QTime(7, 20, 0)), color3);
+ m_clockWidget->addEvent(QDateTime(cd, QTime(7, 24, 0)),
+ QDateTime(cd, QTime(8, 20, 0)), color3);
+}
+
+/*!
+ Lock the screen in portrait mode.
+
+ \todo Add support to maemo portrait mode.
+*/
+#ifdef Q_OS_SYMBIAN
+void MainWindow::lockPortraitMode()
+{
+ CAknAppUi *aknAppUi = dynamic_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi());
+
+ if (aknAppUi)
+ aknAppUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
+}
+#endif
diff --git a/hyperui/mainwindow.h b/hyperui/mainwindow.h
new file mode 100644
index 0000000..aae91b1
--- /dev/null
+++ b/hyperui/mainwindow.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QGraphicsWidget>
+
+class PageView;
+class ClockWidget;
+class DraggablePreview;
+
+
+class MainWindow : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QGraphicsItem *parent = 0);
+
+private slots:
+ void onMaximizeFinished();
+
+#ifdef Q_OS_SYMBIAN
+ void lockPortraitMode();
+#endif
+
+private:
+ void createDummyDailyEvents();
+
+ PageView *m_mainView;
+ ClockWidget *m_clockWidget;
+ DraggablePreview *m_preview;
+};
+
+#endif
diff --git a/hyperui/menuview.cpp b/hyperui/menuview.cpp
new file mode 100644
index 0000000..9ed83dc
--- /dev/null
+++ b/hyperui/menuview.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGraphicsGridLayout>
+
+#include "global.h"
+#include "button.h"
+#include "menuview.h"
+#include "phoneview.h"
+
+
+MenuView::MenuView(QGraphicsItem *parent)
+ : View(parent)
+{
+ setTitle(tr("MENU"));
+
+ // read settings
+ const int topMargin = Resource::intValue("menu-view/margin-top");
+ const int leftMargin = Resource::intValue("menu-view/margin-left");
+ const int vSpacing = Resource::intValue("menu-view/spacing-vertical");
+ const int hSpacing = Resource::intValue("menu-view/spacing-horizontal");
+
+ // initialize interface
+ setFlag(QGraphicsItem::ItemHasNoContents);
+
+ Button *phoneButton = new Button(Resource::pixmap("menu_bt_phone.png"));
+ Button *chatButton = new Button(Resource::pixmap("menu_bt_chat.png"));
+ Button *emailButton = new Button(Resource::pixmap("menu_bt_email.png"));
+ Button *musicButton = new Button(Resource::pixmap("menu_bt_music.png"));
+ Button *gamesButton = new Button(Resource::pixmap("menu_bt_games.png"));
+ Button *navigationButton = new Button(Resource::pixmap("menu_bt_navigation.png"));
+ Button *folderButton = new Button(Resource::pixmap("menu_bt_folder.png"));
+ Button *calendarButton = new Button(Resource::pixmap("menu_bt_calendar.png"));
+ Button *settingsButton = new Button(Resource::pixmap("menu_bt_settings.png"));
+ Button *cameraButton = new Button(Resource::pixmap("menu_bt_camera.png"));
+ Button *webButton = new Button(Resource::pixmap("menu_bt_web.png"));
+ Button *twitterButton = new Button(Resource::pixmap("menu_bt_twitter.png"));
+
+ connect(phoneButton, SIGNAL(clicked()), SLOT(onPhoneClicked()));
+
+ QGraphicsGridLayout *layout = new QGraphicsGridLayout();
+ layout->setVerticalSpacing(vSpacing);
+ layout->setHorizontalSpacing(hSpacing);
+ layout->setContentsMargins(leftMargin, topMargin, 0, 0);
+
+ layout->addItem(phoneButton, 0, 0);
+ layout->addItem(chatButton, 0, 1);
+ layout->addItem(emailButton, 0, 2);
+
+ layout->addItem(musicButton, 1, 0);
+ layout->addItem(gamesButton, 1, 1);
+ layout->addItem(navigationButton, 1, 2);
+
+ layout->addItem(folderButton, 2, 0);
+ layout->addItem(calendarButton, 2, 1);
+ layout->addItem(settingsButton, 2, 2);
+
+ layout->addItem(cameraButton, 3, 0);
+ layout->addItem(webButton, 3, 1);
+ layout->addItem(twitterButton, 3, 2);
+
+ setLayout(layout);
+}
+
+void MenuView::onPhoneClicked()
+{
+ pageView()->add(new PhoneView());
+}
diff --git a/hyperui/menuview.h b/hyperui/menuview.h
new file mode 100644
index 0000000..62478f3
--- /dev/null
+++ b/hyperui/menuview.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MENUVIEW_H
+#define MENUVIEW_H
+
+#include "view.h"
+
+
+class MenuView : public View
+{
+ Q_OBJECT
+
+public:
+ MenuView(QGraphicsItem *parent = 0);
+
+protected slots:
+ void onPhoneClicked();
+};
+
+#endif
diff --git a/hyperui/pagemenu.cpp b/hyperui/pagemenu.cpp
new file mode 100644
index 0000000..578ec72
--- /dev/null
+++ b/hyperui/pagemenu.cpp
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QPainter>
+#include <QFontMetrics>
+
+#include "global.h"
+#include "pagemenu.h"
+
+
+PageMenu::PageMenu(QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_background(Resource::pixmap("top_bar_active.png"))
+{
+ QFont textFont = QFont(Resource::stringValue("default/font-family"));
+ textFont.setPixelSize(Resource::intValue("page-menu/font-size"));
+ setFont(textFont);
+
+ m_textRect = Resource::value("page-menu/label-rect").toRect();
+ m_fontColor = QColor(Resource::stringValue("default/font-color"));
+
+ setMinimumSize(m_background.size());
+ setMaximumSize(m_background.size());
+}
+
+QString PageMenu::text() const
+{
+ return m_text;
+}
+
+void PageMenu::setText(const QString &text)
+{
+ if (m_text != text) {
+ m_text = text;
+ update();
+ }
+}
+
+void PageMenu::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
+{
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+
+ painter->drawPixmap(0, 0, m_background);
+
+ QFontMetrics metrics(font());
+ const QString &elidedText = metrics.elidedText(m_text, Qt::ElideRight,
+ m_textRect.width());
+
+ painter->setFont(font());
+ painter->setPen(m_fontColor);
+ painter->drawText(m_textRect, Qt::TextSingleLine | Qt::AlignCenter, elidedText);
+}
diff --git a/hyperui/pagemenu.h b/hyperui/pagemenu.h
new file mode 100644
index 0000000..efc9bf7
--- /dev/null
+++ b/hyperui/pagemenu.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PAGEMENU_H
+#define PAGEMENU_H
+
+#include <QColor>
+#include <QPixmap>
+#include <QGraphicsWidget>
+
+
+class PageMenu : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ PageMenu(QGraphicsItem *parent = 0);
+
+ QString text() const;
+ void setText(const QString &text);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+private:
+ QString m_text;
+ QRect m_textRect;
+ QColor m_fontColor;
+ QPixmap m_background;
+};
+
+#endif
diff --git a/hyperui/pageview.cpp b/hyperui/pageview.cpp
new file mode 100644
index 0000000..fb779d5
--- /dev/null
+++ b/hyperui/pageview.cpp
@@ -0,0 +1,307 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QGraphicsRotation>
+#include <QPropertyAnimation>
+#include <QGraphicsLinearLayout>
+#include <QParallelAnimationGroup>
+#include <QGraphicsSceneResizeEvent>
+
+#include "global.h"
+#include "view.h"
+#include "button.h"
+#include "pagemenu.h"
+#include "pageview.h"
+
+
+class PageSlot : public QGraphicsWidget
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal pageSlide READ pageSlide WRITE setPageSlide);
+
+public:
+ enum MovementType {
+ MoveInLeft,
+ MoveInRight,
+ MoveOutLeft,
+ MoveOutRight
+ };
+
+ PageSlot(QGraphicsItem *parent = 0);
+
+ qreal pageSlide() const;
+ void setPageSlide(qreal percent);
+
+ View *contents() const;
+ void setContents(View *contents);
+
+ QAbstractAnimation *createAnimation(MovementType type);
+
+private:
+ bool m_isOut;
+ bool m_isLeft;
+ qreal m_pageSlide;
+ bool m_isLinearTransition;
+ View *m_contents;
+ QGraphicsRotation *m_rotation;
+};
+
+
+PageSlot::PageSlot(QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_contents(0),
+ m_rotation(new QGraphicsRotation(this))
+{
+ setFlags(QGraphicsItem::ItemHasNoContents);
+
+#ifdef Q_OS_SYMBIAN
+ m_isLinearTransition = true;
+#else
+ m_isLinearTransition = false;
+#endif
+
+ m_rotation->setAxis(Qt::YAxis);
+
+ QList<QGraphicsTransform*> transforms;
+ transforms.append(m_rotation);
+ setTransformations(transforms);
+}
+
+qreal PageSlot::pageSlide() const
+{
+ return m_pageSlide;
+}
+
+void PageSlot::setPageSlide(qreal percent)
+{
+ m_pageSlide = percent;
+
+ if (!m_isLinearTransition) {
+ // apply flip values
+ const qreal np = m_isOut ? percent : (1 - percent);
+ m_rotation->setAngle((m_isLeft ? 180 : -180) * np);
+ } else {
+ // apply linear pos values
+ const int sw = size().width();
+ const qreal sx = (m_isLeft ? -sw : sw);
+ setPos(sx * (m_isOut ? percent : 1 - percent), pos().y());
+ }
+}
+
+View *PageSlot::contents() const
+{
+ return m_contents;
+}
+
+void PageSlot::setContents(View *contents)
+{
+ if (m_contents && m_contents->parentItem() == this)
+ m_contents->setParentItem(0);
+
+ m_contents = contents;
+
+ if (contents) {
+ contents->setParentItem(this);
+ contents->setGeometry(0, 0, size().width(), size().height());
+ }
+}
+
+QAbstractAnimation *PageSlot::createAnimation(MovementType type)
+{
+ m_isOut = (type == MoveOutLeft || type == MoveOutRight);
+ m_isLeft = (type == MoveInLeft || type == MoveOutLeft);
+
+ if (!m_isLinearTransition) {
+ QVector3D ov(m_isLeft ? 0 : size().width(), 0, 0);
+ m_rotation->setOrigin(ov);
+ }
+
+ QPropertyAnimation *animation = new QPropertyAnimation(this, "pageSlide");
+ animation->setDuration(400);
+ animation->setStartValue(0.0);
+ animation->setEndValue(1.0);
+
+ return animation;
+}
+
+
+PageView::PageView(QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_isBack(false)
+{
+ m_topOffset = Resource::intValue("page-view/margin-top");
+
+ setFlag(QGraphicsItem::ItemHasNoContents);
+
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+ layout->setContentsMargins(20, 40, 20, 0);
+
+ QGraphicsLinearLayout *topLayout = new QGraphicsLinearLayout(Qt::Horizontal);
+ topLayout->setContentsMargins(0, 0, 0, 0);
+
+ setLayout(layout);
+ layout->addItem(topLayout);
+ layout->addStretch(1);
+
+ m_menu = new PageMenu();
+
+ m_backButton = new Button(Resource::pixmap("top_bt_back.png"),
+ QPixmap(),
+ Resource::pixmap("top_bt_back_disabled.png"));
+
+ m_optionsButton = new Button(Resource::pixmap("top_bt_options.png"),
+ QPixmap(),
+ Resource::pixmap("top_bt_options_disabled.png"));
+
+ connect(m_backButton, SIGNAL(clicked()), SLOT(backClicked()));
+ connect(m_optionsButton, SIGNAL(clicked()), SLOT(optionsClicked()));
+
+ topLayout->addItem(m_optionsButton);
+ topLayout->addStretch(1);
+ topLayout->addItem(m_menu);
+ topLayout->addStretch(1);
+ topLayout->addItem(m_backButton);
+
+ m_animationInOut = new QParallelAnimationGroup(this);
+ connect(m_animationInOut, SIGNAL(finished()), this, SLOT(transitionFinished()));
+
+ m_optionsButton->setEnabled(false);
+
+ m_oldSlot = new PageSlot(this);
+ m_newSlot = new PageSlot(this);
+ m_oldSlot->setPos(0, m_topOffset);
+ m_newSlot->setPos(0, m_topOffset);
+}
+
+bool PageView::add(View *view)
+{
+ if (!view || isAnimating())
+ return false;
+
+ view->setPageView(this);
+
+ if (m_views.isEmpty()) {
+ m_views.push(view);
+ m_menu->setText(view->title());
+ m_oldSlot->setContents(view);
+ } else
+ animateTransition(m_views.top(), view, false);
+
+ return true;
+}
+
+bool PageView::back()
+{
+ if (m_views.count() < 2 || isAnimating())
+ return false;
+
+ View *oldView = m_views.pop();
+ View *newView = m_views.top();
+
+ animateTransition(oldView, newView, true);
+ return true;
+}
+
+bool PageView::isAnimating() const
+{
+ return (m_animationInOut->state() == QAbstractAnimation::Running);
+}
+
+void PageView::backClicked()
+{
+ if (m_views.count() < 2)
+ QApplication::quit();
+ else
+ back();
+}
+
+void PageView::optionsClicked()
+{
+ qWarning("options clicked");
+}
+
+void PageView::transitionFinished()
+{
+ View *newView = m_newSlot->contents();
+ View *oldView = m_oldSlot->contents();
+
+ if (m_isBack) {
+ m_oldSlot->setContents(0);
+ delete oldView;
+ } else {
+ oldView->hide();
+ m_views.push(newView);
+ }
+
+ m_menu->setText(newView->title());
+}
+
+void PageView::animateTransition(View *oldView, View *newView, bool isBack)
+{
+ m_isBack = isBack;
+ m_oldSlot->setContents(oldView);
+ m_newSlot->setContents(newView);
+
+ m_animationInOut->clearAnimations();
+
+ newView->show();
+
+ QAbstractAnimation *inAnim;
+ QAbstractAnimation *outAnim;
+
+ if (isBack) {
+ inAnim = m_newSlot->createAnimation(PageSlot::MoveInLeft);
+ outAnim = m_oldSlot->createAnimation(PageSlot::MoveOutRight);
+ } else {
+ inAnim = m_newSlot->createAnimation(PageSlot::MoveInRight);
+ outAnim = m_oldSlot->createAnimation(PageSlot::MoveOutLeft);
+ }
+
+ m_animationInOut->addAnimation(inAnim);
+ m_animationInOut->addAnimation(outAnim);
+ m_animationInOut->start();
+}
+
+void PageView::resizeEvent(QGraphicsSceneResizeEvent *event)
+{
+ QGraphicsWidget::resizeEvent(event);
+
+ if (!m_views.isEmpty()) {
+ QSizeF newSize = event->newSize();
+ newSize.setHeight(newSize.height() - m_topOffset);
+
+ m_oldSlot->resize(newSize);
+ m_newSlot->resize(newSize);
+ }
+}
+
+#include "pageview.moc"
diff --git a/hyperui/pageview.h b/hyperui/pageview.h
new file mode 100644
index 0000000..75b8728
--- /dev/null
+++ b/hyperui/pageview.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PAGEVIEW_H
+#define PAGEVIEW_H
+
+#include <QStack>
+#include <QPixmap>
+#include <QGraphicsWidget>
+
+class View;
+class Button;
+class PageMenu;
+class PageSlot;
+
+QT_BEGIN_NAMESPACE
+class QParallelAnimationGroup;
+QT_END_NAMESPACE
+
+
+class PageView : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ PageView(QGraphicsItem *parent = 0);
+
+ bool add(View *view);
+ bool back();
+
+ bool isAnimating() const;
+
+protected:
+ void animateTransition(View *oldView, View *newView, bool isBack);
+
+ void resizeEvent(QGraphicsSceneResizeEvent *event);
+ void mousePressEvent(QGraphicsSceneMouseEvent *) { }
+
+private slots:
+ void backClicked();
+ void optionsClicked();
+ void transitionFinished();
+
+private:
+ bool m_isBack;
+ int m_topOffset;
+
+ QStack<View *> m_views;
+ QParallelAnimationGroup *m_animationInOut;
+
+ PageMenu *m_menu;
+ Button *m_backButton;
+ Button *m_optionsButton;
+
+ PageSlot *m_oldSlot;
+ PageSlot *m_newSlot;
+};
+
+#endif
diff --git a/hyperui/phoneview.cpp b/hyperui/phoneview.cpp
new file mode 100644
index 0000000..d0e0c9c
--- /dev/null
+++ b/hyperui/phoneview.cpp
@@ -0,0 +1,532 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QPainter>
+#include <QState>
+#include <QStateMachine>
+#include <QSignalTransition>
+#include <QGraphicsPixmapItem>
+#include <QGraphicsLinearLayout>
+#include <QPropertyAnimation>
+#include <QSequentialAnimationGroup>
+
+#include "global.h"
+#include "label.h"
+#include "button.h"
+#include "phoneview.h"
+#include "dialerwidget.h"
+
+
+class CallBoard : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ CallBoard(QGraphicsItem *parent = 0);
+
+ void setPhoto(const QPixmap &photo);
+
+ void setName(const QString &name);
+ void setPhone(const QString &phone);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+ QGraphicsWidget *contents;
+ QGraphicsWidget *panelWait;
+ QGraphicsWidget *panelInCall;
+
+private:
+ QPixmap m_top;
+ QPixmap m_bottom;
+ QPixmap m_middleline;
+
+ QGraphicsPixmapItem *m_icon;
+ QGraphicsPixmapItem *m_photo;
+
+ Label *m_callLabel;
+ Label *m_nameLabel;
+ Label *m_phoneLabel;
+ Label *m_bigNameLabel;
+};
+
+
+/*!
+ \class CallBoard
+
+ This widget will show call information.
+*/
+CallBoard::CallBoard(QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_top(Resource::pixmap("dialer_bk_top.png")),
+ m_bottom(Resource::pixmap("dialer_bk_bottom.png")),
+ m_middleline(Resource::pixmap("dialer_bk_lineexpand.png"))
+{
+ // read settings
+ QFont font(Resource::stringValue("default/font-family"));
+ const int margin = Resource::intValue("call-board/margin");
+ const QString &phoneColor = Resource::stringValue("call-board/phone-font-color");
+ const QRect &subPanelRect = Resource::value("call-board/sub-panel-rect").toRect();
+ const QPoint &dialPos = Resource::value("call-board/dial-button-pos").toPoint();
+ const QPoint &mutePos = Resource::value("call-board/mute-button-pos").toPoint();
+ const QPoint &speakerPos = Resource::value("call-board/speaker-button-pos").toPoint();
+ const QPoint &dialIconPos = Resource::value("call-board/dial-icon-pos").toPoint();
+ const QRect &callLabelRect = Resource::value("call-board/call-label-rect").toRect();
+ const QRect &nameLabelRect = Resource::value("call-board/name-label-rect").toRect();
+ const QRect &phoneLabelRect = Resource::value("call-board/phone-label-rect").toRect();
+ const QRect &bigNameLabelRect = Resource::value("call-board/big-name-label-rect").toRect();
+
+ // initialize interface
+ setMinimumSize(m_top.size().width(),
+ m_top.size().height() +
+ m_bottom.size().height() +
+ m_middleline.size().height());
+
+ // create main panel and photo
+ contents = new QGraphicsWidget(this);
+ contents->setFlag(QGraphicsItem::ItemHasNoContents);
+ contents->setGeometry(geometry());
+
+ m_photo = new QGraphicsPixmapItem(contents);
+ m_photo->setPos(margin, margin);
+ m_photo->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
+
+ m_icon = new QGraphicsPixmapItem(contents);
+ m_icon->setPixmap(Resource::pixmap("dialer_bullet_phone.png"));
+ m_icon->setPos(dialIconPos);
+ m_icon->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
+
+ // create 'wait' sub-panel
+ panelWait = new QGraphicsWidget(contents);
+ panelWait->setFlag(QGraphicsItem::ItemHasNoContents);
+ panelWait->setGeometry(subPanelRect);
+
+ font.setPixelSize(Resource::intValue("call-board/small-font-size"));
+
+ m_callLabel = new Label(panelWait);
+ m_callLabel->setFont(font);
+ m_callLabel->setText(tr("Calling..."));
+ m_callLabel->setGeometry(callLabelRect);
+
+ font.setPixelSize(Resource::intValue("call-board/font-size"));
+
+ m_nameLabel = new Label(panelWait);
+ m_nameLabel->setFont(font);
+ m_nameLabel->setGeometry(nameLabelRect);
+
+ m_phoneLabel = new Label(panelWait);
+ m_phoneLabel->setFont(font);
+ m_phoneLabel->setFontColor(QColor(phoneColor));
+ m_phoneLabel->setGeometry(phoneLabelRect);
+
+ // create 'in-call' sub-panel
+ panelInCall = new QGraphicsWidget(contents);
+ panelInCall->setFlag(QGraphicsItem::ItemHasNoContents);
+ panelInCall->setGeometry(subPanelRect);
+
+ m_bigNameLabel = new Label(panelInCall);
+ m_bigNameLabel->setFont(font);
+ m_bigNameLabel->setGeometry(bigNameLabelRect);
+
+ Button *dialButton = new Button(Resource::pixmap("dialer_bt_dialer.png"));
+ dialButton->setParentItem(panelInCall);
+ dialButton->setPos(dialPos);
+
+ Button *muteButton = new Button(Resource::pixmap("dialer_bt_mute.png"));
+ muteButton->setParentItem(panelInCall);
+ muteButton->setPos(mutePos);
+
+ Button *speakerButton = new Button(Resource::pixmap("dialer_bt_speaker.png"));
+ speakerButton->setParentItem(panelInCall);
+ speakerButton->setPos(speakerPos);
+}
+
+/*!
+ Sets the contact's name.
+*/
+void CallBoard::setName(const QString &name)
+{
+ m_nameLabel->setText(name);
+ m_bigNameLabel->setText(name);
+}
+
+/*!
+ Sets the contact's phone.
+*/
+void CallBoard::setPhone(const QString &phone)
+{
+ m_phoneLabel->setText(phone);
+}
+
+/*!
+ Sets the contact photo.
+*/
+void CallBoard::setPhoto(const QPixmap &photo)
+{
+ m_photo->setPixmap(photo);
+}
+
+/*!
+ \internal
+*/
+void CallBoard::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
+ QWidget *)
+{
+ const int tw = m_top.width();
+ const int th = m_top.height();
+ const int by = size().height() - m_bottom.height();
+
+ painter->drawPixmap(0, 0, m_top);
+ painter->drawTiledPixmap(0, th, tw, by - th, m_middleline);
+ painter->drawPixmap(0, by, m_bottom);
+}
+
+
+class DialerDisplay : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ DialerDisplay(QGraphicsItem *parent = 0);
+
+ QString text() const;
+ void append(const QString &value);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = 0);
+
+public slots:
+ void clear();
+
+private:
+ Label *m_label;
+ Button *m_cancel;
+ QPixmap m_background;
+};
+
+
+/*!
+ \class DialerDisplay
+
+ This widget is used to display the keys pressed in the dialer. It has a
+ backspace key and a default background.
+*/
+DialerDisplay::DialerDisplay(QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_background(Resource::pixmap("dialer_display_background.png"))
+{
+ setMinimumSize(m_background.size());
+
+ m_label = new Label(this);
+ m_label->setElideMode(Qt::ElideLeft);
+ m_label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
+
+ QFont font = m_label->font();
+ font.setPixelSize(Resource::intValue("phone-view/display-font-size"));
+ m_label->setFont(font);
+
+ m_cancel = new Button(Resource::pixmap("dialer_display_bt_cancel.png"));
+ connect(m_cancel, SIGNAL(clicked()), SLOT(clear()));
+
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
+ layout->addItem(m_label);
+ layout->addItem(m_cancel);
+ setLayout(layout);
+
+ layout->setAlignment(m_cancel, Qt::AlignBottom);
+}
+
+/*!
+ Returns the current display text.
+*/
+QString DialerDisplay::text() const
+{
+ return m_label->text();
+}
+
+/*!
+ Appends a text in the display.
+*/
+void DialerDisplay::append(const QString &value)
+{
+ m_label->setText(m_label->text() + value);
+}
+
+/*!
+ Clear the last char in the display if it's not empty.
+*/
+void DialerDisplay::clear()
+{
+ const QString &value = m_label->text();
+
+ if (!value.isEmpty())
+ m_label->setText(value.left(value.length() - 1));
+}
+
+/*!
+ \internal
+*/
+void DialerDisplay::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
+ QWidget *)
+{
+ painter->drawPixmap(0, 0, m_background);
+}
+
+
+/*!
+ \class PhoneView
+
+ This class provides the view to make calls.
+*/
+
+PhoneView::PhoneView(QGraphicsItem *parent)
+ : View(parent)
+{
+ setTitle(tr("CONTACTS"));
+
+ // read settings
+ const int callTimeout = Resource::intValue("phone-view/call-timeout");
+ const QPoint &displayPos = Resource::value("phone-view/display-pos").toPoint();
+ const QPoint &dialerBackPos = Resource::value("phone-view/dialer-back-pos").toPoint();
+ const QPoint &callButtonPos = Resource::value("phone-view/call-button-pos").toPoint();
+ const QPoint &contactsButtonPos = Resource::value("phone-view/contacts-button-pos").toPoint();
+
+ // initialize interface
+ setFlag(QGraphicsItem::ItemHasNoContents);
+
+ m_display = new DialerDisplay(this);
+ m_display->setPos(displayPos);
+
+ m_contactsButton = new Button(Resource::pixmap("dialer_bt_contacts.png"));
+ m_contactsButton->setParentItem(this);
+ m_contactsButton->setPos(contactsButtonPos);
+
+ m_callButton = new Button(Resource::pixmap("dialer_bt_call.png"),
+ Resource::pixmap("dialer_bt_call_over.png"));
+ m_callButton->setText(tr("CALL"));
+ m_callButton->setParentItem(this);
+ m_callButton->setPos(callButtonPos);
+
+ m_endCallButton = new Button(Resource::pixmap("dialer_bt_endcall.png"),
+ Resource::pixmap("dialer_bt_endcall_over.png"));
+ m_endCallButton->setText(tr("END CALL"));
+ m_endCallButton->setParentItem(this);
+ m_endCallButton->setPos(callButtonPos);
+
+ m_board = new CallBoard(this);
+ m_board->setPos(dialerBackPos);
+ m_board->setPhoto(Resource::pixmap("dialer_photo.png"));
+ // dummy name
+ m_board->setName(Resource::stringValue("phone-view/contact-dummy-name"));
+
+ m_dialer = new DialerWidget(this);
+ m_dialer->setPos(dialerBackPos);
+ connect(m_dialer, SIGNAL(buttonClicked(const QString &)),
+ SLOT(dialButtonClicked(const QString &)));
+
+ m_callTimer.setInterval(callTimeout);
+ m_callTimer.setSingleShot(true);
+
+ createStateMachine();
+
+ connect(m_callButton, SIGNAL(clicked()), SLOT(callClicked()));
+}
+
+/*!
+ Handle call click.
+*/
+void PhoneView::callClicked()
+{
+ // update phone number
+ m_board->setPhone(m_display->text());
+
+ // simulate call wait
+ m_callTimer.start();
+}
+
+/*!
+ Fill the dialer display.
+*/
+void PhoneView::dialButtonClicked(const QString &value)
+{
+ m_display->append(value);
+}
+
+/*!
+ Creates the all states of the view.
+*/
+void PhoneView::createStateMachine()
+{
+ QStateMachine *machine = new QStateMachine(this);
+
+ // create default state
+ QState *state1 = new QState();
+ state1->assignProperty(m_dialer, "opacity", 1.0);
+ state1->assignProperty(m_display, "visible", true);
+ state1->assignProperty(m_board, "visible", false);
+ state1->assignProperty(m_callButton, "visible", true);
+ state1->assignProperty(m_endCallButton, "visible", false);
+ state1->assignProperty(m_board->contents, "opacity", 0.0);
+ state1->assignProperty(m_board, "geometry", m_board->geometry());
+
+ // create calling state
+ QState *state2 = new QState();
+ state2->assignProperty(m_dialer, "opacity", 0.0);
+ state2->assignProperty(m_display, "visible", false);
+ state2->assignProperty(m_board, "visible", true);
+ state2->assignProperty(m_callButton, "visible", false);
+ state2->assignProperty(m_endCallButton, "visible", true);
+ state2->assignProperty(m_board->contents, "opacity", 1.0);
+ const int offsetY = -(m_board->pos().y() - m_display->pos().y());
+ state2->assignProperty(m_board, "geometry",
+ m_board->geometry().adjusted(0, offsetY, 0, 0));
+
+ state2->assignProperty(m_board->panelWait, "opacity", 1.0);
+ state2->assignProperty(m_board->panelInCall, "opacity", 0.0);
+ state2->assignProperty(m_board->panelWait, "visible", true);
+ state2->assignProperty(m_board->panelInCall, "visible", false);
+
+ // create in-call state
+ QState *state3 = new QState();
+ state3->assignProperty(m_board->panelWait, "opacity", 0.0);
+ state3->assignProperty(m_board->panelInCall, "opacity", 1.0);
+ state3->assignProperty(m_board->panelWait, "visible", false);
+ state3->assignProperty(m_board->panelInCall, "visible", true);
+
+ // associates state1-state2 transition
+ QSignalTransition *transition1 =
+ state1->addTransition(m_callButton, SIGNAL(clicked()), state2);
+ transition1->addAnimation(createCallAnimation());
+
+ // associates state2-state1 transition
+ QSignalTransition *transition2 =
+ state2->addTransition(m_endCallButton, SIGNAL(clicked()), state1);
+ transition2->addAnimation(createEndCallAnimation());
+
+ // associates state3-state1 transition
+ QSignalTransition *transition3 =
+ state3->addTransition(m_endCallButton, SIGNAL(clicked()), state1);
+ transition3->addAnimation(createEndCallAnimation());
+
+ // associates state2-state3 transition
+ QSignalTransition *transition4 =
+ state2->addTransition(&m_callTimer, SIGNAL(timeout()), state3);
+ transition4->addAnimation(createInCallAnimation());
+
+ machine->addState(state1);
+ machine->addState(state2);
+ machine->addState(state3);
+
+ machine->setInitialState(state1);
+ machine->start();
+}
+
+/*!
+ Creates the animation executed in the call action.
+*/
+QAbstractAnimation *PhoneView::createCallAnimation()
+{
+ QPropertyAnimation *animation;
+
+ QSequentialAnimationGroup *result = new QSequentialAnimationGroup();
+
+ animation = new QPropertyAnimation(m_dialer, "opacity");
+ animation->setDuration(200);
+ result->addAnimation(animation);
+
+ animation = new QPropertyAnimation(m_board, "geometry");
+ animation->setDuration(300);
+ result->addAnimation(animation);
+
+ animation = new QPropertyAnimation(m_board->contents, "opacity");
+ animation->setDuration(200);
+ result->addAnimation(animation);
+
+ return result;
+}
+
+/*!
+ Creates the animation executed in the in-call action.
+*/
+QAbstractAnimation *PhoneView::createInCallAnimation()
+{
+ QPropertyAnimation *animation;
+
+ QSequentialAnimationGroup *result = new QSequentialAnimationGroup();
+
+ animation = new QPropertyAnimation(m_board->panelWait, "opacity");
+ animation->setDuration(300);
+ result->addAnimation(animation);
+
+ animation = new QPropertyAnimation(m_board->panelWait, "visible");
+ animation->setDuration(0);
+ result->addAnimation(animation);
+
+ animation = new QPropertyAnimation(m_board->panelInCall, "opacity");
+ animation->setDuration(300);
+ result->addAnimation(animation);
+
+ return result;
+}
+
+/*!
+ Creates the animation executed in the end call action.
+*/
+QAbstractAnimation *PhoneView::createEndCallAnimation()
+{
+ QPropertyAnimation *animation;
+
+ QSequentialAnimationGroup *result = new QSequentialAnimationGroup();
+
+ animation = new QPropertyAnimation(m_board->contents, "opacity");
+ animation->setDuration(200);
+ result->addAnimation(animation);
+
+ animation = new QPropertyAnimation(m_board, "geometry");
+ animation->setDuration(300);
+ result->addAnimation(animation);
+
+ animation = new QPropertyAnimation(m_dialer, "opacity");
+ animation->setDuration(200);
+ result->addAnimation(animation);
+
+ animation = new QPropertyAnimation(m_board, "visible");
+ animation->setDuration(0);
+ result->addAnimation(animation);
+
+ animation = new QPropertyAnimation(m_display, "visible");
+ animation->setDuration(0);
+ result->addAnimation(animation);
+
+ return result;
+}
+
+#include "phoneview.moc"
diff --git a/hyperui/phoneview.h b/hyperui/phoneview.h
new file mode 100644
index 0000000..c8352d5
--- /dev/null
+++ b/hyperui/phoneview.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PHONEVIEW_H
+#define PHONEVIEW_H
+
+#include <QTimer>
+#include <QPixmap>
+
+#include "view.h"
+
+class Label;
+class CallBoard;
+class DialerWidget;
+class DialerDisplay;
+
+QT_BEGIN_NAMESPACE
+class QAbstractAnimation;
+QT_END_NAMESPACE
+
+
+class PhoneView : public View
+{
+ Q_OBJECT
+
+public:
+ PhoneView(QGraphicsItem *parent = 0);
+
+private:
+ void createStateMachine();
+ QAbstractAnimation *createCallAnimation();
+ QAbstractAnimation *createInCallAnimation();
+ QAbstractAnimation *createEndCallAnimation();
+
+private slots:
+ void callClicked();
+ void dialButtonClicked(const QString &value);
+
+private:
+ QTimer m_callTimer;
+ Label *m_label;
+ Button *m_callButton;
+ Button *m_endCallButton;
+ Button *m_contactsButton;
+ DialerWidget *m_dialer;
+ CallBoard *m_board;
+ DialerDisplay *m_display;
+};
+
+#endif
diff --git a/hyperui/resource/640x360/hyperui.ini b/hyperui/resource/640x360/hyperui.ini
new file mode 100644
index 0000000..b83e181
--- /dev/null
+++ b/hyperui/resource/640x360/hyperui.ini
@@ -0,0 +1,75 @@
+[default]
+font-family=Nokia Sans
+font-color=#FFFFFF
+
+[button]
+font-size=30
+
+[window]
+width=360
+height=640
+
+[page-menu]
+font-size=26
+label-rect=@Rect(10 10 195 20)
+
+[page-view]
+margin-top=90
+
+[menu-view]
+margin-top=10
+margin-left=18
+spacing-vertical=38
+spacing-horizontal=23
+
+[clock-widget]
+update-timeout=5000
+font-color=#9FA3AC
+knob-pos=@Point(168 187)
+middle-pos=@Point(179 197)
+day-font-size=26
+day-label-rect=@Rect(162 108 34 28)
+wday-font-size=13
+wday-label-rect=@Rect(162 133 35 17)
+events-inner-offset=31
+events-inner-diameter=286
+events-pixmap-rect=@Rect(36 56 290 290)
+
+[draggable-preview]
+border=2
+margin-top=5
+margin-left=58
+restore-time=300
+maximize-time=300
+minimum-scale=0.44
+maximize-threshold=50
+
+[dialer-widget]
+margin=4
+spacing=6
+
+[phone-view]
+display-pos=@Point(9 10)
+call-timeout=2000
+display-font-size=38
+display-cancel-pos=@Point(281 23)
+dialer-back-pos=@Point(9 90)
+call-button-pos=@Point(128 466)
+contacts-button-pos=@Point(9 466)
+label-geometry=@Rect(15 8 262 60)
+contact-dummy-name=Priscila Sobral
+
+[call-board]
+margin=14
+font-size=32
+small-font-size=22
+phone-font-color=#6A6F81
+dial-icon-pos=@Point(14 308)
+dial-button-pos=@Point(0 48)
+mute-button-pos=@Point(108 49)
+speaker-button-pos=@Point(216 49)
+sub-panel-rect=@Rect(12 300 300 150)
+call-label-rect=@Rect(37 7 280 37)
+name-label-rect=@Rect(37 41 280 37)
+phone-label-rect=@Rect(37 83 280 37)
+big-name-label-rect=@Rect(37 0 280 37)
diff --git a/hyperui/resource/640x360/hyperui.qrc b/hyperui/resource/640x360/hyperui.qrc
new file mode 100644
index 0000000..21a16d2
--- /dev/null
+++ b/hyperui/resource/640x360/hyperui.qrc
@@ -0,0 +1,65 @@
+<RCC>
+<qresource>
+ <file>hyperui.ini</file>
+
+ <file>images/background.png</file>
+ <file>images/idle_clock_structure.png</file>
+
+ <file>images/idle_clock_pointers_middle.png</file>
+ <file>images/idle_clock_pointer_hour.png</file>
+ <file>images/idle_clock_pointer_minutes.png</file>
+
+ <file>images/top_bt_back.png</file>
+ <file>images/top_bt_back_disabled.png</file>
+ <file>images/top_bt_options.png</file>
+ <file>images/top_bt_options_disabled.png</file>
+
+ <file>images/top_bar_active.png</file>
+
+ <file>images/screen_unlock.png</file>
+
+ <file>images/menu_bt_phone.png</file>
+ <file>images/menu_bt_chat.png</file>
+ <file>images/menu_bt_email.png</file>
+ <file>images/menu_bt_games.png</file>
+ <file>images/menu_bt_music.png</file>
+ <file>images/menu_bt_navigation.png</file>
+ <file>images/menu_bt_calendar.png</file>
+ <file>images/menu_bt_camera.png</file>
+ <file>images/menu_bt_folder.png</file>
+ <file>images/menu_bt_twitter.png</file>
+ <file>images/menu_bt_web.png</file>
+ <file>images/menu_bt_settings.png</file>
+
+ <file>images/dialer_display_background.png</file>
+ <file>images/dialer_display_bt_cancel.png</file>
+ <file>images/dialer_bt_contacts.png</file>
+ <file>images/dialer_bt_call.png</file>
+ <file>images/dialer_bt_call_over.png</file>
+ <file>images/dialer_bt_endcall.png</file>
+ <file>images/dialer_bt_endcall_over.png</file>
+
+ <file>images/dialer/background.png</file>
+ <file>images/dialer/middle_key.png</file>
+ <file>images/dialer/middle_key_pressed.png</file>
+ <file>images/dialer/bottom_left_key.png</file>
+ <file>images/dialer/bottom_left_key_pressed.png</file>
+ <file>images/dialer/bottom_right_key.png</file>
+ <file>images/dialer/bottom_right_key_pressed.png</file>
+ <file>images/dialer/top_left_key.png</file>
+ <file>images/dialer/top_left_key_pressed.png</file>
+ <file>images/dialer/top_right_key.png</file>
+ <file>images/dialer/top_right_key_pressed.png</file>
+
+ <file>images/dialer_photo.png</file>
+ <file>images/dialer_bk_top.png</file>
+ <file>images/dialer_bk_bottom.png</file>
+ <file>images/dialer_bk_lineexpand.png</file>
+
+ <file>images/dialer_bullet_phone.png</file>
+
+ <file>images/dialer_bt_dialer.png</file>
+ <file>images/dialer_bt_mute.png</file>
+ <file>images/dialer_bt_speaker.png</file>
+</qresource>
+</RCC>
diff --git a/hyperui/resource/640x360/images/background.png b/hyperui/resource/640x360/images/background.png
new file mode 100644
index 0000000..176ce3c
--- /dev/null
+++ b/hyperui/resource/640x360/images/background.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/background.png b/hyperui/resource/640x360/images/dialer/background.png
new file mode 100644
index 0000000..844746f
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/background.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/bottom_left_key.png b/hyperui/resource/640x360/images/dialer/bottom_left_key.png
new file mode 100644
index 0000000..3c1a914
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/bottom_left_key.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/bottom_left_key_pressed.png b/hyperui/resource/640x360/images/dialer/bottom_left_key_pressed.png
new file mode 100644
index 0000000..33e19af
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/bottom_left_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/bottom_right_key.png b/hyperui/resource/640x360/images/dialer/bottom_right_key.png
new file mode 100644
index 0000000..bb45cf3
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/bottom_right_key.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/bottom_right_key_pressed.png b/hyperui/resource/640x360/images/dialer/bottom_right_key_pressed.png
new file mode 100644
index 0000000..5d1cf7b
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/bottom_right_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/middle_key.png b/hyperui/resource/640x360/images/dialer/middle_key.png
new file mode 100644
index 0000000..370dbd0
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/middle_key.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/middle_key_pressed.png b/hyperui/resource/640x360/images/dialer/middle_key_pressed.png
new file mode 100644
index 0000000..fc901c7
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/middle_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/top_left_key.png b/hyperui/resource/640x360/images/dialer/top_left_key.png
new file mode 100644
index 0000000..fc59cea
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/top_left_key.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/top_left_key_pressed.png b/hyperui/resource/640x360/images/dialer/top_left_key_pressed.png
new file mode 100644
index 0000000..e1c595a
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/top_left_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/top_right_key.png b/hyperui/resource/640x360/images/dialer/top_right_key.png
new file mode 100644
index 0000000..f962664
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/top_right_key.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer/top_right_key_pressed.png b/hyperui/resource/640x360/images/dialer/top_right_key_pressed.png
new file mode 100644
index 0000000..b82baff
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer/top_right_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bk_bottom.png b/hyperui/resource/640x360/images/dialer_bk_bottom.png
new file mode 100644
index 0000000..5fa84a7
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bk_bottom.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bk_lineexpand.png b/hyperui/resource/640x360/images/dialer_bk_lineexpand.png
new file mode 100644
index 0000000..99c310f
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bk_lineexpand.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bk_top.png b/hyperui/resource/640x360/images/dialer_bk_top.png
new file mode 100644
index 0000000..37b68fa
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bk_top.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bt_call.png b/hyperui/resource/640x360/images/dialer_bt_call.png
new file mode 100644
index 0000000..8103416
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bt_call.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bt_call_over.png b/hyperui/resource/640x360/images/dialer_bt_call_over.png
new file mode 100644
index 0000000..c3f6caf
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bt_call_over.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bt_contacts.png b/hyperui/resource/640x360/images/dialer_bt_contacts.png
new file mode 100644
index 0000000..d4ce55b
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bt_contacts.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bt_dialer.png b/hyperui/resource/640x360/images/dialer_bt_dialer.png
new file mode 100644
index 0000000..3825b5d
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bt_dialer.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bt_endcall.png b/hyperui/resource/640x360/images/dialer_bt_endcall.png
new file mode 100644
index 0000000..f546e49
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bt_endcall.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bt_endcall_over.png b/hyperui/resource/640x360/images/dialer_bt_endcall_over.png
new file mode 100644
index 0000000..fd7571a
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bt_endcall_over.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bt_mute.png b/hyperui/resource/640x360/images/dialer_bt_mute.png
new file mode 100644
index 0000000..0d6d0a1
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bt_mute.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bt_speaker.png b/hyperui/resource/640x360/images/dialer_bt_speaker.png
new file mode 100644
index 0000000..b932df8
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bt_speaker.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_bullet_phone.png b/hyperui/resource/640x360/images/dialer_bullet_phone.png
new file mode 100644
index 0000000..57e828a
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_bullet_phone.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_display_background.png b/hyperui/resource/640x360/images/dialer_display_background.png
new file mode 100644
index 0000000..f22f0f3
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_display_background.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_display_bt_cancel.png b/hyperui/resource/640x360/images/dialer_display_bt_cancel.png
new file mode 100644
index 0000000..72fa494
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_display_bt_cancel.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/dialer_photo.png b/hyperui/resource/640x360/images/dialer_photo.png
new file mode 100644
index 0000000..4654a39
--- /dev/null
+++ b/hyperui/resource/640x360/images/dialer_photo.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/idle_clock_pointer_hour.png b/hyperui/resource/640x360/images/idle_clock_pointer_hour.png
new file mode 100644
index 0000000..2b8dc91
--- /dev/null
+++ b/hyperui/resource/640x360/images/idle_clock_pointer_hour.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/idle_clock_pointer_minutes.png b/hyperui/resource/640x360/images/idle_clock_pointer_minutes.png
new file mode 100644
index 0000000..3746b2b
--- /dev/null
+++ b/hyperui/resource/640x360/images/idle_clock_pointer_minutes.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/idle_clock_pointers_middle.png b/hyperui/resource/640x360/images/idle_clock_pointers_middle.png
new file mode 100644
index 0000000..47aff18
--- /dev/null
+++ b/hyperui/resource/640x360/images/idle_clock_pointers_middle.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/idle_clock_structure.png b/hyperui/resource/640x360/images/idle_clock_structure.png
new file mode 100644
index 0000000..9d36374
--- /dev/null
+++ b/hyperui/resource/640x360/images/idle_clock_structure.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_calendar.png b/hyperui/resource/640x360/images/menu_bt_calendar.png
new file mode 100644
index 0000000..99963e1
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_calendar.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_camera.png b/hyperui/resource/640x360/images/menu_bt_camera.png
new file mode 100644
index 0000000..b1623e4
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_camera.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_chat.png b/hyperui/resource/640x360/images/menu_bt_chat.png
new file mode 100644
index 0000000..61e1cea
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_chat.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_email.png b/hyperui/resource/640x360/images/menu_bt_email.png
new file mode 100644
index 0000000..c1b5b38
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_email.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_folder.png b/hyperui/resource/640x360/images/menu_bt_folder.png
new file mode 100644
index 0000000..a15aac4
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_folder.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_games.png b/hyperui/resource/640x360/images/menu_bt_games.png
new file mode 100644
index 0000000..0c32bc2
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_games.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_music.png b/hyperui/resource/640x360/images/menu_bt_music.png
new file mode 100644
index 0000000..b01fd47
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_music.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_navigation.png b/hyperui/resource/640x360/images/menu_bt_navigation.png
new file mode 100644
index 0000000..ca4cf44
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_navigation.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_phone.png b/hyperui/resource/640x360/images/menu_bt_phone.png
new file mode 100644
index 0000000..7c0ee82
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_phone.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_settings.png b/hyperui/resource/640x360/images/menu_bt_settings.png
new file mode 100644
index 0000000..7cb3231
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_settings.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_twitter.png b/hyperui/resource/640x360/images/menu_bt_twitter.png
new file mode 100644
index 0000000..564d024
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_twitter.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/menu_bt_web.png b/hyperui/resource/640x360/images/menu_bt_web.png
new file mode 100644
index 0000000..bfe9737
--- /dev/null
+++ b/hyperui/resource/640x360/images/menu_bt_web.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/screen_unlock.png b/hyperui/resource/640x360/images/screen_unlock.png
new file mode 100755
index 0000000..66c6036
--- /dev/null
+++ b/hyperui/resource/640x360/images/screen_unlock.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/top_bar_active.png b/hyperui/resource/640x360/images/top_bar_active.png
new file mode 100644
index 0000000..24a7fce
--- /dev/null
+++ b/hyperui/resource/640x360/images/top_bar_active.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/top_bt_back.png b/hyperui/resource/640x360/images/top_bt_back.png
new file mode 100644
index 0000000..6e11c18
--- /dev/null
+++ b/hyperui/resource/640x360/images/top_bt_back.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/top_bt_back_disabled.png b/hyperui/resource/640x360/images/top_bt_back_disabled.png
new file mode 100644
index 0000000..18fa270
--- /dev/null
+++ b/hyperui/resource/640x360/images/top_bt_back_disabled.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/top_bt_options.png b/hyperui/resource/640x360/images/top_bt_options.png
new file mode 100644
index 0000000..a7df156
--- /dev/null
+++ b/hyperui/resource/640x360/images/top_bt_options.png
Binary files differ
diff --git a/hyperui/resource/640x360/images/top_bt_options_disabled.png b/hyperui/resource/640x360/images/top_bt_options_disabled.png
new file mode 100644
index 0000000..0abfdff
--- /dev/null
+++ b/hyperui/resource/640x360/images/top_bt_options_disabled.png
Binary files differ
diff --git a/hyperui/resource/864x480/hyperui.ini b/hyperui/resource/864x480/hyperui.ini
new file mode 100644
index 0000000..a3c96cf
--- /dev/null
+++ b/hyperui/resource/864x480/hyperui.ini
@@ -0,0 +1,75 @@
+[default]
+font-family=Nokia Sans
+font-color=#FFFFFF
+
+[button]
+font-size=40
+
+[window]
+width=480
+height=864
+
+[page-menu]
+font-size=26
+label-rect=@Rect(10 10 267 35)
+
+[page-view]
+margin-top=120
+
+[menu-view]
+margin-top=10
+margin-left=25
+spacing-vertical=50
+spacing-horizontal=28
+
+[clock-widget]
+update-timeout=5000
+font-color=#9FA3AC
+knob-pos=@Point(225 250)
+middle-pos=@Point(238 264)
+day-font-size=35
+day-label-rect=@Rect(216 144 46 37)
+wday-font-size=17
+wday-label-rect=@Rect(216 177 46 22)
+events-inner-offset=41
+events-inner-diameter=382
+events-pixmap-rect=@Rect(48 74 387 387)
+
+[draggable-preview]
+border=2
+margin-top=7
+margin-left=77
+restore-time=300
+maximize-time=300
+minimum-scale=0.44
+maximize-threshold=50
+
+[dialer-widget]
+margin=5
+spacing=8
+
+[phone-view]
+display-pos=@Point(10 10)
+call-timeout=2000
+display-font-size=50
+display-cancel-pos=@Point(375 30)
+dialer-back-pos=@Point(10 120)
+call-button-pos=@Point(170 635)
+contacts-button-pos=@Point(10 635)
+label-geometry=@Rect(20 10 350 80)
+contact-dummy-name=Priscila Sobral
+
+[call-board]
+margin=17
+font-size=42
+small-font-size=30
+phone-font-color=#6A6F81
+dial-icon-pos=@Point(17 410)
+dial-button-pos=@Point(0 65)
+mute-button-pos=@Point(144 65)
+speaker-button-pos=@Point(288 65)
+sub-panel-rect=@Rect(15 400 400 200)
+call-label-rect=@Rect(50 10 374 50)
+name-label-rect=@Rect(50 55 374 50)
+phone-label-rect=@Rect(50 110 374 50)
+big-name-label-rect=@Rect(50 0 374 50)
diff --git a/hyperui/resource/864x480/hyperui.qrc b/hyperui/resource/864x480/hyperui.qrc
new file mode 100644
index 0000000..21a16d2
--- /dev/null
+++ b/hyperui/resource/864x480/hyperui.qrc
@@ -0,0 +1,65 @@
+<RCC>
+<qresource>
+ <file>hyperui.ini</file>
+
+ <file>images/background.png</file>
+ <file>images/idle_clock_structure.png</file>
+
+ <file>images/idle_clock_pointers_middle.png</file>
+ <file>images/idle_clock_pointer_hour.png</file>
+ <file>images/idle_clock_pointer_minutes.png</file>
+
+ <file>images/top_bt_back.png</file>
+ <file>images/top_bt_back_disabled.png</file>
+ <file>images/top_bt_options.png</file>
+ <file>images/top_bt_options_disabled.png</file>
+
+ <file>images/top_bar_active.png</file>
+
+ <file>images/screen_unlock.png</file>
+
+ <file>images/menu_bt_phone.png</file>
+ <file>images/menu_bt_chat.png</file>
+ <file>images/menu_bt_email.png</file>
+ <file>images/menu_bt_games.png</file>
+ <file>images/menu_bt_music.png</file>
+ <file>images/menu_bt_navigation.png</file>
+ <file>images/menu_bt_calendar.png</file>
+ <file>images/menu_bt_camera.png</file>
+ <file>images/menu_bt_folder.png</file>
+ <file>images/menu_bt_twitter.png</file>
+ <file>images/menu_bt_web.png</file>
+ <file>images/menu_bt_settings.png</file>
+
+ <file>images/dialer_display_background.png</file>
+ <file>images/dialer_display_bt_cancel.png</file>
+ <file>images/dialer_bt_contacts.png</file>
+ <file>images/dialer_bt_call.png</file>
+ <file>images/dialer_bt_call_over.png</file>
+ <file>images/dialer_bt_endcall.png</file>
+ <file>images/dialer_bt_endcall_over.png</file>
+
+ <file>images/dialer/background.png</file>
+ <file>images/dialer/middle_key.png</file>
+ <file>images/dialer/middle_key_pressed.png</file>
+ <file>images/dialer/bottom_left_key.png</file>
+ <file>images/dialer/bottom_left_key_pressed.png</file>
+ <file>images/dialer/bottom_right_key.png</file>
+ <file>images/dialer/bottom_right_key_pressed.png</file>
+ <file>images/dialer/top_left_key.png</file>
+ <file>images/dialer/top_left_key_pressed.png</file>
+ <file>images/dialer/top_right_key.png</file>
+ <file>images/dialer/top_right_key_pressed.png</file>
+
+ <file>images/dialer_photo.png</file>
+ <file>images/dialer_bk_top.png</file>
+ <file>images/dialer_bk_bottom.png</file>
+ <file>images/dialer_bk_lineexpand.png</file>
+
+ <file>images/dialer_bullet_phone.png</file>
+
+ <file>images/dialer_bt_dialer.png</file>
+ <file>images/dialer_bt_mute.png</file>
+ <file>images/dialer_bt_speaker.png</file>
+</qresource>
+</RCC>
diff --git a/hyperui/resource/864x480/images/background.png b/hyperui/resource/864x480/images/background.png
new file mode 100644
index 0000000..78d3209
--- /dev/null
+++ b/hyperui/resource/864x480/images/background.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/background.png b/hyperui/resource/864x480/images/dialer/background.png
new file mode 100644
index 0000000..20c2a08
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/background.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/bottom_left_key.png b/hyperui/resource/864x480/images/dialer/bottom_left_key.png
new file mode 100644
index 0000000..71963ec
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/bottom_left_key.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/bottom_left_key_pressed.png b/hyperui/resource/864x480/images/dialer/bottom_left_key_pressed.png
new file mode 100644
index 0000000..e012ca9
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/bottom_left_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/bottom_right_key.png b/hyperui/resource/864x480/images/dialer/bottom_right_key.png
new file mode 100644
index 0000000..4236c0d
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/bottom_right_key.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/bottom_right_key_pressed.png b/hyperui/resource/864x480/images/dialer/bottom_right_key_pressed.png
new file mode 100644
index 0000000..c07e151
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/bottom_right_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/middle_key.png b/hyperui/resource/864x480/images/dialer/middle_key.png
new file mode 100644
index 0000000..f27ed17
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/middle_key.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/middle_key_pressed.png b/hyperui/resource/864x480/images/dialer/middle_key_pressed.png
new file mode 100644
index 0000000..5a33774
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/middle_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/top_left_key.png b/hyperui/resource/864x480/images/dialer/top_left_key.png
new file mode 100644
index 0000000..4949a9e
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/top_left_key.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/top_left_key_pressed.png b/hyperui/resource/864x480/images/dialer/top_left_key_pressed.png
new file mode 100644
index 0000000..79b9ed7
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/top_left_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/top_right_key.png b/hyperui/resource/864x480/images/dialer/top_right_key.png
new file mode 100644
index 0000000..4f4dd42
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/top_right_key.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer/top_right_key_pressed.png b/hyperui/resource/864x480/images/dialer/top_right_key_pressed.png
new file mode 100644
index 0000000..9a1b5dc
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer/top_right_key_pressed.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bk_bottom.png b/hyperui/resource/864x480/images/dialer_bk_bottom.png
new file mode 100644
index 0000000..5bfae0a
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bk_bottom.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bk_lineexpand.png b/hyperui/resource/864x480/images/dialer_bk_lineexpand.png
new file mode 100644
index 0000000..3617647
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bk_lineexpand.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bk_top.png b/hyperui/resource/864x480/images/dialer_bk_top.png
new file mode 100644
index 0000000..0e2e8e0
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bk_top.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bt_call.png b/hyperui/resource/864x480/images/dialer_bt_call.png
new file mode 100644
index 0000000..0dbdee3
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bt_call.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bt_call_over.png b/hyperui/resource/864x480/images/dialer_bt_call_over.png
new file mode 100644
index 0000000..0c1b4a2
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bt_call_over.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bt_contacts.png b/hyperui/resource/864x480/images/dialer_bt_contacts.png
new file mode 100644
index 0000000..9e97bfc
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bt_contacts.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bt_dialer.png b/hyperui/resource/864x480/images/dialer_bt_dialer.png
new file mode 100644
index 0000000..59af1da
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bt_dialer.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bt_endcall.png b/hyperui/resource/864x480/images/dialer_bt_endcall.png
new file mode 100644
index 0000000..db59642
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bt_endcall.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bt_endcall_over.png b/hyperui/resource/864x480/images/dialer_bt_endcall_over.png
new file mode 100644
index 0000000..d56cfe5
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bt_endcall_over.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bt_mute.png b/hyperui/resource/864x480/images/dialer_bt_mute.png
new file mode 100644
index 0000000..d39c999
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bt_mute.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bt_speaker.png b/hyperui/resource/864x480/images/dialer_bt_speaker.png
new file mode 100644
index 0000000..71edc62
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bt_speaker.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_bullet_phone.png b/hyperui/resource/864x480/images/dialer_bullet_phone.png
new file mode 100644
index 0000000..3fbcaf3
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_bullet_phone.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_display_background.png b/hyperui/resource/864x480/images/dialer_display_background.png
new file mode 100644
index 0000000..7b9ca17
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_display_background.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_display_bt_cancel.png b/hyperui/resource/864x480/images/dialer_display_bt_cancel.png
new file mode 100644
index 0000000..0005319
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_display_bt_cancel.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/dialer_photo.png b/hyperui/resource/864x480/images/dialer_photo.png
new file mode 100644
index 0000000..45595ae
--- /dev/null
+++ b/hyperui/resource/864x480/images/dialer_photo.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/idle_clock_pointer_hour.png b/hyperui/resource/864x480/images/idle_clock_pointer_hour.png
new file mode 100644
index 0000000..e7cce97
--- /dev/null
+++ b/hyperui/resource/864x480/images/idle_clock_pointer_hour.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/idle_clock_pointer_minutes.png b/hyperui/resource/864x480/images/idle_clock_pointer_minutes.png
new file mode 100644
index 0000000..ea9d08e
--- /dev/null
+++ b/hyperui/resource/864x480/images/idle_clock_pointer_minutes.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/idle_clock_pointers_middle.png b/hyperui/resource/864x480/images/idle_clock_pointers_middle.png
new file mode 100644
index 0000000..f1ef538
--- /dev/null
+++ b/hyperui/resource/864x480/images/idle_clock_pointers_middle.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/idle_clock_structure.png b/hyperui/resource/864x480/images/idle_clock_structure.png
new file mode 100644
index 0000000..5b7509f
--- /dev/null
+++ b/hyperui/resource/864x480/images/idle_clock_structure.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_calendar.png b/hyperui/resource/864x480/images/menu_bt_calendar.png
new file mode 100644
index 0000000..c7f0f5d
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_calendar.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_camera.png b/hyperui/resource/864x480/images/menu_bt_camera.png
new file mode 100644
index 0000000..234b399
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_camera.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_chat.png b/hyperui/resource/864x480/images/menu_bt_chat.png
new file mode 100644
index 0000000..eab4a48
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_chat.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_email.png b/hyperui/resource/864x480/images/menu_bt_email.png
new file mode 100644
index 0000000..97f2047
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_email.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_folder.png b/hyperui/resource/864x480/images/menu_bt_folder.png
new file mode 100644
index 0000000..689e5d3
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_folder.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_games.png b/hyperui/resource/864x480/images/menu_bt_games.png
new file mode 100644
index 0000000..6d265c8
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_games.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_music.png b/hyperui/resource/864x480/images/menu_bt_music.png
new file mode 100644
index 0000000..073e9a3
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_music.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_navigation.png b/hyperui/resource/864x480/images/menu_bt_navigation.png
new file mode 100644
index 0000000..da37631
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_navigation.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_phone.png b/hyperui/resource/864x480/images/menu_bt_phone.png
new file mode 100644
index 0000000..567c76c
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_phone.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_settings.png b/hyperui/resource/864x480/images/menu_bt_settings.png
new file mode 100644
index 0000000..3bcecc4
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_settings.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_twitter.png b/hyperui/resource/864x480/images/menu_bt_twitter.png
new file mode 100644
index 0000000..8cddefb
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_twitter.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/menu_bt_web.png b/hyperui/resource/864x480/images/menu_bt_web.png
new file mode 100644
index 0000000..ecbbdf8
--- /dev/null
+++ b/hyperui/resource/864x480/images/menu_bt_web.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/screen_unlock.png b/hyperui/resource/864x480/images/screen_unlock.png
new file mode 100755
index 0000000..7fcc856
--- /dev/null
+++ b/hyperui/resource/864x480/images/screen_unlock.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/top_bar_active.png b/hyperui/resource/864x480/images/top_bar_active.png
new file mode 100644
index 0000000..561973d
--- /dev/null
+++ b/hyperui/resource/864x480/images/top_bar_active.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/top_bt_back.png b/hyperui/resource/864x480/images/top_bt_back.png
new file mode 100644
index 0000000..0b423b2
--- /dev/null
+++ b/hyperui/resource/864x480/images/top_bt_back.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/top_bt_back_disabled.png b/hyperui/resource/864x480/images/top_bt_back_disabled.png
new file mode 100644
index 0000000..11fa15e
--- /dev/null
+++ b/hyperui/resource/864x480/images/top_bt_back_disabled.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/top_bt_options.png b/hyperui/resource/864x480/images/top_bt_options.png
new file mode 100644
index 0000000..0ffdf4e
--- /dev/null
+++ b/hyperui/resource/864x480/images/top_bt_options.png
Binary files differ
diff --git a/hyperui/resource/864x480/images/top_bt_options_disabled.png b/hyperui/resource/864x480/images/top_bt_options_disabled.png
new file mode 100644
index 0000000..f44045e
--- /dev/null
+++ b/hyperui/resource/864x480/images/top_bt_options_disabled.png
Binary files differ
diff --git a/hyperui/view.cpp b/hyperui/view.cpp
new file mode 100644
index 0000000..ce86e5d
--- /dev/null
+++ b/hyperui/view.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "view.h"
+
+
+View::View(QGraphicsItem *parent)
+ : QGraphicsWidget(parent),
+ m_pageView(0)
+{
+
+}
+
+PageView *View::pageView()
+{
+ return m_pageView;
+}
+
+void View::setPageView(PageView *widget)
+{
+ m_pageView = widget;
+}
+
+QString View::title() const
+{
+ return m_title;
+}
+
+void View::setTitle(const QString &title)
+{
+ if (m_title != title) {
+ m_title = title;
+ emit titleChanged();
+ }
+}
diff --git a/hyperui/view.h b/hyperui/view.h
new file mode 100644
index 0000000..60b101e
--- /dev/null
+++ b/hyperui/view.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: openBossa - INdT (renato.chencarek@openbossa.org)
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** the openBossa stream from INdT (renato.chencarek@openbossa.org).
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef VIEW_H
+#define VIEW_H
+
+#include <QGraphicsWidget>
+
+#include "pageview.h"
+
+
+class View : public QGraphicsWidget
+{
+ Q_OBJECT
+
+public:
+ View(QGraphicsItem *parent = 0);
+
+ QString title() const;
+ void setTitle(const QString &title);
+
+ PageView *pageView();
+
+signals:
+ void titleChanged();
+
+protected:
+ void setPageView(PageView *view);
+
+private:
+ QString m_title;
+ PageView *m_pageView;
+
+ friend class PageView;
+};
+
+#endif