MythTV  master
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ImageItem Class Reference

Represents a picture, video or directory. More...

#include <imagetypes.h>

Collaboration diagram for ImageItem:
Collaboration graph
[legend]

Public Member Functions

 ImageItem (int id=0)
 
bool IsDevice () const
 
bool IsDirectory () const
 
bool IsFile () const
 
bool IsLocal () const
 

Static Public Member Functions

static bool IsLocalId (int id)
 Determine image type (local/remote) from its id. Root/Gallery is remote. More...
 
static bool IsLocalParent (int id)
 Parents of locals are locals or root. More...
 
static int ToLocalId (int id)
 Converts a DB id (positive) to an id of a local image (negative) More...
 
static QString ToLocalId (const QString &id)
 
static int ToDbId (int id)
 Converts local image ids (negative) to Db ids (positive) More...
 
static QString ToDbId (QString ids)
 
static StringPair PartitionIds (const ImageIdList &ids)
 Separates list of ids into a list of local ids and a list of remote ids. More...
 

Public Attributes

int m_id
 Uniquely identifies an image (file/dir). More...
 
QString m_baseName
 File/Dir name with extension (no path) More...
 
QString m_filePath
 Absolute for local images. Usually SG-relative for remotes. More...
 
QString m_extension
 Image file extension. More...
 
int m_device { 0 }
 Id of media device. Always 0 (SG) for remotes, 1+ for local devices. More...
 
int m_parentId { 0 }
 Id of parent dir. More...
 
int m_type { 0 }
 Type of node: dir, video etc. More...
 
std::chrono::seconds m_modTime { 0s }
 Filesystem modified datestamp. More...
 
int m_size { 0 }
 Filesize (files only) More...
 
std::chrono::seconds m_date { 0s }
 Image creation date, from Exif metadata. More...
 
int m_orientation { 0 }
 Image orientation. More...
 
QString m_comment
 User comment, from Exif metadata. More...
 
bool m_isHidden { false }
 If true, image won't be shown. More...
 
int m_userThumbnail { 0 }
 Id of thumbnail to use as cover (dirs only) More...
 
QString m_url
 
QString m_thumbPath
 Myth URL of image (abs filepath for locals) More...
 
QList< ThumbPairm_thumbNails
 
int m_dirCount { 0 }
 Id & URLs of thumbnail(s). 1 for a file, 4 for dirs. More...
 
int m_fileCount { 0 }
 Number of child images (dirs only) More...
 

Detailed Description

Represents a picture, video or directory.

Definition at line 68 of file imagetypes.h.

Constructor & Destructor Documentation

◆ ImageItem()

ImageItem::ImageItem ( int  id = 0)
inlineexplicit

Definition at line 71 of file imagetypes.h.

Member Function Documentation

◆ IsDevice()

bool ImageItem::IsDevice ( ) const
inline

◆ IsDirectory()

bool ImageItem::IsDirectory ( ) const
inline

Definition at line 117 of file imagetypes.h.

Referenced by InfoList::Display().

◆ IsFile()

bool ImageItem::IsFile ( ) const
inline

Definition at line 118 of file imagetypes.h.

Referenced by InfoList::Display().

◆ IsLocal()

bool ImageItem::IsLocal ( ) const
inline

◆ IsLocalId()

static bool ImageItem::IsLocalId ( int  id)
inlinestatic

◆ IsLocalParent()

static bool ImageItem::IsLocalParent ( int  id)
inlinestatic

Parents of locals are locals or root.

Definition at line 124 of file imagetypes.h.

Referenced by ImageDbReader::GetChildren(), ImageDbReader::GetDirectory(), and ImageDbReader::GetImageTree().

◆ ToLocalId() [1/2]

static int ImageItem::ToLocalId ( int  id)
inlinestatic

Converts a DB id (positive) to an id of a local image (negative)

Definition at line 127 of file imagetypes.h.

Referenced by ImageAdapterLocal::ImageId().

◆ ToLocalId() [2/2]

static QString ImageItem::ToLocalId ( const QString &  id)
inlinestatic

Definition at line 128 of file imagetypes.h.

◆ ToDbId() [1/2]

static int ImageItem::ToDbId ( int  id)
inlinestatic

Converts local image ids (negative) to Db ids (positive)

Definition at line 131 of file imagetypes.h.

Referenced by ImageAdapterLocal::DbId(), and ImageAdapterLocal::DbIds().

◆ ToDbId() [2/2]

static QString ImageItem::ToDbId ( QString  ids)
inlinestatic

Definition at line 132 of file imagetypes.h.

