Updraft  1.0
Open source glider flight visualisation tool.
turnpoints.h
Go to the documentation of this file.
00001 #ifndef UPDRAFT_SRC_PLUGINS_TURNPOINTS_TURNPOINTS_H_
00002 #define UPDRAFT_SRC_PLUGINS_TURNPOINTS_TURNPOINTS_H_
00003 
00004 #include <QtGui>
00005 #include "../../pluginbase.h"
00006 #include "../../core/ui/maplayergroup.h"
00007 
00008 #include "tplayer.h"
00009 
00010 #ifdef turnpoints_EXPORTS
00011 # define TPS_EXPORT Q_DECL_EXPORT
00012 #else
00013 # define TPS_EXPORT Q_DECL_IMPORT
00014 #endif
00015 
00016 namespace Updraft {
00017 
00018 typedef QMap<MapLayerInterface*, TPLayer*> TTPLayerMap;
00019 
00021 class TPS_EXPORT TurnPoints : public QObject, public PluginBase {
00022   Q_OBJECT
00023   Q_INTERFACES(Updraft::PluginBase)
00024 
00025  public:
00026   TurnPoints();
00027 
00028   virtual ~TurnPoints();
00029 
00030   QString getName();
00031 
00032   void initialize(CoreInterface *coreInterface);
00033 
00034   void deinitialize();
00035 
00036   bool fileOpen(const QString &filename, int roleId);
00037 
00038   void fileIdentification(QStringList *roles,
00039     QString *importDirectory, const QString &filename);
00040 
00041   void fillContextMenu(MapObject* obj, MenuInterface* menu);
00042   bool wantsToHandleClick(MapObject* obj);
00043   void handleClick(MapObject* obj, const EventInfo* evt);
00044  public slots:
00045   void mapLayerDisplayed(bool value, MapLayerInterface* sender);
00046 
00047  private slots:
00048   void contextMenuRequested(QPoint pos, MapLayerInterface *sender);
00049 
00052   void deleteTpLayer();
00053 
00054  private:
00055   enum FileRoles {
00056     IMPORT_CUP_FILE = 1
00057   };
00058 
00060   MapLayerInterface* layerToDelete;
00061 
00063   TTPLayerMap layers;
00064 
00066   MapLayerGroupInterface *mapLayerGroup;
00067 
00069   FileRegistration cupTPsReg;
00070 
00072   void loadImportedFiles();
00073 
00075   void unloadFiles();
00076 
00079   void addLayer(TPFile *file);
00080 
00082   QVector<SettingInterface*> settings;
00083 };
00084 
00085 }  // End namespace Updraft
00086 
00087 #endif  // UPDRAFT_SRC_PLUGINS_TURNPOINTS_TURNPOINTS_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines