# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
-PROJECT_NAME = "Situare client for Maemo"
+PROJECT_NAME =
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
-OUTPUT_DIRECTORY = doc/doxygen/
+OUTPUT_DIRECTORY =
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
-EXTRACT_PRIVATE = YES
+EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
-EXTRACT_STATIC = YES
+EXTRACT_STATIC = NO
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = src/
+INPUT =
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
-RECURSIVE = YES
+RECURSIVE = NO
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
-EXCLUDE_PATTERNS = */moc_*
+EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
-ALPHABETICAL_INDEX = YES
+ALPHABETICAL_INDEX = NO
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
# Windows users are probably better off using the HTML help feature.
-GENERATE_TREEVIEW = YES
+GENERATE_TREEVIEW = NO
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
# and Class Hierarchy pages using a tree view instead of an ordered list.
-USE_INLINE_TREES = YES
+USE_INLINE_TREES = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
-GENERATE_LATEX = NO
+GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
-HAVE_DOT = YES
+HAVE_DOT = NO
# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
-UML_LOOK = YES
+UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
void SituareEngine::draggingModeTriggered()
{
+ qDebug() << __PRETTY_FUNCTION__;
+
if (m_mce)
m_mce->vibrationFeedback();
}
* location is changed
*
* @param direction Direction in degrees
- * @param distance Distance in kilometers
+ * @param distance Distance in meters
* @param draw Should the indicator triangle be drawn or not
*/
void directionIndicatorValuesUpdate(qreal direction, qreal distance, bool draw);
*/
void setTilesGridSize(const QSize &viewSize);
+ /**
+ * @brief Updates direction and distance values to indicator button
+ *
+ * Calculate and update direction and distance values and send those to indicator button
+ */
void updateDirectionIndicator();
/**
void mapImageReceived(int zoomLevel, int x, int y, const QPixmap &image);
/**
- * @brief Called when MapScroller state is changed
- *
- * Does check if the smooth scroll effect was interrupted and should the auto centering
- * feature to be disabled.
- *
- * @param newState New state
- */
+ * @brief Called when MapScroller state is changed
+ *
+ * Does check if the smooth scroll effect was interrupted and should the auto centering
+ * feature to be disabled.
+ *
+ * @param newState New state
+ */
void scrollerStateChanged(QAbstractAnimation::State newState);
/**
- * @brief Scroll smoothly to given scene position
- *
- * @param coordinate Target position in the scene
- */
+ * @brief Scroll smoothly to given scene position
+ *
+ * @param coordinate Target position in the scene
+ */
void scrollToPosition(SceneCoordinate coordinate);
/**
* location is changed
*
* @param direction Direction in degrees
- * @param distance Distance in kilometers
+ * @param distance Distance in meters
* @param draw Should the indicator triangle be drawn or not
*/
void directionIndicatorValuesUpdate(qreal direction, qreal distance, bool draw);
QSize m_viewSize; ///< Current view size
FriendItemsHandler *m_friendItemsHandler; ///< Handler for friend and group items
- GeoCoordinate m_gpsPosition; ///< Lates GPS position
+ GeoCoordinate m_gpsPosition; ///< Latest GPS position
GPSLocationItem *m_gpsLocationItem; ///< Item pointing current location from GPS
MapFetcher *m_mapFetcher; ///< Fetcher for map tiles
MapRouteItem *m_mapRouteItem; ///< Map route item
USA.
*/
-#include <QSettings>
-#include <QPainter>
#include <QDebug>
+#include <QPainter>
+#include <QSettings>
-#include "indicatorbutton.h"
-#include "panelcommon.h"
#include "common.h"
#include "math.h"
+#include "panelcommon.h"
-enum State {OFF, ON}; ///< Enumerator for led state
-
-const qreal OPACITY = 0.50; ///< Opacity of the background in percents
-const int ROUNDING_RADIUS = 9; ///< Roundness of the rounded edge
-const int BUTTON_WIDTH = 66; ///< Button width
-const int BUTTON_HEIGHT = 66; ///< Button height
+#include "indicatorbutton.h"
-const qreal M_TO_KM = 1000; ///< Meters to kilometers conversion
+enum State {OFF, ON}; ///< Enumerator for led state
IndicatorButton::IndicatorButton(QWidget *parent)
: QToolButton(parent),
m_drawTriangle(false),
m_direction(0)
{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ const qreal OPACITY = 0.50;
+ const int BUTTON_WIDTH = 66;
+ const int BUTTON_HEIGHT = 66;
+
m_indicatorLeds[OFF].load(":res/images/gps_position.png");
m_indicatorLeds[ON].load(":res/images/gps_position_s.png");
+
setFixedSize(BUTTON_WIDTH, BUTTON_HEIGHT);
// Normal background
m_normalColor = new QColor(Qt::black);
m_normalColor->setAlpha(floor(OPACITY * 255));
- // Selected bakcground
+ // Selected background
m_selectedGradient = new QLinearGradient(0, 0, 0, this->height());
m_selectedGradient->setColorAt(0.02, QColor(0, 113, 181));
m_selectedGradient->setColorAt(0.25, QColor(24, 142, 214));
delete m_selectedGradient;
}
-void IndicatorButton::setDirection(qreal direction, bool draw)
+const QPoint& IndicatorButton::eventPosition()
{
qDebug() << __PRETTY_FUNCTION__;
- m_direction = direction;
- m_drawTriangle = draw;
-
- update();
+ return m_eventPosition;
}
void IndicatorButton::mouseMoveEvent(QMouseEvent *event)
event->ignore();
}
-const QPoint& IndicatorButton::eventPosition()
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- return m_eventPosition;
-}
-
void IndicatorButton::paintEvent(QPaintEvent *event)
{
qDebug() << __PRETTY_FUNCTION__;
+ const int ROUNDING_RADIUS = 9;
+
Q_UNUSED(event);
QPainterPath backgroundPath;
}
}
+void IndicatorButton::setDirection(qreal direction, bool draw)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_direction = direction;
+ m_drawTriangle = draw;
+
+ update();
+}
+
Situare - A location system for Facebook
Copyright (C) 2010 Ixonos Plc. Authors:
- Kaj Wallin - kaj.wallin@ixonos.com
Katri Kaikkonen - katri.kaikkonen@ixonos.com
+ Kaj Wallin - kaj.wallin@ixonos.com
Sami Rämö - sami.ramo@ixonos.com
Situare is free software; you can redistribute it and/or
#define INDICATORBUTTON_H
#include <QMouseEvent>
+#include <QTimer>
#include <QToolButton>
#include <QWidget>
-#include <QTimer>
/**
* @brief Indicator button class
USA.
*/
-#include <QSettings>
-#include <QPainter>
#include <QDebug>
+#include <QPainter>
+#include <QSettings>
-#include "indicatorbuttonpanel.h"
+#include "common.h"
#include "indicatorbutton.h"
#include "panelcommon.h"
-#include "common.h"
+#include "indicatorbuttonpanel.h"
-const int ROUNDING_RADIUS = 9; ///< Roundness of the background edges
-const qreal OPACITY = 0.50; ///< Opacity of the background in percents
+const QString DIRECTION_INDICATOR_BUTTON_POSITION = "DIRECTION_INDICATOR_POSITION";
IndicatorButtonPanel::IndicatorButtonPanel(QWidget *parent)
: QWidget(parent),
- m_indicatorButton(0),
m_isDraggable(false),
m_distanceText("")
{
- /**
- * @brief Horizontal position of direction indicator button
- *
- * @var DIRECTION_INDICATOR_POSITION_X
- */
- const int DIRECTION_INDICATOR_POSITION_X = 10 + PANEL_PEEK_AMOUNT;
- const int DIRECTION_INDICATOR_POSITION_Y = 290; ///< Vertical position of indicator button
-
- const QString DIRECTION_INDICATOR_BUTTON_POSITION = "Direction_Indicator_Position";
+ qDebug() << __PRETTY_FUNCTION__;
- const int MARGIN_LEFT = 0; ///< Inner margin (left)
- const int MARGIN_TOP = 3; ///< Inner margin (top)
- const int MARGIN_RIGHT = 0; ///< Inner margin (right)
- const int MARGIN_BOTTOM = 0; ///< Inner margin (bottom)
- const int LABEL_MARGIN_TOP = 0; ///< Distance text label inner margin (top)
+ const int DIRECTION_INDICATOR_POSITION_X = 10 + PANEL_PEEK_AMOUNT;
+ const int DIRECTION_INDICATOR_POSITION_Y = 290;
- const int INDICATOR_BUTTON_PANEL_SPACING = 5; ///< Size of a indicator button spacing
+ const int INDICATOR_BUTTON_PANEL_SPACING = 5;
- const int PANEL_WIDTH = 90; ///< Width of the draggable panel
- const int PANEL_HEIGHT = 100; ///< Height of the draggable panel
+ const qreal OPACITY = 0.50;
+ const int MARGIN_LEFT = 0;
+ const int MARGIN_TOP = 3;
+ const int MARGIN_RIGHT = 0;
+ const int MARGIN_BOTTOM = 0;
+ const int LABEL_MARGIN_TOP = 0;
- qDebug() << __PRETTY_FUNCTION__;
+ const int PANEL_WIDTH = 90;
+ const int PANEL_HEIGHT = 100;
QVBoxLayout *verticalLayout = new QVBoxLayout;
setLayout(verticalLayout);
connect(m_dragStartTimer, SIGNAL(timeout()),
this, SLOT(timerExpired()));
+
connect(m_forceReleaseTimer, SIGNAL(timeout()),
this, SLOT(forceMouseRelease()));
this, SIGNAL(autoCenteringTriggered(bool)));
}
+void IndicatorButtonPanel::forceMouseRelease()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ releaseMouse();
+ setDraggable(false);
+}
+
void IndicatorButtonPanel::mouseMoveEvent(QMouseEvent *event)
{
qDebug() << __PRETTY_FUNCTION__;
{
qDebug() << __PRETTY_FUNCTION__;
- if (event->button() == Qt::LeftButton)
- m_dragPosition = event->pos();
-
+ m_dragPosition = event->pos();
m_dragStartTimer->start();
}
QSettings settings(DIRECTORY_NAME, FILE_NAME);
settings.setValue(DIRECTION_INDICATOR_BUTTON_POSITION, pos());
-
- releaseMouse();
}
}
painter.setRenderHint(QPainter::Antialiasing);
if (!m_indicatorButton->isChecked()) {
- const int ADJUST_LEFT = -5; ///< Pixels added to the rectangle (left)
- const int ADJUST_TOP = 0; ///< Pixels added to the rectangle (top)
- const int ADJUST_RIGHT = +5; ///< Pixels added to the rectangle (right)
- const int ADJUST_BOTTOM = 0; ///< Pixels added to the rectangle (bottom)
+ const int EXTRA_SPACE_LEFT = -5;
+ const int EXTRA_SPACE_TOP = 0;
+ const int EXTRA_SPACE_RIGHT = +5;
+ const int EXTRA_SPACE_BOTTOM = 0;
- const int RADIUS_WIDTH = 5; ///< Roundness width
- const int RADIUS_HEIGHT = 5; ///< Roundness height
+ const int RADIUS_WIDTH = 5;
+ const int RADIUS_HEIGHT = 5;
QPainterPath backgroundPath;
QRect distanceLabelRect = m_distanceTextLabel->rect();
distanceLabelRect.translate(m_distanceTextLabel->pos());
- distanceLabelRect.adjust(ADJUST_LEFT, ADJUST_TOP, ADJUST_RIGHT, ADJUST_BOTTOM);
+ distanceLabelRect.adjust(EXTRA_SPACE_LEFT, EXTRA_SPACE_TOP, EXTRA_SPACE_RIGHT
+ , EXTRA_SPACE_BOTTOM);
backgroundPath.addRoundedRect(distanceLabelRect, RADIUS_WIDTH, RADIUS_HEIGHT);
painter.fillPath(backgroundPath, QBrush(*m_normalColor));
}
if(m_isDraggable) {
+ const int ROUNDING_RADIUS = 9;
+
QPainterPath backgroundPath;
backgroundPath.addRoundedRect(this->rect(), ROUNDING_RADIUS, ROUNDING_RADIUS);
- painter.setRenderHint(QPainter::Antialiasing);
painter.fillPath(backgroundPath, QBrush(Qt::Dense4Pattern));
painter.setPen(Qt::black);
}
qDebug() << __PRETTY_FUNCTION__;
m_isDraggable = mode;
- emit draggingModeTriggered();
if(mode) {
+ emit draggingModeTriggered();
grabMouse();
m_forceReleaseTimer->start();
m_dragPosition = eventPosition;
update();
}
-void IndicatorButtonPanel::setIndicatorButtonEnabled(bool enabled)
-{
- m_indicatorButton->setChecked(enabled);
-}
-
void IndicatorButtonPanel::screenResized(const QSize &newSize)
{
qDebug() << __PRETTY_FUNCTION__;
move(resizedPosition);
}
-void IndicatorButtonPanel::forceMouseRelease()
+void IndicatorButtonPanel::setIndicatorButtonEnabled(bool enabled)
{
- qDebug() << __PRETTY_FUNCTION__;
-
- releaseMouse();
- setDraggable(false);
+ m_indicatorButton->setChecked(enabled);
+ m_distanceTextLabel->setVisible(!enabled);
}
void IndicatorButtonPanel::timerExpired()
{
qDebug() << __PRETTY_FUNCTION__;
- const int SMALL_REDUCE = 0.5; ///< 0.5 meter reduce
- const int BIG_REDUCE = 100; ///< 100 meter reduce
+ const int MAX_TO_METERS = 1000 - 0.5;
+ const int MAX_FOR_KM_WITH_DESIMAL = 100000 - 50;
+ const int MIN_TO_METERS = 10.0;
const qreal M_TO_KM = 1000.0; ///< Meters to kilometers conversion
+ QString UNIT_KILOMETER = " km";
+ QString UNIT_METER = " m";
+
m_indicatorButton->setDirection(direction, draw);
m_distance = distance;
- if(m_distance < 10.0)
- {
- m_distanceText.setNum(10);
- m_distanceText.prepend("< ");
- m_distanceText.append(" m");
- }
- else if(m_distance < 1000 - SMALL_REDUCE)
- {
- m_distanceText.setNum(m_distance, 0 , 0);
- m_distanceText.append(" m");
- }
- else if(m_distance < 100000 - BIG_REDUCE)
- {
- m_distanceText.setNum(m_distance / M_TO_KM, 1, 1);
- m_distanceText.append(" km");
- }
- else {
- m_distanceText.setNum(m_distance / M_TO_KM, 0, 0);
- m_distanceText.append(" km");
- }
-
- if (!m_indicatorButton->isChecked()) {
- m_distanceTextLabel->setText(m_distanceText);
- }
- else {
- m_distanceTextLabel->setText("");
- }
- update();
+ if(m_distance < MIN_TO_METERS)
+ {
+ m_distanceText.setNum(10);
+ m_distanceText.prepend("< ");
+ m_distanceText.append(UNIT_METER);
+ }
+ else if(m_distance < MAX_TO_METERS)
+ {
+ m_distanceText.setNum(m_distance, 0 , 0);
+ m_distanceText.append(UNIT_METER);
}
+ else if(m_distance < MAX_FOR_KM_WITH_DESIMAL)
+ {
+ m_distanceText.setNum(m_distance / M_TO_KM, 1, 1);
+ m_distanceText.append(UNIT_KILOMETER);
+ }
+ else {
+ m_distanceText.setNum(m_distance / M_TO_KM, 0, 0);
+ m_distanceText.append(UNIT_KILOMETER);
+ }
+
+ m_distanceTextLabel->setText(m_distanceText);
+
+ update();
+}
#include <QGraphicsItem>
#include <QGridLayout>
+#include <QLabel>
#include <QMouseEvent>
-#include <QWidget>
#include <QTimer>
-#include <QLabel>
+#include <QWidget>
#include "indicatorbutton.h"
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
public slots:
-
/**
- * @brief Called when direction and distance from current map center point to current GPS
- * location is changed
- *
- * @param direction Direction in degrees
- * @param distance Distance in kilometers
- * @param draw Should the indicator triangle be drawn or not
- */
+ * @brief Called when direction and distance from current map center point to current GPS
+ * location is changed
+ *
+ * @param direction Direction in degrees
+ * @param distance Distance in meters
+ * @param draw Should the indicator triangle be drawn or not
+ */
void updateValues(qreal direction, qreal distance, bool draw);
+ /**
+ * @brief Set indicator button enabled.
+ *
+ * @param enabled true if enabled, false otherwise
+ */
void setIndicatorButtonEnabled(bool enabled);
/**
* @brief Toggle zoom panel draggability
+ *
+ * @param mode True if draggable, otherwise false
+ * @param distance Start value for dragging
*/
void setDraggable(bool mode, QPoint eventPosition = QPoint(0,0));
* SIGNALS
******************************************************************************/
signals:
-
/**
* @brief Automatic centering setting changed by user
*
void autoCenteringTriggered(bool enabled);
/**
- * @brief Signal when direction and distance from current map center point to current GPS
- * location is changed
- *
- * @param direction Direction in degrees
- * @param distance Distance in kilometers
- * @param draw Should the indicator triangle be drawn or not
- */
+ * @brief Signal when direction and distance from current map center point to current GPS
+ * location is changed
+ *
+ * @param direction Direction in degrees
+ * @param distance Distance in meters
+ * @param draw Should the indicator triangle be drawn or not
+ */
void directionIndicatorValuesUpdate(qreal direction, qreal distance, bool draw);
/**
- * @brief Dragging mode triggered.
- */
+ * @brief Dragging mode triggered.
+ */
void draggingModeTriggered();
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
-//public:
-// IndicatorButton *m_indicatorButton; ///< Indicator button
-
private:
- IndicatorButton *m_indicatorButton; ///< Indicator button
-
bool m_isDraggable; ///< Boolean for tracking the draggability state
qreal m_distance; ///< Distance to the GPS position
QTimer *m_dragStartTimer; ///< Timer to init draggability of the zoom panel
QTimer *m_forceReleaseTimer; ///< Timer to run forceMouseRelease;
+ IndicatorButton *m_indicatorButton; ///< Indicator button
};
#endif // INDICATORBUTTONPANEL_H
Jussi Laitinen jussi.laitinen@ixonos.com
Sami Rämö - sami.ramo@ixonos.com
Ville Tiensuu - ville.tiensuu@ixonos.com
+ Katri Kaikkonen - katri.kaikkonen@ixonos.com
Situare is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
#include "error.h"
#include "friendlistpanel.h"
#include "fullscreenbutton.h"
-#include "indicatorbutton.h"
#include "logindialog.h"
#include "mapscale.h"
#include "searchdialog.h"
m_password(),
m_webView(0),
m_fullScreenButton(0),
-// m_indicatorButton(0),
m_indicatorButtonPanel(0),
m_mapScale(0),
m_cookieJar(0)
const QString username();
public slots:
-
/**
- * @brief Build direction indicator button and connect slots
+ * @brief Build direction indicator button panel and connect signals
*/
void buildIndicatorButtonPanel();
* location is changed
*
* @param direction Direction in degrees
- * @param distance Distance in kilometers
+ * @param distance Distance in meters
* @param draw Should the indicator triangle be drawn or not
*/
void directionIndicatorValuesUpdate(qreal direction, qreal distance, bool draw);
FriendListPanel *m_friendsListPanel; ///< Instance of friends list panel
FullScreenButton *m_fullScreenButton; ///< Instance of the fullscreen toggle button
-// IndicatorButton *m_indicatorButton; ///< Instance of direction indicator button
IndicatorButtonPanel *m_indicatorButtonPanel; ///< Instance of direction indicator button
MapScale *m_mapScale; ///< Instance of the map scale
MapView *m_mapView; ///< Instance of the map view