6 #include <QNetworkAccessManager>
7 #include <QNetworkReply>
12 #include "InfoPanel.h"
15 #include <libnavicore.hpp>
17 class MainApp: public QMainWindow, public naviapi::NavicoreListener
24 bool CheckNaviApi(int argc, char *argv[]);
25 int AuthenticatePOI(const QString & CredentialsFile);
26 int StartMonitoringUserInput();
27 void setInfoScreen(bool val) { isInfoScreen = val; }
28 void setKeyboard(bool val) { isKeyboard = val; }
31 void ParseJsonBusinessList(const char* buf, std::vector<Business> & Output);
32 bool eventFilter(QObject *obj, QEvent *ev);
33 void resizeEvent(QResizeEvent* event);
34 void SetDestination(int index = 0);
35 bool IsCoordinatesConsistent(Business & business);
36 void DisplayLineEdit(bool display = true);
37 void DisplayResultList(bool display, bool RefreshDisplay = true);
38 void DisplayInformation(bool display, bool RefreshDisplay = true);
39 int FillResultList(std::vector<Business> & list, int focusIndex = 0);
40 void SetWayPoints(uint32_t myRoute);
42 naviapi::Navicore naviapi;
43 QNetworkAccessManager networkManager;
44 QPushButton searchBtn;
47 QMutex mutex; // to protect pointers from concurrent access
49 QString currentSearchingText;
50 QString currentSearchedText;
51 QNetworkReply *pSearchReply;
52 InfoPanel *pInfoPanel;
53 QTreeWidget *pResultList;
54 double currentLatitude;
55 double currentLongitude;
56 double destinationLatitude;
57 double destinationLongitude;
58 uint32_t navicoreSession;
59 uint32_t currentRouteHandle;
63 bool isInputDisplayed;
66 std::vector<Business> Businesses;
70 void getAllSessions_reply(const std::map< uint32_t, std::string >& allSessions);
71 void getPosition_reply(std::map< int32_t, naviapi::variant > position);
72 void getAllRoutes_reply(std::vector< uint32_t > allRoutes);
73 void createRoute_reply(uint32_t routeHandle);
76 void searchBtnClicked();
77 void textChanged(const QString & text);
78 void textAdded(const QString & text);
79 void keyPressed(int key);
81 void networkReplySearch(QNetworkReply* reply);
82 void UpdateAglSurfaces();
86 void allSessionsGot();
92 void allSessionsGotSignal();
93 void positionGotSignal();
94 void allRoutesGotSignal();
95 void routeCreatedSignal();
98 #endif // __MAINAPP_H__