source: calamares/trunk/fuentes/src/modules/locale/timezonewidget/timezonewidget.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 17 months ago

sync with github

File size: 2.3 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014, Teo Mrnjavac <teo@kde.org>
4 *
5 *   Originally from the Manjaro Installation Framework
6 *   by Roland Singer <roland@manjaro.org>
7 *   Copyright (C) 2007 Free Software Foundation, Inc.
8 *
9 *   Calamares is free software: you can redistribute it and/or modify
10 *   it under the terms of the GNU General Public License as published by
11 *   the Free Software Foundation, either version 3 of the License, or
12 *   (at your option) any later version.
13 *
14 *   Calamares is distributed in the hope that it will be useful,
15 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 *   GNU General Public License for more details.
18 *
19 *   You should have received a copy of the GNU General Public License
20 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef TIMEZONEWIDGET_H
24#define TIMEZONEWIDGET_H
25
26#include <QWidget>
27#include <QPainter>
28#include <QImage>
29#include <QFile>
30#include <QTextStream>
31#include <QList>
32#include <QStringList>
33#include <QMouseEvent>
34#include <QFontMetrics>
35#include <QFont>
36#include "localeglobal.h"
37
38
39#define RGB_TRANSPARENT 0
40#define ZONES "0.0 1.0 2.0 3.0 3.5 4.0 4.5 5.0 5.5 5.75 6.0 6.5 7.0 8.0 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.75 13.0 -1.0 -2.0 -3.0 -3.5 -4.0 -4.5 -5.0 -5.5 -6.0 -7.0 -8.0 -9.0 -9.5 -10.0 -11.0"
41#define X_SIZE 780
42#define Y_SIZE 340
43
44
45class TimeZoneWidget : public QWidget
46{
47    Q_OBJECT
48public:
49    explicit TimeZoneWidget( QWidget* parent = nullptr );
50
51    LocaleGlobal::Location getCurrentLocation()
52    {
53        return currentLocation;
54    }
55    void setCurrentLocation( QString region, QString zone );
56    void setCurrentLocation( LocaleGlobal::Location location );
57
58signals:
59    void locationChanged( LocaleGlobal::Location location );
60
61private:
62    QFont font;
63    QImage background, pin, currentZoneImage;
64    QList<QImage> timeZoneImages;
65    LocaleGlobal::Location currentLocation;
66
67    QPoint getLocationPosition( const LocaleGlobal::Location& l )
68    {
69        return getLocationPosition( l.longitude, l.latitude );
70    }
71    QPoint getLocationPosition( double longitude, double latitude );
72
73    void paintEvent( QPaintEvent* event );
74    void mousePressEvent( QMouseEvent* event );
75};
76
77#endif // TIMEZONEWIDGET_H
Note: See TracBrowser for help on using the repository browser.