45 void Add(
int id) { insert(
id); }
61 bool hiddenMarked,
bool unhiddenMarked)
88 {
return QString(
"File %1 Parent %2").arg(
id).arg(
m_parent); }
116 bool Select(
int id,
int fallback = 0);
118 QStringList
ClearImage(
int id,
bool remove =
false);
122 void Clear(
bool resetParent =
true);
131 void Cache(
int id,
int parent,
const QString &url,
const QString &thumb);
153 QList<ThumbPair> thumbs,
int thumbCount)
183 void Clear(
bool resetParent =
true);
185 QStringList
RemoveImage(
int id,
bool deleted =
false);
188 void Mark(
int id,
bool mark);
Records dir info for every displayed dir.
QString ToString(int id) const
DirCacheEntry(int parentId, int dirs, int files, QList< ThumbPair > thumbs, int thumbCount)
QList< ThumbPair > m_thumbs
A datastore of images for display by a screen. Provides an ordered list of dirs & images from a singl...
void LoadDirThumbs(ImageItem &parent, int thumbsNeeded, int level=0)
Populate thumbs for a dir.
ImagePtrK GetParent() const
QString GetPosition() const
Get positional status.
void ClearMarked()
Unmark all items.
void Clear(bool resetParent=true)
Resets view.
bool PopulateFromCache(ImageItem &dir, int required)
Retrieve cached dir, if available.
MenuSubjects GetMenuSubjects()
Determine current selection, markings & various info to support menu display.
void PopulateThumbs(ImageItem &parent, int thumbsNeeded, const ImageList &files, const ImageList &dirs, int level=0)
Populate directory stats & thumbnails recursively from database as follows: Use user cover,...
QHash< int, DirCacheEntry > m_dirCache
Caches displayed image dirs.
DirectoryView(SlideOrderType order)
Constructs a view of images & directories that can be marked.
bool IsMarked(int id) const
void MarkAll()
Mark all images/dirs.
bool LoadFromDb(int parentId) override
Populate view from database as images/subdirs of a directory. View is ordered: Parent dir,...
void ClearCache()
Clears UI cache.
MarkedFiles m_prevMarked
Marked items in previous dir.
ImageIdList GetChildren() const
QStringList RemoveImage(int id, bool deleted=false)
Clear file/dir and all its ancestors from UI cache so that ancestor thumbnails are recalculated....
void InvertMarked()
Mark all unmarked items, unmark all marked items.
MarkedFiles m_marked
Marked items in current dir/view.
void SetDirectory(int newParent)
Manage markings on tree navigation.
void Cache(ImageItemK &dir, int thumbCount)
Cache displayed dir.
void Mark(int id, bool mark)
Mark/unmark an image/dir.
Records info of displayed image files to enable clean-up of the UI image cache.
FileCacheEntry(int parent, QString url, QString thumbUrl)
QString ToString(int id) const
A datastore of images for display by a screen.
void Cache(int id, int parent, const QString &url, const QString &thumb)
Cache image properties to optimize UI.
bool Update(int id)
Updates view with images that have been updated.
QStringList ClearImage(int id, bool remove=false)
Clear file from UI cache and optionally from view.
void ClearCache()
Clears UI cache.
ImagePtrK Prev(int inc)
Decrements iterator and returns previous image. Wraps at start.
FlatView(SlideOrderType order)
bool Select(int id, int fallback=0)
Selects first occurrence of an image.
void Populate(ImageList &files)
Fills view with Db images, re-ordering them as required.
ImagePtrK HasNext(int inc) const
Peeks at next image in view but does not advance iterator.
void Clear(bool resetParent=true)
Reset view.
int m_active
Sequence index of current selected image.
ImagePtrK Next(int inc)
Advance iterator and return next image, wrapping if necessary. Regenerates unordered views on wrap.
QHash< int, FileCacheEntry > m_fileCache
Caches displayed image files.
ImageIdList m_sequence
The sequence in which to display images.
QString GetPosition() const
Get positional status.
ImagePtrK GetSelected() const
Get current selection.
virtual bool LoadFromDb(int parentId)
Populate view with database images from a directory.
ImageListK GetAllNodes() const
Get all images/dirs in view.
ImagePtrK HasPrev(int inc) const
Peeks at previous image in view but does not decrement iterator.
QHash< int, ImagePtrK > m_images
Image objects currently displayed.
void Rotate(int id)
Rotate view so that starting image is at front.
static WeightList CalculateSeasonalWeights(ImageList &files)
This method calculates a weight for the item based on how closely it was taken to the current time of...
QString GetCachedThumbUrl(int id) const
Represents a picture, video or directory.
The image manager for use by Frontends.
A container of images/dirs that have been marked.
void Add(const ImageIdList &newIds)
void Invert(const ImageIdList &all)
A datastore of images for display by a screen. Provides an ordered list of images (no dirs) from a di...
TreeView(SlideOrderType order)
bool LoadFromDb(int parentId) override
Populate view from database as images of a directory sub-tree. Default order of a tree is depth-first...
SlideOrderType
Order of images in slideshow.
@ kSeasonal
Biased random selection so that images are more likely to appear on anniversaries.
@ kShuffle
Each image appears exactly once, but in random order.
@ kRandom
Random selection from view. An image may be absent or appear multiple times.
@ kOrdered
Ordered as per user setting GallerySortOrder.
QVector< double > WeightList
Seasonal weightings for images in a view.
Manages a collection of images.
QVector< ImagePtr > ImageList
QList< ImagePtrK > ImageListK
QSharedPointer< ImageItemK > ImagePtrK
static constexpr int GALLERY_DB_ID
static void clear(SettingsMap &cache, SettingsMap &overrides, const QString &myKey)