~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to src/plugins/gps_importer/qgsgpsplugin.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
                          qgsgpsplugin.h 
 
2
                          qgsgpsplugin.h
3
3
 Functions:
4
4
                             -------------------
5
5
    begin                : Jan 21, 2004
6
6
    copyright            : (C) 2004 by Tim Sutton
7
7
    email                : tim@linfiniti.com
8
 
  
 
8
 
9
9
 ***************************************************************************/
10
10
 
11
11
/***************************************************************************
16
16
 *   (at your option) any later version.                                   *
17
17
 *                                                                         *
18
18
 ***************************************************************************/
19
 
 /*  $Id: qgsgpsplugin.h 5802 2006-09-10 02:08:13Z g_j_m $ */
 
19
/*  $Id$ */
20
20
#ifndef QGSGPSPLUGIN_H
21
21
#define QGSGPSPLUGIN_H
22
22
#include "qgsbabelformat.h"
23
23
#include "qgsgpsdevice.h"
24
 
#include "../qgisplugin.h"
25
 
 
26
 
#include <qgisapp.h>
27
 
 
 
24
#include "qgisplugin.h"
 
25
 
 
26
class QgisInterface;
28
27
class QgsVectorLayer;
 
28
class QAction;
29
29
 
30
30
/** A plugin with various GPS tools.
31
31
*/
32
 
class QgsGPSPlugin:public QObject, public QgisPlugin
 
32
class QgsGPSPlugin: public QObject, public QgisPlugin
33
33
{
34
 
  Q_OBJECT
35
 
public:
36
 
  /** Constructor for a plugin. The QgisApp and QgisIface pointers 
37
 
      are passed by QGIS when it attempts to instantiate the plugin.
38
 
      @param qgis Pointer to the QgisApp object
39
 
      @param qI Pointer to the QgisIface object. 
40
 
  */
41
 
  QgsGPSPlugin(QgisApp * , QgisIface * );
42
 
 
43
 
  //! Destructor
44
 
  virtual ~QgsGPSPlugin();
45
 
 
46
 
public slots:
47
 
  //! init the gui
48
 
  virtual void initGui();
49
 
  //! Show the dialog box
50
 
  void run();
51
 
  //! Create a new GPX layer
52
 
  void createGPX();
53
 
  //! Add a vector layer given vectorLayerPath, baseName, providerKey
54
 
  void drawVectorLayer(QString,QString,QString);
55
 
  //! unload the plugin
56
 
  void unload();
57
 
  //! show the help document
58
 
  void help();
59
 
  
60
 
  //! load a GPX file
61
 
  void loadGPXFile(QString filename, bool loadWaypoints, bool loadRoutes,
62
 
                   bool loadTracks);
63
 
  void importGPSFile(QString inputFilename, QgsBabelFormat* importer, 
64
 
                     bool importWaypoints, bool importRoutes, 
65
 
                     bool importTracks, QString outputFilename, 
66
 
                     QString layerName);
67
 
  void downloadFromGPS(QString device, QString port,
68
 
                       bool downloadWaypoints, bool downloadRoutes,
69
 
                       bool downloadTracks, QString outputFilename,
70
 
                       QString layerName);
71
 
  void uploadToGPS(QgsVectorLayer* gpxLayer, QString device,
72
 
                   QString port);
73
 
 
74
 
signals:
75
 
  
76
 
  void closeGui();
77
 
 
78
 
private:
79
 
  
80
 
  //! Initializes all variables needed to run GPSBabel.
81
 
  void setupBabel();
82
 
 
83
 
  //! Pointer to our menu
84
 
  QgisApp *mMainWindowPointer;
85
 
  //! Pointer to the QGIS interface object
86
 
  QgisIface *mQGisInterface;
87
 
  //! Pointer to the QAction object used in the menu and toolbar
88
 
  QAction *mQActionPointer;
89
 
  //! Pointer to the QAction used for creating a new GPX layer
90
 
  QAction *mCreateGPXAction;
91
 
  //! The path to the GPSBabel program
92
 
  QString mBabelPath;
93
 
  //! Importers for external GPS data file formats
94
 
  std::map<QString, QgsBabelFormat*> mImporters;
95
 
  //! Upload/downloaders for GPS devices
96
 
  std::map<QString, QgsGPSDevice*> mDevices;
 
34
    Q_OBJECT
 
35
  public:
 
36
    /** Constructor for a plugin. The QgisInterface pointer
 
37
        is passed by QGIS when it attempts to instantiate the plugin.
 
38
        @param qI Pointer to the QgisInterface object.
 
39
    */
 
40
    QgsGPSPlugin( QgisInterface * );
 
41
 
 
42
    //! Destructor
 
43
    virtual ~QgsGPSPlugin();
 
44
 
 
45
  public slots:
 
46
    //! init the gui
 
47
    virtual void initGui();
 
48
    //! Show the dialog box
 
49
    void run();
 
50
    //! Create a new GPX layer
 
51
    void createGPX();
 
52
    //! Add a vector layer given vectorLayerPath, baseName, providerKey
 
53
    void drawVectorLayer( QString, QString, QString );
 
54
    //! unload the plugin
 
55
    void unload();
 
56
    //! show the help document
 
57
    void help();
 
58
    //! update the plugins theme when the app tells us its theme is changed
 
59
    void setCurrentTheme( QString theThemeName );
 
60
 
 
61
    //! load a GPX file
 
62
    void loadGPXFile( QString fileName, bool loadWaypoints, bool loadRoutes,
 
63
                      bool loadTracks );
 
64
    void importGPSFile( QString inputFileName, QgsBabelFormat* importer,
 
65
                        bool importWaypoints, bool importRoutes,
 
66
                        bool importTracks, QString outputFileName,
 
67
                        QString layerName );
 
68
    void convertGPSFile( QString inputFileName,
 
69
                         int convertType,
 
70
                         QString outputFileName,
 
71
                         QString layerName );
 
72
    void downloadFromGPS( QString device, QString port,
 
73
                          bool downloadWaypoints, bool downloadRoutes,
 
74
                          bool downloadTracks, QString outputFileName,
 
75
                          QString layerName );
 
76
    void uploadToGPS( QgsVectorLayer* gpxLayer, QString device,
 
77
                      QString port );
 
78
 
 
79
  signals:
 
80
 
 
81
    void closeGui();
 
82
 
 
83
  private:
 
84
 
 
85
    //! Initializes all variables needed to run GPSBabel.
 
86
    void setupBabel();
 
87
 
 
88
    //! Pointer to the QGIS interface object
 
89
    QgisInterface *mQGisInterface;
 
90
    //! Pointer to the QAction object used in the menu and toolbar
 
91
    QAction *mQActionPointer;
 
92
    //! Pointer to the QAction used for creating a new GPX layer
 
93
    QAction *mCreateGPXAction;
 
94
    //! The path to the GPSBabel program
 
95
    QString mBabelPath;
 
96
    //! Importers for external GPS data file formats
 
97
    std::map<QString, QgsBabelFormat*> mImporters;
 
98
    //! Upload/downloaders for GPS devices
 
99
    std::map<QString, QgsGPSDevice*> mDevices;
97
100
};
98
101
 
99
102
#endif