cleanup specfile for packaging
[profile/ivi/gpsd.git] / libgpsmm.h
1 #ifndef _GPSD_GPSMM_H_
2 #define _GPSD_GPSMM_H_
3
4 /*
5  * Copyright (C) 2005 Alfredo Pironti
6  *
7  * This software is distributed under a BSD-style license. See the
8  * file "COPYING" in the toop-level directory of the distribution for details.
9  *
10  */
11 #include <sys/types.h>
12 #include "gps.h" //the C library we are going to wrap
13
14 #ifndef USE_QT
15 class gpsmm {
16 #else
17 #include "libQgpsmm_global.h"
18 class LIBQGPSMMSHARED_EXPORT gpsmm {
19 #endif
20         public:
21                 gpsmm();
22                 virtual ~gpsmm();
23                 struct gps_data_t* open(const char *host,const char *port); //opens the connection with gpsd, MUST call this before any other method
24                 struct gps_data_t* open(void); //open() with default values
25                 struct gps_data_t* send(const char *request); //put a command to gpsd and return the updated struct
26                 struct gps_data_t* stream(int); //set watcher and policy flags
27                 struct gps_data_t* poll(void); //block until gpsd returns new data, then return the updated struct
28                 int close(void);        // close the GPS
29                 bool waiting(void);     //nonblocking check for data waitin
30                 void clear_fix(void);
31                 void enable_debug(int, FILE*);
32         private:
33                 struct gps_data_t *gps_data;
34                 struct gps_data_t *to_user;     //we return the user a copy of the internal structure. This way she can modify it without
35                                                 //integrity loss for the entire class
36                 struct gps_data_t* backup(void) { *to_user=*gps_data; return to_user;}; //return the backup copy
37 };
38 #endif // _GPSD_GPSMM_H_