~ubuntu-branches/ubuntu/saucy/merkaartor/saucy

« back to all changes in this revision

Viewing changes to plugins/background/MYahooTiledBackground/yahootiledmapadapter.h

Tags: upstream-0.15.3+svn20934
ImportĀ upstreamĀ versionĀ 0.15.3+svn20934

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
*/
32
32
class YahooTiledMapAdapter : public QObject, public IMapAdapter
33
33
{
34
 
        Q_OBJECT
35
 
        Q_INTERFACES(IMapAdapter)
 
34
    Q_OBJECT
 
35
    Q_INTERFACES(IMapAdapter)
36
36
 
37
37
public:
38
 
        //! constructor
39
 
        /*!
40
 
         * This construct a Yahoo Adapter
41
 
         */
42
 
        YahooTiledMapAdapter();
43
 
        virtual ~YahooTiledMapAdapter();
44
 
 
45
 
 
46
 
        //! returns the unique identifier (Uuid) of this MapAdapter
47
 
        /*!
48
 
         * @return  the unique identifier (Uuid) of this MapAdapter
49
 
         */
50
 
        virtual QUuid   getId           () const;
51
 
 
52
 
        //! returns the type of this MapAdapter
53
 
        /*!
54
 
         * @return  the type of this MapAdapter
55
 
         */
56
 
        virtual IMapAdapter::Type       getType         () const;
57
 
 
58
 
        //! returns the name of this MapAdapter
59
 
        /*!
60
 
         * @return  the name of this MapAdapter
61
 
         */
62
 
        virtual QString getName         () const;
63
 
 
64
 
        //! returns the host of this MapAdapter
65
 
        /*!
66
 
         * @return  the host of this MapAdapter
67
 
         */
68
 
        virtual QString getHost         () const;
69
 
 
70
 
        //! returns the size of the tiles
71
 
        /*!
72
 
         * @return the size of the tiles
73
 
         */
74
 
        virtual int             getTileSize     () const;
75
 
 
76
 
        //! returns the min zoom value
77
 
        /*!
78
 
         * @return the min zoom value
79
 
         */
80
 
        virtual int             getMinZoom      () const;
81
 
 
82
 
        //! returns the max zoom value
83
 
        /*!
84
 
         * @return the max zoom value
85
 
         */
86
 
        virtual int             getMaxZoom      () const;
87
 
 
88
 
        //! returns the current zoom
89
 
        /*!
90
 
         * @return the current zoom
91
 
         */
92
 
        virtual int             getZoom         () const;
93
 
 
94
 
        virtual int             getAdaptedZoom()   const;
95
 
        virtual int     getAdaptedMinZoom       () const;
96
 
        virtual int             getAdaptedMaxZoom       () const;
97
 
 
98
 
        virtual void    zoom_in();
99
 
        virtual void    zoom_out();
100
 
 
101
 
        virtual bool    isValid(int x, int y, int z) const;
102
 
        virtual QString getQuery(int x, int y, int z) const;
103
 
        virtual QString getQuery(const QRectF& wgs84Bbox, const QRectF& projBbox, const QRect& size) const  { return ""; }
104
 
        virtual QPixmap getPixmap(const QRectF& wgs84Bbox, const QRectF& projBbox, const QRect& size) const { return QPixmap(); };
105
 
 
106
 
        //! translates a world coordinate to display coordinate
107
 
        /*!
108
 
         * The calculations also needs the current zoom. The current zoom is managed by the MapAdapter, so this is no problem.
109
 
         * To divide model from view the current zoom should be moved to the layers.
110
 
         * @param  coordinate the world coordinate
111
 
         * @return the display coordinate (in widget coordinates)
112
 
         */
113
 
        virtual QPoint          coordinateToDisplay(const QPointF& coordinate) const;
114
 
 
115
 
        //! translates display coordinate to world coordinate
116
 
        /*!
117
 
         * The calculations also needs the current zoom. The current zoom is managed by the MapAdapter, so this is no problem.
118
 
         * To divide model from view the current zoom should be moved to the layers.
119
 
         * @param  point the display coordinate
120
 
         * @return the world coordinate
121
 
         */
122
 
        virtual QPointF displayToCoordinate(const QPoint& point) const;
123
 
 
124
 
        virtual bool isTiled() const { return true; };
125
 
        virtual QString projection() const;
126
 
 
127
 
        virtual QMenu* getMenu() const { return NULL; }
128
 
 
129
 
        virtual IImageManager* getImageManager();
130
 
        virtual void setImageManager(IImageManager* anImageManager);
131
 
 
132
 
protected:
133
 
        virtual int tilesonzoomlevel(int zoomlevel) const;
134
 
        virtual int getyoffset(int y) const;
 
38
    //! constructor
 
39
    /*!
 
40
     * This construct a Yahoo Adapter
 
41
     */
 
42
    YahooTiledMapAdapter();
 
43
    virtual ~YahooTiledMapAdapter();
 
44
 
 
45
 
 
46
    //! returns the unique identifier (Uuid) of this MapAdapter
 
47
    /*!
 
48
     * @return  the unique identifier (Uuid) of this MapAdapter
 
49
     */
 
50
    virtual QUuid       getId           () const;
 
51
 
 
52
    //! returns the type of this MapAdapter
 
53
    /*!
 
54
     * @return  the type of this MapAdapter
 
55
     */
 
56
    virtual IMapAdapter::Type   getType         () const;
 
57
 
 
58
    //! returns the name of this MapAdapter
 
59
    /*!
 
60
     * @return  the name of this MapAdapter
 
61
     */
 
62
    virtual QString     getName         () const;
 
63
 
 
64
    //! returns the host of this MapAdapter
 
65
    /*!
 
66
     * @return  the host of this MapAdapter
 
67
     */
 
68
    virtual QString     getHost         () const;
 
69
 
 
70
    //! returns the size of the tiles
 
71
    /*!
 
72
     * @return the size of the tiles
 
73
     */
 
74
    virtual int         getTileSize     () const;
 
75
 
 
76
    //! returns the min zoom value
 
77
    /*!
 
78
     * @return the min zoom value
 
79
     */
 
80
    virtual int                 getMinZoom      () const;
 
81
 
 
82
    //! returns the max zoom value
 
83
    /*!
 
84
     * @return the max zoom value
 
85
     */
 
86
    virtual int         getMaxZoom      () const;
 
87
 
 
88
    //! returns the current zoom
 
89
    /*!
 
90
     * @return the current zoom
 
91
     */
 
92
    virtual int                 getZoom         () const;
 
93
 
 
94
    virtual int         getAdaptedZoom()   const;
 
95
    virtual int         getAdaptedMinZoom       () const;
 
96
    virtual int         getAdaptedMaxZoom       () const;
 
97
 
 
98
    virtual void        zoom_in();
 
99
    virtual void        zoom_out();
 
100
 
 
101
    virtual bool        isValid(int x, int y, int z) const;
 
102
    virtual QString getQuery(int x, int y, int z) const;
 
103
    virtual QString getQuery(const QRectF& /* wgs84Bbox */, const QRectF& /* projBbox */, const QRect& /* size */) const  { return ""; }
 
104
    virtual QPixmap getPixmap(const QRectF& /* wgs84Bbox */, const QRectF& /* projBbox */, const QRect& /* size */) const { return QPixmap(); }
 
105
 
 
106
    virtual QRectF      getBoundingbox() const;
 
107
 
 
108
    virtual bool isTiled() const { return true; }
 
109
    virtual int getTilesWE(int zoom) const;
 
110
    virtual int getTilesNS(int zoom) const;
 
111
    virtual QString projection() const;
 
112
 
 
113
    virtual QMenu* getMenu() const { return NULL; }
 
114
 
 
115
    virtual IImageManager* getImageManager();
 
116
    virtual void setImageManager(IImageManager* anImageManager);
 
117
 
 
118
    virtual void cleanup() {}
135
119
 
136
120
private:
137
 
        QLocale loc;
138
 
        IImageManager* theImageManager;
139
 
 
140
 
        QString host;
141
 
        QString serverPath;
142
 
        int     tilesize;
143
 
        int min_zoom;
144
 
        int max_zoom;
145
 
        int current_zoom;
146
 
        double numberOfTiles;
147
 
 
148
 
        virtual QString getQ(QPointF ul, QPointF br) const;
 
121
    QLocale loc;
 
122
    IImageManager* theImageManager;
 
123
 
 
124
    QString     host;
 
125
    QString     serverPath;
 
126
    int tilesize;
 
127
    int min_zoom;
 
128
    int max_zoom;
 
129
    int current_zoom;
 
130
 
 
131
    virtual QString getQ(QPointF ul, QPointF br) const;
149
132
};
150
133
 
151
134
#endif