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
31public slots:
32 void Start();
33 void Close() override; // MythScreenType
35
36private:
37 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
38 void mediaEvent(MythMediaEvent *event) override // MythUIType
39 { m_mgr.DeviceEvent(event); }
40 void customEvent(QEvent *event) override; // MythUIType
41 void RemoveImages(const QStringList &ids, bool deleted = true);
42 void BuildImageList();
43 void ResetUiSelection();
47 void UpdateScanProgress(const QString &scanner, int current, int total);
49 void SelectZoomWidget(int change);
50 QString CheckThumbnail(MythUIButtonListItem *item, const ImagePtrK &im,
51 ImageIdList &request, int index);
52 static void UpdateThumbnail(MythUIButtonListItem *button, const ImagePtrK &im,
53 const QString &url, int index);
54 void MenuMain();
55 void MenuShow(MythMenu *mainMenu);
56 void MenuMarked(MythMenu *mainMenu);
57 void MenuPaste(MythMenu *mainMenu);
58 void MenuTransform(MythMenu *mainMenu);
59 void MenuAction(MythMenu *mainMenu);
60 void MenuSlideshow(MythMenu *mainMenu);
61 bool DirSelectUp();
62 void DirSelectDown();
63 void ShowDialog(const QString &msg, const QString &event = "");
64
65private slots:
66 void LoadData(int parent);
67 void SelectImage(int id);
72 void ShowDetails();
83 void DoMarkItem(bool mark);
84 void MarkItem() { DoMarkItem(true); }
85 void UnmarkItem() { DoMarkItem(false); }
86 void DoMarkAll(bool mark = true);
87 void MarkAll() { DoMarkAll(true); }
88 void UnmarkAll() { DoMarkAll(false); }
89 void MarkInvertAll();
90 void DoHideItem(bool hide = true);
91 void HideItem() { DoHideItem(true); }
92 void Unhide() { DoHideItem(false); }
93 void DoHideMarked(bool hide = true);
94 void HideMarked() { DoHideMarked(true); }
95 void UnhideMarked() { DoHideMarked(false); }
96 void ShowRenameInput();
97 void DoShowHidden(bool show = true);
98 void ShowHidden() { DoShowHidden(true); }
99 void HideHidden() { DoShowHidden(false); }
100 void DoSetCover(bool reset = false);
101 void SetCover() { DoSetCover(false); }
102 void ResetCover() { DoSetCover(true); }
103 void DoShowType(int type);
107 void ZoomIn();
108 void ZoomOut();
109 void ShowSettings();
110 void DoScanAction(bool start);
111 void StartScan() { DoScanAction(true); }
112 void StopScan() { DoScanAction(false); }
113 void DeleteItem();
114 void DeleteMarked();
115 void Import();
116 void MakeDir();
117 void Eject();
118 void Copy(bool deleteAfter);
119 void Copy() { Copy(false); }
120 void Move();
121 void ShowPassword();
122 static void DoRepeat(int on);
123 static void RepeatOn() { DoRepeat(1); }
124 static void RepeatOff() { DoRepeat(0); }
125
126private:
127 using IntPair = QPair<int,int>;
128
129 // Theme widgets
139
141 QList<MythUIButtonList *> m_zoomWidgets;
142 int m_zoomLevel {0};
143
148
150 QHash<QString, IntPair> m_scanProgress;
152 QSet<QString> m_scanActive;
153
156
157 using ThumbLocation = QPair<MythUIButtonListItem *, int>;
159 QMultiHash<int, ThumbLocation> m_pendingMap;
160
161 QSet<int> m_thumbExists;
162 bool m_editsAllowed {false};
163};
164
165
166#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:341