FMH

FMH Namespace Reference

Classes

class  Downloader
 
class  FileLoader
 

Typedefs

typedef QHash< MODEL_KEY, QStringMODEL
 
typedef QVector< MODELMODEL_LIST
 

Enumerations

enum  MODEL_KEY : int {
  ICON , LABEL , PATH , URL ,
  TYPE , GROUP , OWNER , SUFFIX ,
  NAME , DATE , SIZE , MODIFIED ,
  MIME , TAG , PERMISSIONS , THUMBNAIL ,
  THUMBNAIL_1 , THUMBNAIL_2 , THUMBNAIL_3 , HIDDEN ,
  ICONSIZE , DETAILVIEW , SHOWTHUMBNAIL , SHOWTERMINAL ,
  COUNT , SORTBY , USER , PASSWORD ,
  SERVER , FOLDERSFIRST , VIEWTYPE , ADDDATE ,
  FAV , FAVORITE , COLOR , RATE ,
  FORMAT , PLACE , LOCATION , ALBUM ,
  ARTIST , TRACK , DURATION , ARTWORK ,
  PLAYLIST , LYRICS , WIKI , MOOD ,
  SOURCETYPE , GENRE , NOTE , COMMENT ,
  CONTEXT , SOURCE , TITLE , ID ,
  PARENT_ID , RELEASEDATE , LICENSE , DESCRIPTION ,
  BOOKMARK , ACCOUNT , ACCOUNTTYPE , VERSION ,
  DOMAIN_M , CATEGORY , CONTENT , PIN ,
  IMG , PREVIEW , LINK , STAMP ,
  BOOK , N , PHOTO , GENDER ,
  ADR , ADR_2 , ADR_3 , EMAIL ,
  EMAIL_2 , EMAIL_3 , LANG , NICKNAME ,
  ORG , PROFILE , TZ , TEL ,
  TEL_2 , TEL_3 , IM , CITY ,
  STATE , COUNTRY , PACKAGE_ARCH , PACKAGE_TYPE ,
  GPG_FINGERPRINT , GPG_SIGNATURE , PACKAGE_NAME , PRICE ,
  REPOSITORY , TAGS , WAY , PIC ,
  SMALL_PIC , CHANGED , COMMENTS , CREATED ,
  DETAIL_PAGE , DETAILS , TOTAL_DOWNLOADS , GHNS_EXCLUDED ,
  LANGUAGE , PERSON_ID , SCORE , SUMMARY ,
  TYPE_ID , TYPE_NAME , XDG_TYPE , SYMLINK ,
  IS_SYMLINK , IS_DIR , IS_FILE , IS_REMOTE ,
  EXECUTABLE , READABLE , WRITABLE , LAST_READ ,
  VALUE , KEY , MAC , LOT ,
  APP , URI , DEVICE , LASTSYNC ,
  UDI , LATITUDE , LONGITUDE , MESSAGE ,
  AUTHOR , BRANCH , UPDATABLE
}
 

Functions

bool fileExists (const QUrl &path)
 
const FMH::MODEL filterModel (const MODEL &model, const QVector< MODEL_KEY > &keys)
 
bool isAndroid ()
 
bool isIOS ()
 
bool isLinux ()
 
bool isMac ()
 
bool isWindows ()
 
const QString mapValue (const QVariantMap &map, const MODEL_KEY &key)
 
const QVector< int > modelRoles (const MODEL &model)
 
const QStringList modelToList (const MODEL_LIST &list, const MODEL_KEY &key)
 
const QVariantMap toMap (const MODEL &model)
 
const QVariantList toMapList (const MODEL_LIST &list)
 
const FMH::MODEL toModel (const QVariantMap &map)
 
const FMH::MODEL_LIST toModelList (const QVariantList &list)
 

Variables

static const QHash< MODEL_KEY, QStringMODEL_NAME
 
static const QHash< QString, MODEL_KEYMODEL_NAME_KEY
 

Detailed Description

A set of helpers for managing the key-value model data type.

And other functionality helpers.

Typedef Documentation

◆ MODEL

The key-value pair model structure, where the values are strings.

This is just a tydef to QHash<MODEL_KEY, QString>.

Definition at line 532 of file fmh.h.

◆ MODEL_LIST

An alias for a container of multiple FMH::MODEL key-value pairs.

Definition at line 537 of file fmh.h.

Enumeration Type Documentation

◆ MODEL_KEY

enum FMH::MODEL_KEY : int

The MODEL_KEY enum values.

Definition at line 64 of file fmh.h.

Function Documentation

◆ fileExists()

bool MAUIKIT_EXPORT FMH::fileExists ( const QUrl & path)

Checks if a local file exists.

Parameters
paththe URL must represent a local file path, by using the scheme file://
Returns
whether the files exists

Definition at line 133 of file fmh.cpp.

◆ filterModel()

const MODEL MAUIKIT_EXPORT FMH::filterModel ( const MODEL & model,
const QVector< MODEL_KEY > & keys )

Creates a new MODEL from another by filtering in the given array of MODEL_KEY.

