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
 Id of media device. Always 0 (SG) for remotes, 1+ for local devices. More...
 
int m_parentId
 Id of parent dir. More...
 
int m_type
 Type of node: dir, video etc. More...
 
qint64 m_modTime
 Filesystem modified datestamp. More...
 
int m_size
 Filesize (files only) More...
 
qint64 m_date
 Image creation date, from Exif metadata. More...
 
int m_orientation
 Image orientation. More...
 
QString m_comment
 User comment, from Exif metadata. More...
 
bool m_isHidden
 If true, image won't be shown. More...
 
int m_userThumbnail
 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
 Id & URLs of thumbnail(s). 1 for a file, 4 for dirs. More...
 
int m_fileCount
 Number of child images (dirs only) More...
 

Detailed Description

Represents a picture, video or directory.

Definition at line 67 of file imagetypes.h.

Constructor & Destructor Documentation

◆ ImageItem()

ImageItem::ImageItem ( int  id = 0)
inlineexplicit

Definition at line 70 of file imagetypes.h.

Member Function Documentation

◆ IsDevice()

bool ImageItem::IsDevice ( ) const
inline

◆ IsDirectory()

bool ImageItem::IsDirectory ( ) const
inline

Definition at line 132 of file imagetypes.h.

Referenced by InfoList::Display().

◆ IsFile()

bool ImageItem::IsFile ( ) const
inline

Definition at line 133 of file imagetypes.h.

Referenced by InfoList::Display().

◆ IsLocal()

bool ImageItem::IsLocal ( void  ) 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 139 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 142 of file imagetypes.h.

Referenced by ImageAdapterLocal::ImageId().

◆ ToLocalId() [2/2]

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

Definition at line 143 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 146 of file imagetypes.h.

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

◆ ToDbId() [2/2]

static QString ImageItem::ToDbId ( QString  ids)
inlinestatic

Definition at line 147 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 155 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 96 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 99 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

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

Definition at line 102 of file imagetypes.h.

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

◆ m_parentId

int ImageItem::m_parentId

◆ m_type

int ImageItem::m_type

◆ m_modTime

qint64 ImageItem::m_modTime

Filesystem modified datestamp.

Definition at line 108 of file imagetypes.h.

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

◆ m_size

int ImageItem::m_size

Filesize (files only)

Definition at line 110 of file imagetypes.h.

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

◆ m_date

qint64 ImageItem::m_date

Image creation date, from Exif metadata.

Definition at line 114 of file imagetypes.h.

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

◆ m_orientation

int ImageItem::m_orientation

◆ m_comment

QString ImageItem::m_comment

User comment, from Exif metadata.

Definition at line 117 of file imagetypes.h.

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

◆ m_isHidden

bool ImageItem::m_isHidden

◆ m_userThumbnail

int ImageItem::m_userThumbnail

◆ m_url

QString ImageItem::m_url

Definition at line 124 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 125 of file imagetypes.h.

◆ m_thumbNails

QList<ThumbPair> ImageItem::m_thumbNails

◆ m_dirCount

int ImageItem::m_dirCount

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

Number of child sub-dirs (dirs only)

Definition at line 127 of file imagetypes.h.

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

◆ m_fileCount

int ImageItem::m_fileCount

Number of child images (dirs only)

Definition at line 128 of file imagetypes.h.

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


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