6 #include <QNetworkAccessManager>
7 #include <QNetworkReply>
12 #include "InfoPanel.h"
15 #include <navigation.h>
17 typedef void (*NavWinRaiseCb_t)(void);
19 class MainApp: public QMainWindow
24 explicit MainApp(Navigation *navigation);
26 int AuthenticatePOI(const QString & CredentialsFile);
27 int StartMonitoringUserInput();
28 void setInfoScreen(bool val) { isInfoScreen = val; }
29 void setKeyboard(bool val) { isKeyboard = val; }
30 void setNavWindowRaiseCallback(NavWinRaiseCb_t val) { navWinRaiseCb = val; }
33 void ParseJsonBusinessList(const char* buf, std::vector<Business> & Output);
34 bool eventFilter(QObject *obj, QEvent *ev);
35 void resizeEvent(QResizeEvent* event);
36 void SetDestination(int index = 0);
37 bool IsCoordinatesConsistent(Business & business);
38 void DisplayLineEdit(bool display = true);
39 void DisplayResultList(bool display);
40 void DisplayInformation(bool display);
41 int FillResultList(std::vector<Business> & list, int focusIndex = 0);
42 void SetWayPoints(uint32_t myRoute);
45 NavWinRaiseCb_t navWinRaiseCb = nullptr;
46 QNetworkAccessManager networkManager;
47 QPushButton searchBtn;
50 QMutex mutex; // to protect pointers from concurrent access
52 QString currentSearchingText;
53 QString currentSearchedText;
54 QNetworkReply *pSearchReply;
55 InfoPanel *pInfoPanel;
56 QTreeWidget *pResultList;
57 double currentLatitude;
58 double currentLongitude;
59 double destinationLatitude;
60 double destinationLongitude;
61 uint32_t navicoreSession;
62 uint32_t currentRouteHandle;
66 bool isInputDisplayed;
69 std::vector<Business> Businesses;
73 void getAllSessions_reply(const std::map< uint32_t, std::string >& allSessions);
74 //void getPosition_reply(std::map< int32_t, naviapi::variant > position);
75 void getAllRoutes_reply(std::vector< uint32_t > allRoutes);
76 void createRoute_reply(uint32_t routeHandle);
79 void searchBtnClicked();
80 void textChanged(const QString & text);
81 void textAdded(const QString & text);
82 void keyPressed(int key);
84 void networkReplySearch(QNetworkReply* reply);
85 void UpdateAglSurfaces();
88 void callNavWinRaiseCb() {
96 void allSessionsGotSignal();
97 void positionGotSignal();
98 void allRoutesGotSignal();
99 void routeCreatedSignal();
102 #endif // __MAINAPP_H__