/usr/include/marble/MarbleGraphicsItem.h is in libmarble-dev 4:4.8.2-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | //
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2009 Bastian Holst <bastianholst@gmx.de>
//
#ifndef MARBLE_MARBLEGRAPHICSITEM_H
#define MARBLE_MARBLEGRAPHICSITEM_H
#include "marble_export.h"
#include <QtCore/QPointF>
#include <QtCore/QList>
#include <QtCore/QSizeF>
#include <QtCore/QRectF>
#include <QtCore/QString>
class QEvent;
class QObject;
namespace Marble
{
class AbstractMarbleGraphicsLayout;
class GeoPainter;
class GeoSceneLayer;
class ViewportParams;
class MarbleGraphicsItemPrivate;
class MARBLE_EXPORT MarbleGraphicsItem
{
friend class MarbleGraphicsItemPrivate;
public:
enum CacheMode {
NoCache,
ItemCoordinateCache,
DeviceCoordinateCache
};
explicit MarbleGraphicsItem( MarbleGraphicsItem *parent = 0 );
virtual ~MarbleGraphicsItem();
/**
* Paints the item on the screen in view coordinates.
* It is not safe to call this function from a thread other than the gui thread.
*/
bool paintEvent( GeoPainter *painter, ViewportParams *viewport,
const QString& renderPos, GeoSceneLayer *layer = 0 );
/**
* Returns true if the Item contains @p point in parent coordinates.
*/
bool contains( const QPointF& point ) const;
/**
* Returns the rect of one representation of the object that is at the given position.
*/
QRectF containsRect( const QPointF& point ) const;
/**
* @brief Used to get the set of screen bounding rects
*/
QList<QRectF> boundingRects() const;
/**
* Returns the layout of the MarbleGraphicsItem.
*/
AbstractMarbleGraphicsLayout *layout() const;
/**
* Set the layout of the graphics item. The layout will now handle positions of added child
* items. The MarbleGraphicsItem takes ownership of the layout.
*/
void setLayout( AbstractMarbleGraphicsLayout *layout );
/**
* Returns the cache mode of the item
*/
CacheMode cacheMode() const;
/**
* Set the cache mode of the item
*/
void setCacheMode( CacheMode mode, const QSize & logicalCacheSize = QSize() );
/**
* Schedules an painting update for the Item. As long it is not added to an GraphicsScene
* (which doesn't exist yet) it will be repainted at the next paint event instead of using
* the cache.
*/
void update();
/**
* Returns if the item is visible.
*/
bool visible() const;
/**
* Makes the item visible or invisible, depending on @p visible.
*/
void setVisible( bool visible );
/**
* Hides the item. Equivalent to setVisible( false )
*/
void hide();
/**
* Shows the item. Equivalent to setVisible( true )
*/
void show();
/**
* Returns the items tool tip or, if no tool tip has been set, an empty string.
*/
QString toolTip() const;
/**
* Set the tool tip for this GraphicItem.
*/
void setToolTip( const QString& toolTip );
/**
* Returns the z value of the item
*/
qreal zValue() const;
/**
* Set the z value of the item
*/
void setZValue( qreal z );
/**
* Returns the size of the item
*/
QSizeF size() const;
/**
* Set the size of the item
*/
void setSize( const QSizeF& size );
/**
* Returns the size of the content of the MarbleGraphicsItem.
* This is identical to size() for default MarbleGraphicsItems.
*/
virtual QSizeF contentSize() const;
/**
* Set the size of the content of the item.
*/
virtual void setContentSize( const QSizeF& size );
/**
* Returns the rect of the content in item coordinates.
*/
virtual QRectF contentRect() const;
/**
* Paints on the viewport
* This function wil be called by paintEvent().
*/
virtual void paintViewport( GeoPainter *painter, ViewportParams *viewport,
const QString &renderPos, GeoSceneLayer *layer = 0 );
/**
* Paints the item in item coordinates. This has to be reimplemented by the subclass
* This function will be called by paintEvent().
*/
virtual void paint( GeoPainter *painter, ViewportParams *viewport,
const QString& renderPos, GeoSceneLayer * layer = 0 );
protected:
explicit MarbleGraphicsItem( MarbleGraphicsItemPrivate *d_ptr );
virtual bool eventFilter( QObject *object, QEvent *e );
MarbleGraphicsItemPrivate * const d;
private:
MarbleGraphicsItemPrivate* p() const;
};
} // Namespace Marble
#endif
|