Developer Documentation

Functions
Types.cc File Reference
`#include "TypesInternal.hh"`
`#include <OpenFlipper/common/GlobalOptions.hh>`
`#include <OpenFlipper/BasePlugin/LoggingInterface.hh>`
`#include <QCoreApplication>`

Go to the source code of this file.

## Functions
std::ostream & | operator<< (std::ostream &stream, DataType type)
void | initializeTypes ()
DataType | addDataType (QString _name, QString _readableName)
| Adds a datatype and returns the id for the new type. More...
DataType | typeId (QString _name)
| Get the id of a type with given name. More...
QString | typeName (DataType _id)
| Get the name of a type with given id. More...
bool | typeExists (QString _name)
| Check if a type with the given name exists. More...
size_t | typeCount ()
| Return the number of registered types. More...
std::vector< TypeInfo >::const_iterator | typesBegin ()
| Get iterator pointing to the first element in the tyoes list. More...
std::vector< TypeInfo >::const_iterator | typesEnd ()
| Get iterator pointing to the last element in the tyoes list. More...
QString | typeIconName (QString _name)
| Get the icon of a given dataType. More...
QString | typeIconName (DataType _id)
| get the icon of a given dataType More...
QIcon & | typeIcon (DataType _id)
| get the icon of a given dataType More...
void | setTypeIcon (DataType _id, QString _icon)
| Set the icon for a given dataType. More...
void | setTypeIcon (QString _name, QString _icon)
| Set the icon for a given dataType. More...
QString | dataTypeName (DataType _id)
| Get DataType Human readable name ( this name might change. Use the typeName insted! ) More...
QString | dataTypeName (QString _typeName)
| Get DataType Human readable name ( this name might change. Use the typeName insted! ) More...
void | setDataTypeName (DataType _id, QString _name)
| Set the icon for a given dataType. More...
void | setDataTypeName (QString _typeName, QString _name)
| Set the icon for a given dataType. More...
void | registerTypes ()

## Detailed Description

This File contains the basic functions to handle datatypes

Definition in file Types.cc.

## Function Documentation

## ◆ addDataType()

DataType addDataType | ( | QString | _name,
|  | QString | _readableName
| ) |  |

Adds a datatype and returns the id for the new type.

Adds a datatype and returns the id for the new type

Parameters

  _name | Internal name for the new DataType
  _readableName | Human readable Name for this type ( Use tr to make it translatable )

Definition at line 117 of file Types.cc.

## ◆ dataTypeName() [1/2]

QString dataTypeName | ( | DataType | _id | ) |

Get DataType Human readable name ( this name might change. Use the typeName insted! )

Get DataType Human readable name ( this name might change. Use the typeName instead! )

Definition at line 252 of file Types.cc.

## ◆ dataTypeName() [2/2]

QString dataTypeName | ( | QString | _typeName | ) |

Get DataType Human readable name ( this name might change. Use the typeName insted! )

Get DataType Human readable name ( this name might change. Use the typeName instead! )

Definition at line 265 of file Types.cc.

## ◆ registerTypes()

void registerTypes | ( |  | ) |

Registers datatypes on runtime for signal/slots

Definition at line 422 of file Types.cc.

## ◆ setDataTypeName() [1/2]

void setDataTypeName | ( | DataType | _id,
|  | QString | _name
| ) |  |

Set the icon for a given dataType.

Set DataType Human readable name.

Definition at line 280 of file Types.cc.

## ◆ setDataTypeName() [2/2]

void setDataTypeName | ( | QString | _typeName,
|  | QString | _name
| ) |  |

Set the icon for a given dataType.

Set DataType Human readable name.

Definition at line 291 of file Types.cc.

## ◆ setTypeIcon() [1/2]

void setTypeIcon | ( | DataType | _id,
|  | QString | _icon
| ) |  |

Set the icon for a given dataType.

Set an Icon for a given DataType.

Definition at line 223 of file Types.cc.

## ◆ setTypeIcon() [2/2]

void setTypeIcon | ( | QString | _name,
|  | QString | _icon
| ) |  |

Set the icon for a given dataType.

Set an Icon for a given DataType.

Definition at line 237 of file Types.cc.

## ◆ typeCount()

size_t typeCount | ( |  | ) |

Return the number of registered types.

Get the number of registered types.

Definition at line 175 of file Types.cc.

## ◆ typeExists()

bool typeExists | ( | QString | _name | ) |

Check if a type with the given name exists.

Definition at line 169 of file Types.cc.

## ◆ typeIcon()

QIcon& typeIcon | ( | DataType | _id | ) |

get the icon of a given dataType

Get an QIcon associated with the given DataType.

Definition at line 212 of file Types.cc.

## ◆ typeIconName() [1/2]

QString typeIconName | ( | QString | _name | ) |

Get the icon of a given dataType.

Get a string with the filename of the icon for the DataType name.

Definition at line 190 of file Types.cc.

## ◆ typeIconName() [2/2]

QString typeIconName | ( | DataType | _id | ) |

get the icon of a given dataType

Get a string with the filename of the icon for the DataType.

Definition at line 201 of file Types.cc.

## ◆ typeId()

DataType typeId | ( | QString | _name | ) |

Get the id of a type with given name.

Given a dataType Identifier string this function will return the id of the datatype.

Definition at line 139 of file Types.cc.

## ◆ typeName()

QString typeName | ( | DataType | _id | ) |

Get the name of a type with given id.

The ids are organized in a bitfield. So use either the macro for getting the type id or use the id directly (they have to be power of 2! ... Bitfield)

Definition at line 154 of file Types.cc.

## ◆ typesBegin()

std::vector< TypeInfo >::const_iterator typesBegin | ( |  | ) |

Get iterator pointing to the first element in the tyoes list.

Get iterator pointing to the first element in the types list.

Definition at line 180 of file Types.cc.

## ◆ typesEnd()

std::vector< TypeInfo >::const_iterator typesEnd | ( |  | ) |

Get iterator pointing to the last element in the tyoes list.

Get iterator pointing to the last element in the types list.

Definition at line 185 of file Types.cc.