◆ PartitionIds()

static StringPair ImageItem::PartitionIds ( const ImageIdList ids)
inlinestatic

Separates list of ids into a list of local ids and a list of remote ids.

Parameters
idsList of local/remote image ids
Returns
StringPair Pair <CSV of local ids, CSV of remote ids>

Definition at line 140 of file imagetypes.h.

Referenced by ImageManagerFe::ChangeOrientation(), ImageManagerFe::CreateThumbnails(), ImageManagerFe::DeleteFiles(), ImageDbReader::GetDescendants(), ImageDbReader::GetImages(), and ImageManagerFe::HideFiles().

Member Data Documentation

◆ m_id

int ImageItem::m_id

Uniquely identifies an image (file/dir).

Assigned by Db auto-incremnent Remote (Storage Group) images are positive - as in Db. Local images are negative - the negated Db id

Definition at line 89 of file imagetypes.h.

Referenced by DirectoryView::Cache(), InfoList::CreateCount(), ImageManagerFe::DeviceCaption(), InfoList::Display(), DirectoryView::LoadDirThumbs(), DirectoryView::PopulateFromCache(), and ImageDb< ImageAdapterLocal >::UpdateDbImage().

◆ m_baseName

QString ImageItem::m_baseName

File/Dir name with extension (no path)

Definition at line 92 of file imagetypes.h.

Referenced by ImageManagerFe::CrumbName().

◆ m_filePath

QString ImageItem::m_filePath

◆ m_extension

QString ImageItem::m_extension

◆ m_device

int ImageItem::m_device { 0 }

Id of media device. Always 0 (SG) for remotes, 1+ for local devices.

Definition at line 95 of file imagetypes.h.

Referenced by ImageManagerFe::CrumbName(), ImageManagerFe::DeviceCaption(), ImageDb< ImageAdapterLocal >::InsertDbImage(), and ImageDb< ImageAdapterLocal >::UpdateDbImage().

◆ m_parentId

int ImageItem::m_parentId { 0 }

◆ m_type

int ImageItem::m_type { 0 }

◆ m_modTime

std::chrono::seconds ImageItem::m_modTime { 0s }

Filesystem modified datestamp.

Definition at line 98 of file imagetypes.h.

Referenced by InfoList::Display(), ImageDb< ImageAdapterLocal >::InsertDbImage(), and ImageDb< ImageAdapterLocal >::UpdateDbImage().

◆ m_size

int ImageItem::m_size { 0 }

Filesize (files only)

Definition at line 99 of file imagetypes.h.

Referenced by ImageDb< ImageAdapterLocal >::InsertDbImage(), and ImageDb< ImageAdapterLocal >::UpdateDbImage().

◆ m_date

std::chrono::seconds ImageItem::m_date { 0s }

Image creation date, from Exif metadata.

Definition at line 100 of file imagetypes.h.

Referenced by InfoList::Display(), ImageDb< ImageAdapterLocal >::InsertDbImage(), and ImageDb< ImageAdapterLocal >::UpdateDbImage().

◆ m_orientation

int ImageItem::m_orientation { 0 }

◆ m_comment

QString ImageItem::m_comment

User comment, from Exif metadata.

Definition at line 102 of file imagetypes.h.

Referenced by ImageDb< ImageAdapterLocal >::InsertDbImage(), and ImageDb< ImageAdapterLocal >::UpdateDbImage().

◆ m_isHidden

bool ImageItem::m_isHidden { false }

◆ m_userThumbnail

int ImageItem::m_userThumbnail { 0 }

◆ m_url

QString ImageItem::m_url

Definition at line 109 of file imagetypes.h.

◆ m_thumbPath

QString ImageItem::m_thumbPath

Myth URL of image (abs filepath for locals)

Absolute path of thumbnail

Definition at line 110 of file imagetypes.h.

◆ m_thumbNails

QList<ThumbPair> ImageItem::m_thumbNails

◆ m_dirCount

int ImageItem::m_dirCount { 0 }

Id & URLs of thumbnail(s). 1 for a file, 4 for dirs.

Number of child sub-dirs (dirs only)

Definition at line 112 of file imagetypes.h.

Referenced by DirectoryView::Cache(), DirectoryView::PopulateFromCache(), and DirectoryView::PopulateThumbs().

◆ m_fileCount

int ImageItem::m_fileCount { 0 }

Number of child images (dirs only)

Definition at line 113 of file imagetypes.h.

Referenced by DirectoryView::Cache(), DirectoryView::PopulateFromCache(), and DirectoryView::PopulateThumbs().


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