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