accounts-qt: ServiceType Class Reference

accounts-qt 1.17

Public Member Functions | Friends | List of all members
ServiceType Class Reference

Representation of an account service type. More...

`#include <Accounts/ServiceType>`

## Public Member Functions
| ServiceType ()
| Construct an invalid serviceType.
| ServiceType (const ServiceType &other)
| Copy constructor.
ServiceType & | operator= (const ServiceType &other)
bool | isValid () const
| Check whether this object represents a ServiceType.
QString | name () const
| Returns the name (ID) of the service type.
QString | description () const
QString | displayName () const
QString | trCatalog () const
QString | iconName () const
bool | hasTag (const QString &tag) const
| Check if this service type has a tag.
QSet< QString > | tags () const
| Return all tags of the service type as a set.
const QDomDocument | domDocument () const

## Friends
bool | operator== (const Accounts::ServiceType &s1, const Accounts::ServiceType &s2)

## Detailed Description

Representation of an account service type.

The ServiceType object represents an account service type. It can be used to retrieve some basic properties of the service type (such as name and icon) and to get access to the contents of the XML file which defines it.

Definition at line 49 of file service-type.h.

## Constructor & Destructor Documentation

## ◆ ServiceType() [1/2]

ServiceType | ( |  | ) |

Construct an invalid serviceType.

Definition at line 59 of file service-type.cpp.

## ◆ ServiceType() [2/2]

ServiceType | ( | const ServiceType & | other | ) |

Copy constructor.

Copying a ServiceType object is very cheap, because the data is shared among copies.

Definition at line 69 of file service-type.cpp.

## ◆ ~ServiceType()

~ServiceType | ( |  | ) |

Definition at line 88 of file service-type.cpp.

## Member Function Documentation

## ◆ description()

QString description | ( |  | ) | const

Returns
  The description of the service type.

Definition at line 121 of file service-type.cpp.

## ◆ displayName()

QString displayName | ( |  | ) | const

Returns
  The display name of the service type; this is a string that could be shown in the UI to describe the service type to the user.

The library attempts to translate this string by passing it to the qtTrId() function; in order for this to work you must make sure that the translation catalogue has been loaded before, if needed.

Definition at line 134 of file service-type.cpp.

## ◆ domDocument()

const QDomDocument domDocument | ( |  | ) | const

Returns
  The DOM of the whole XML service file

Definition at line 200 of file service-type.cpp.

## ◆ hasTag()

bool hasTag | ( | const QString & | tag | ) | const

Check if this service type has a tag.

Parameters

  tag | Tag to look for

Returns
  Service type has the tag?

Definition at line 171 of file service-type.cpp.

## ◆ iconName()

QString iconName | ( |  | ) | const

Returns
  The icon name

Definition at line 159 of file service-type.cpp.

## ◆ isValid()

bool isValid | ( |  | ) | const

Check whether this object represents a ServiceType.

Returns
  true if the ServiceType is a valid one.

Definition at line 104 of file service-type.cpp.

Referenced by ServiceType::name().

## ◆ name()

QString name | ( |  | ) | const

Returns the name (ID) of the service type.

Definition at line 112 of file service-type.cpp.

References ServiceType::isValid().

## ◆ operator=()

ServiceType & operator= | ( | const ServiceType & | other | ) |

Definition at line 77 of file service-type.cpp.

## ◆ tags()

QSet< QString > tags | ( |  | ) | const

Return all tags of the service type as a set.

Returns
  Set of tags

Definition at line 181 of file service-type.cpp.

## ◆ trCatalog()

QString trCatalog | ( |  | ) | const

Returns
  The name of the translation catalog, which can be used to translate the displayName()

Definition at line 151 of file service-type.cpp.

## Friends And Related Function Documentation

## ◆ operator==

bool operator== | ( | const Accounts::ServiceType & | s1,
|  | const Accounts::ServiceType & | s2
| ) |  |
| friend

Definition at line 69 of file service-type.h.

The documentation for this class was generated from the following files:

- Accounts/service-type.h
- Accounts/service-type.cpp