The base class on which all Asset handlers are constructed. More...
#include <asset.h>
Public Slots | |
virtual void | load () |
Signals | |
void | dataChanged () |
Public Member Functions | |
Q_INVOKABLE | Asset (QObject *parent=0) |
~Asset () | |
virtual void | setName (const QString &newName) |
virtual void | setFile (const QUrl &newFile) |
virtual QUrl | file () const |
virtual QString | absolutePath () const |
virtual QIcon | icon () const |
virtual const QList < AssetTemplate * > | templates () |
virtual QList< QAction * > | actions () |
virtual const QMimeData * | data () const |
virtual QString | childrenToGDL (int indentLevel=0) const |
virtual bool | isLoaded () const |
Protected Member Functions | |
QMimeData * | mimeData () const |
void | setLoaded (bool loaded) |
Properties | |
QUrl | file |
The base class on which all Asset handlers are constructed.
The Asset class is a fat interface used to allow file access to GluonEngine based games without allowing direct access to the file system.
Definition at line 82 of file asset.h.
QString Asset::absolutePath | ( | ) | const [virtual] |
QList< QAction * > Asset::actions | ( | ) | [virtual] |
Retrieve a list of actions relating to the current asset.
Reimplemented in GluonEngine::MaterialAsset.
QString Asset::childrenToGDL | ( | int | indentLevel = 0 |
) | const [virtual] |
The specialization of toGDL on the Asset class does not recurse. This allows Assets to handle their own children in a flexible manner, without polluting the GDL with that information.
Reimplemented from GluonCore::GluonObject.
Reimplemented in GluonEngine::MaterialAsset.
const QMimeData * Asset::data | ( | ) | const [virtual] |
This function should return a QMimeType containing the data the asset represents. This is done to avoid having varying methods of accessing the data represented by various assets. If more than one data accessor function is needed, more can of course be constructed, but data() should always return the primary data for the asset.
void GluonEngine::Asset::dataChanged | ( | ) | [signal] |
virtual QUrl GluonEngine::Asset::file | ( | ) | const [virtual] |
QIcon Asset::icon | ( | ) | const [virtual] |
An icon to represent the asset. Think of it as a thumbnail representation of the contents of the asset. The default implementation returns a null icon
Reimplemented in GluonEngine::MaterialAsset, and GluonEngine::TextureAsset.
bool Asset::isLoaded | ( | ) | const [virtual] |
void Asset::load | ( | ) | [virtual, slot] |
Reimplemented in GluonEngine::SoundAsset, GluonEngine::MaterialAsset, GluonEngine::TextureAsset, and GluonEngine::ScriptAsset.
void Asset::setFile | ( | const QUrl & | newFile | ) | [virtual] |
Reimplemented in GluonEngine::ScriptingAsset, and GluonEngine::Scene.
void Asset::setName | ( | const QString & | newName | ) | [virtual] |
An extension on the GluonCore::GluonObject::setName function which changes the file name of the Asset when setting a new name for the Asset.
newName | The requested new name for the asset |
Reimplemented from GluonCore::GluonObject.
Reimplemented in GluonEngine::MaterialAsset, GluonEngine::TextureAsset, and GluonEngine::Scene.
const QList< AssetTemplate * > Asset::templates | ( | ) | [virtual] |
The templates provided by the asset. The default implementation returns no templates, as many assets will not be able to provide templates.
Reimplemented in GluonEngine::MaterialAsset, GluonEngine::ScriptAsset, and GluonEngine::ScriptingAsset.
QUrl Asset::file [read, write] |
The file name of the represented file, relative to the GameProject's position on the file system. Importantly, this cannot contain parent definitions (meaning no .. in the path string), and as this essentially sandboxes GluonEngine based games.