File indexing completed on 2024-04-28 03:49:31
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2012 Dennis Nienhüser <nienhueser@kde.org> 0004 // 0005 0006 #ifndef MARBLE_VOICENAVIGATIONMODEL_H 0007 #define MARBLE_VOICENAVIGATIONMODEL_H 0008 0009 #include "marble_export.h" 0010 0011 #include <QObject> 0012 0013 namespace Marble 0014 { 0015 0016 class Route; 0017 0018 class VoiceNavigationModelPrivate; 0019 0020 class MARBLE_EXPORT VoiceNavigationModel : public QObject 0021 { 0022 Q_OBJECT 0023 0024 Q_PROPERTY(QString speaker READ speaker WRITE setSpeaker NOTIFY speakerChanged) 0025 Q_PROPERTY(bool isSpeakerEnabled READ isSpeakerEnabled WRITE setSpeakerEnabled NOTIFY isSpeakerEnabledChanged ) 0026 Q_PROPERTY(QString instruction READ instruction NOTIFY instructionChanged) 0027 Q_PROPERTY(QString preview READ preview NOTIFY previewChanged) 0028 0029 public: 0030 /** Constructor */ 0031 explicit VoiceNavigationModel( QObject *parent = nullptr ); 0032 0033 /** Destructor */ 0034 ~VoiceNavigationModel() override; 0035 0036 // Initialization 0037 QString speaker() const; 0038 0039 void setSpeaker( const QString &speaker ); 0040 0041 bool isSpeakerEnabled() const; 0042 0043 void setSpeakerEnabled( bool enabled ); 0044 0045 void reset(); 0046 0047 public Q_SLOTS: 0048 void update( const Route &route, qreal distanceManuever, qreal distanceTarget, bool deviated ); 0049 0050 // Turn instructions 0051 QString preview() const; 0052 0053 QString instruction() const; 0054 0055 Q_SIGNALS: 0056 void speakerChanged(); 0057 0058 void isSpeakerEnabledChanged(); 0059 0060 void instructionChanged(); 0061 0062 void previewChanged(); 0063 0064 private: 0065 VoiceNavigationModelPrivate* const d; 0066 friend class VoiceNavigationModelPrivate; 0067 }; 0068 0069 } 0070 0071 #endif // MARBLE_VOICENAVIGATIONMODEL_H