Parameters
modelthe source model used to filter
keysthe keys of the values to be filtered-in
Returns
a new FMH::MODEL with the values filtered from the original model source

Definition at line 64 of file fmh.cpp.

◆ isAndroid()

bool MAUIKIT_EXPORT FMH::isAndroid ( )

Whether the platform running is Android.

Definition at line 84 of file fmh.cpp.

◆ isIOS()

bool MAUIKIT_EXPORT FMH::isIOS ( )

Whether the platform running is IOS.

Definition at line 124 of file fmh.cpp.

◆ isLinux()

bool MAUIKIT_EXPORT FMH::isLinux ( )

Whether the platform running is GNU/Linux.

Definition at line 104 of file fmh.cpp.

◆ isMac()

bool MAUIKIT_EXPORT FMH::isMac ( )

Whether the platform running is Mac.

Definition at line 113 of file fmh.cpp.

◆ isWindows()

bool MAUIKIT_EXPORT FMH::isWindows ( )

Whether the platform running is Window.

Definition at line 93 of file fmh.cpp.

◆ mapValue()

const QString MAUIKIT_EXPORT FMH::mapValue ( const QVariantMap & map,
const MODEL_KEY & key )

Extracts a value associated with that given FMH::MODEL_KEY key in a map.

Parameters
mapthe map with the data
keythe key to look for in the map
Returns
if found, the string value is returned, otherwise an empty string.

Definition at line 17 of file fmh.cpp.

◆ modelRoles()

const QVector< int > MAUIKIT_EXPORT FMH::modelRoles ( const MODEL & model)

Given a FMH::MODEL, this function will extract all the FMH::MODEL_KEY values used as the keys/roles.

Parameters
modelthe given key-value pair model
Returns
A list of keys/roles in the given model

Definition at line 8 of file fmh.cpp.

◆ modelToList()

const QStringList MAUIKIT_EXPORT FMH::modelToList ( const MODEL_LIST & list,
const MODEL_KEY & key )

Extracts from a MODEL_LIST the values from a given MODEL::KEY into a QStringList.

Parameters
listthe source list of model pairs
keythe keys to use to extract the values
Returns
a list of the values extracted

Definition at line 74 of file fmh.cpp.

◆ toMap()

const QVariantMap MAUIKIT_EXPORT FMH::toMap ( const MODEL & model)

Converts a FMH::MODEL object to a QVariantMap.

This is basically doing a convertion from QHash<MODEL_KEY, QString> to a QMap<QString, QString>.

Parameters
modelthe data model to convert
Returns
a new QVariantMap

Definition at line 22 of file fmh.cpp.

◆ toMapList()

const QVariantList MAUIKIT_EXPORT FMH::toMapList ( const MODEL_LIST & list)

Creates a QVariantList from a MODEL_LIST.

Parameters
list
Returns

Definition at line 55 of file fmh.cpp.

◆ toModel()

const MODEL MAUIKIT_EXPORT FMH::toModel ( const QVariantMap & map)

Converts a QVariantMap to a FMH::MODEl.

Note
For this to be successful, the original map keys should be mappable in the FMH::MODEL_NAME.
Parameters
mapthe map to be converted
Returns
the resulting FMH::MODEL if all the keys in the original map were successfully mapped.

Definition at line 34 of file fmh.cpp.

◆ toModelList()

const MODEL_LIST MAUIKIT_EXPORT FMH::toModelList ( const QVariantList & list)

Creates a FMH::MODEL_LIST from a QVariantList.

Parameters
list
Note
For this to be successful, the original map keys - in the list - should be mappable in the FMH::MODEL_NAME.
Returns
the resulting FMH::MODEL_LIST

Definition at line 46 of file fmh.cpp.

Variable Documentation

◆ MODEL_NAME

const QHash<MODEL_KEY, QString> FMH::MODEL_NAME
static

The mapping of the FMH::MODEL_KEY enum values to its string representation.

For example, FMH::MODEL_KEY::LABEL is mapped to"label".

QString keyName = FMH::MODEL_NAME[FMH::MODEL_KEY::LABEL]; //resulting in "label"
static const QHash< MODEL_KEY, QString > MODEL_NAME
The mapping of the FMH::MODEL_KEY enum values to its string representation.
Definition fmh.h:219
Note
All the string representations of the FMH::MODEL_KEY are always lower cased, and with no special character division.

Definition at line 219 of file fmh.h.

◆ MODEL_NAME_KEY

const QHash<QString, MODEL_KEY> FMH::MODEL_NAME_KEY
static

The mapping of a string text into a FMH::MODEL_KEY.

For example, "label" is mapped to FMH::MODEL_KEY::LABEL.

FMH::MODEL_KEY key = FMH::MODEL_NAME_KEY["label"]; //resulting in FMH::MODEL_KEY::LABEL
static const QHash< QString, MODEL_KEY > MODEL_NAME_KEY
The mapping of a string text into a FMH::MODEL_KEY.
Definition fmh.h:378
MODEL_KEY
The MODEL_KEY enum values.
Definition fmh.h:64

Definition at line 378 of file fmh.h.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.