MythTV master
gallerythumbview.h
Go to the documentation of this file.
1
3
4#ifndef GALLERYVIEW_H
5#define GALLERYVIEW_H
6
7#include "galleryslideview.h"
8#include "galleryviews.h"
9
10class DirectoryView;
11class MythMenu;
12
14enum ImageCaptionType : std::uint8_t {
18 kUserCaption = 3
19};
20
21
24{
25 Q_OBJECT
26public:
27 GalleryThumbView(MythScreenStack *parent, const char *name);
28 ~GalleryThumbView() override;
29 bool Create() override; // MythScreenType
30 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
31 void mediaEvent(MythMediaEvent *event) override // MythUIType
32 { m_mgr.DeviceEvent(event); }
33
34public slots:
35 void Start();
36 void Close() override; // MythScreenType
38
39protected:
40 void customEvent(QEvent *event) override; // MythUIType
41
42private:
43 void RemoveImages(const QStringList &ids, bool deleted = true);
44 void BuildImageList();
45 void ResetUiSelection();
49 void UpdateScanProgress(const QString &scanner, int current, int total);
51 void SelectZoomWidget(int change);
52 QString CheckThumbnail(MythUIButtonListItem *item, const ImagePtrK &im,
53 ImageIdList &request, int index);
54 static void UpdateThumbnail(MythUIButtonListItem *button, const ImagePtrK &im,
55 const QString &url, int index);
56 void MenuMain();
57 void MenuShow(MythMenu *mainMenu);
58 void MenuMarked(MythMenu *mainMenu);
59 void MenuPaste(MythMenu *mainMenu);
60 void MenuTransform(MythMenu *mainMenu);
61 void MenuAction(MythMenu *mainMenu);
62 void MenuSlideshow(MythMenu *mainMenu);
63 bool DirSelectUp();
64 void DirSelectDown();
65 void ShowDialog(const QString &msg, const QString &event = "");
66
67private slots:
68 void LoadData(int parent);
69 void SelectImage(int id);
74 void ShowDetails();
85 void DoMarkItem(bool mark);
86 void MarkItem() { DoMarkItem(true); }
87 void UnmarkItem() { DoMarkItem(false); }
88 void DoMarkAll(bool mark = true);
89 void MarkAll() { DoMarkAll(true); }
90 void UnmarkAll() { DoMarkAll(false); }
91 void MarkInvertAll();
92 void DoHideItem(bool hide = true);
93 void HideItem() { DoHideItem(true); }
94 void Unhide() { DoHideItem(false); }
95 void DoHideMarked(bool hide = true);
96 void HideMarked() { DoHideMarked(true); }
97 void UnhideMarked() { DoHideMarked(false); }
98 void ShowRenameInput();
99 void DoShowHidden(bool show = true);
100 void ShowHidden() { DoShowHidden(true); }
101 void HideHidden() { DoShowHidden(false); }
102 void DoSetCover(bool reset = false);
103 void SetCover() { DoSetCover(false); }
104 void ResetCover() { DoSetCover(true); }
105 void DoShowType(int type);
109 void ZoomIn();
110 void ZoomOut();
111 void ShowSettings();
112 void DoScanAction(bool start);
113 void StartScan() { DoScanAction(true); }
114 void StopScan() { DoScanAction(false); }
115 void DeleteItem();
116 void DeleteMarked();
117 void Import();
118 void MakeDir();
119 void Eject();
120 void Copy(bool deleteAfter);
121 void Copy() { Copy(false); }
122 void Move();
123 void ShowPassword();
124 static void DoRepeat(int on);
125 static void RepeatOn() { DoRepeat(1); }
126 static void RepeatOff() { DoRepeat(0); }
127
128private:
129 using IntPair = QPair<int,int>;
130
131 // Theme widgets
141
143 QList<MythUIButtonList *> m_zoomWidgets;
144 int m_zoomLevel {0};
145
150
152 QHash<QString, IntPair> m_scanProgress;
154 QSet<QString> m_scanActive;
155
158
159 using ThumbLocation = QPair<MythUIButtonListItem *, int>;
161 QMultiHash<int, ThumbLocation> m_pendingMap;
162
163 QSet<int> m_thumbExists;
164 bool m_editsAllowed {false};
165};
166
167
168#endif // GALLERYVIEW_H
A datastore of images for display by a screen. Provides an ordered list of dirs & images from a singl...
Definition: galleryviews.h:174
Thumbnail screen.
void ShowDialog(const QString &msg, const QString &event="")
Show a confirmation dialog.
void ShowSettings()
Show configuration screen.
static void RepeatOff()
bool Create() override
Initialises and shows the graphical elements.
DirectoryView * m_view
List of images comprising the view.
static void UpdateThumbnail(MythUIButtonListItem *button, const ImagePtrK &im, const QString &url, int index)
Update the buttonlist item with a thumbnail.
void DirSelectDown()
Goes one directory level down.
void DoScanAction(bool start)
Action scan request.
void DoMarkAll(bool mark=true)
Mark or unmark all items.
void SelectImage(int id)
Select item if it is displayed.
MythUIText * m_crumbsText
~GalleryThumbView() override
Destructor.
MythUIText * m_typeFilterText
QPair< int, int > IntPair
bool m_editsAllowed
Edit privileges.
static void ClearSgDb()
void DoMarkItem(bool mark)
Mark or unmark a single item.
void DoShowHidden(bool show=true)
Show or hide hidden files.
void MenuMain()
Shows the main menu when the MENU button was pressed.
void MenuTransform(MythMenu *mainMenu)
Add a Transform submenu.
void Start()
Start Thumbnail screen.
bool keyPressEvent(QKeyEvent *event) override
Handle keypresses.
void MenuSlideshow(MythMenu *mainMenu)
Add a Slideshow submenu.
void ZoomOut()
Use larger buttonlist widgets.
void LoadData(int parent)
Loads & displays images from database.
MythUIProgressBar * m_scanProgressBar
MythUIText * m_emptyText
MythScreenStack & m_popupStack
void ResetUiSelection()
Clears all text widgets for selected item.
void TransformItem(ImageFileTransform tran=kRotateCW)
Apply transform to an image.
QPair< MythUIButtonListItem *, int > ThumbLocation
void DoSetCover(bool reset=false)
Set or reset thumbnails to use for a directory cover.
void DoHideMarked(bool hide=true)
Hide or unhide marked items.
MythUIText * m_hideFilterText
void customEvent(QEvent *event) override
Handle custom events.
void Move()
Move marked images to selected dir. If no marked files, use previously marked files....
void Close() override
Exit Gallery.
void RemoveImages(const QStringList &ids, bool deleted=true)
Cleanup UI & image caches when a device is removed.
void DoHideItem(bool hide=true)
Hide or unhide item.
void ZoomIn()
Use smaller buttonlist widgets.
void MakeDir()
Show dialog to input new directory name.
QHash< QString, IntPair > m_scanProgress
Last scan updates received from scanners.
void MenuMarked(MythMenu *mainMenu)
Adds a Marking submenu.
void SetUiSelection(MythUIButtonListItem *item)
Updates text widgets for selected item.
void Eject()
Remove local device (or Import) from Gallery.
void TransformMarked(ImageFileTransform tran=kRotateCW)
Apply transform to marked images.
void MenuPaste(MythMenu *mainMenu)
Add a Paste submenu.
ImageManagerFe & m_mgr
Manages the images.
MythUIText * m_captionText
void DeleteItem()
Confirm user deletion of an item.
QSet< QString > m_scanActive
Scanners currently scanning.
GalleryThumbView(MythScreenStack *parent, const char *name)
Constructor.
void Import()
Executes user 'Import command'.
bool DirSelectUp()
Goes up one directory level.
static void DoRepeat(int on)
MenuSubjects m_menuState
Current selection/marked files when menu is invoked.
void MenuAction(MythMenu *mainMenu)
Add a Action submenu.
void ShowPassword()
Displays dialog to accept password.
void BuildImageList()
Displays all images in current view.
QMultiHash< int, ThumbLocation > m_pendingMap
Buttons waiting for thumbnails to be created.
MythUIText * m_scanProgressText
void MarkInvertAll()
Invert all marked items.
void DoShowType(int type)
Show/hide pictures or videos.
MythUIButtonList * m_imageList
void ItemClicked(MythUIButtonListItem *item)
Action item click.
void StartSlideshow(ImageSlideShowType mode)
Start slideshow screen.
MythUIText * m_positionText
InfoList m_infoList
Image details overlay.
void DeleteMarked()
Confirm user deletion of marked files.
void UpdateImageItem(MythUIButtonListItem *item)
Initialises a single buttonlist item.
QSet< int > m_thumbExists
Images where thumbnails are known to exist.
static void RepeatOn()
void SelectZoomWidget(int change)
Change buttonlist to use a different size.
QList< MythUIButtonList * > m_zoomWidgets
Theme buttonlist widgets implementing zoom levels.
void mediaEvent(MythMediaEvent *event) override
Media/Device status event handler, received from MythMediaMonitor.
void ShowRenameInput()
Show dialog to allow input.
void UpdateScanProgress(const QString &scanner, int current, int total)
Update progressbar with scan status.
QString CheckThumbnail(MythUIButtonListItem *item, const ImagePtrK &im, ImageIdList &request, int index)
Verify thumbnail is known to exist.
void ShowDetails()
Shows exif info/details about an item.
void MenuShow(MythMenu *mainMenu)
Add a Show submenu.
The image manager for use by Frontends.
Definition: imagemanager.h:456
static void ClearStorageGroup()
Clear database & thumbnails of Storage Group images.
void DeviceEvent(MythMediaEvent *event)
Manage events for local devices.
The image info/details buttonlist overlay that displays exif tags.
Definition: galleryinfo.h:24
A snapshot of current selection, markings & dir info when menu is invoked.
Definition: galleryviews.h:56
Screen in which all other widgets are contained and rendered.
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Progress bar widget.
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
Slideshow screen.
ImageSlideShowType
Type of slide show.
@ kNormalSlideShow
@ kRecursiveSlideShow
ImageCaptionType
Type of captions to display.
@ kDateCaption
Dates.
@ kNameCaption
Filenames.
@ kNoCaption
None.
@ kUserCaption
Exif comments.
Provides view datastores for Gallery screens.
@ kVideoOnly
Hide pictures.
Definition: imagemanager.h:80
@ kPicAndVideo
Show Pictures & Videos.
Definition: imagemanager.h:78
@ kPicOnly
Hide videos.
Definition: imagemanager.h:79
ImageFileTransform
Image transformations.
Definition: imagemetadata.h:46
@ kFlipVertical
Reflect about horizontal axis.
Definition: imagemetadata.h:51
@ kRotateCCW
Rotate anti-clockwise.
Definition: imagemetadata.h:49
@ kFlipHorizontal
Reflect about vertical axis.
Definition: imagemetadata.h:50
@ kRotateCW
Rotate clockwise.
Definition: imagemetadata.h:48
@ kResetToExif
Reset to Exif value.
Definition: imagemetadata.h:47
QSharedPointer< ImageItemK > ImagePtrK
Definition: imagetypes.h:165
QList< int > ImageIdList
Definition: imagetypes.h:60
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:15
static void show(uint8_t *buf, int length)
Definition: ringbuffer.cpp:339