MythTV  master
bookmarkmanager.h
Go to the documentation of this file.
1 #ifndef BOOKMARKMANAGER_H
2 #define BOOKMARKMANAGER_H
3 
4 // libmythbase
5 #include <mythmiscutil.h>
6 
7 // libmythui
8 #include <mythscreentype.h>
9 
10 class MythBrowser;
11 class MythDialogBox;
12 
13 class Bookmark
14 {
15  public:
16  Bookmark(void)
17  : category(""), name(""), url(""), isHomepage(false), selected(false)
18  {
19  ;
20  }
21 
22  QString category;
23  QString name;
24  QString sortName;
25  QString url;
26  bool isHomepage;
27  bool selected;
28 
29  inline bool operator == (const Bookmark &b) const
30  {
31  return category == b.category && name == b.name && url == b.url;
32  }
33  static inline bool sortByName(Bookmark *a, Bookmark *b)
34  { return naturalCompare(a->sortName, b->sortName) < 0; }
35 };
36 
38 {
39  Q_OBJECT
40 
41  public:
42 
43  BrowserConfig(MythScreenStack *parent, const char *name = nullptr);
44  ~BrowserConfig() = default;
45 
46  bool Create(void) override; // MythScreenType
47  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
48 
49  private:
52 
56 
59 
60  private slots:
61  void slotSave(void);
62  void slotFocusChanged(void);
63 };
64 
66 {
67  Q_OBJECT
68 
69  public:
70  BookmarkManager(MythScreenStack *parent, const char *name);
72 
73  bool Create(void) override; // MythScreenType
74  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
75 
76  private slots:
79  void slotEditDialogExited(void);
80  void slotDoDeleteCurrent(bool doDelete);
81  void slotDoDeleteMarked(bool doDelete);
82  void slotBrowserClosed(void);
83 
84  void slotSettings(void);
85  void slotSetHomepage(void);
86  void slotAddBookmark(void);
87  void slotEditBookmark(void);
88  void slotDeleteCurrent(void);
89  void slotDeleteMarked(void);
90  void slotShowCurrent(void);
91  void slotShowMarked(void);
92  void slotClearMarked(void);
93 
94  private:
95  uint GetMarkedCount(void);
96  void UpdateGroupList(void);
97  void UpdateURLList(void);
98  void ShowEditDialog(bool edit);
99  void ReloadBookmarks(void);
100 
101  QList<Bookmark*> m_siteList;
102 
104 
108 
110 };
111 
113 
114 #endif
unsigned int slots[4]
Definition: element.c:38
void slotBrowserClosed(void)
MythUIButton * m_okButton
QList< Bookmark * > m_siteList
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
MythUIText * m_messageText
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
QString category
Basic menu dialog, message and a list of options.
void slotAddBookmark(void)
MythUICheckBox * m_enablePluginsCheck
static bool sortByName(Bookmark *a, Bookmark *b)
MythUIText * m_descriptionText
unsigned int uint
Definition: compat.h:140
QString name
Q_DECLARE_METATYPE(GrabberScript *)
void slotBookmarkClicked(MythUIButtonListItem *item)
void UpdateGroupList(void)
MythDialogBox * m_menuPopup
BrowserConfig(MythScreenStack *parent, const char *name=nullptr)
MythUITextEdit * m_commandEdit
void ShowEditDialog(bool edit)
bool operator==(const Bookmark &b) const
void slotDoDeleteCurrent(bool doDelete)
MythUIButtonList * m_groupList
void slotSetHomepage(void)
unsigned char b
Definition: ParseText.cpp:340
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
bool Create(void) override
A text entry and edit widget.
~BrowserConfig()=default
void slotShowMarked(void)
bool keyPressEvent(QKeyEvent *) override
Key event handler.
QString sortName
bool keyPressEvent(QKeyEvent *) override
Key event handler.
void slotDoDeleteMarked(bool doDelete)
MythUIButtonList * m_bookmarkList
void slotShowCurrent(void)
const char * name
Definition: ParseText.cpp:339
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void ReloadBookmarks(void)
void slotGroupSelected(MythUIButtonListItem *item)
void slotFocusChanged(void)
void slotSave(void)
A single button widget.
Definition: mythuibutton.h:21
void slotClearMarked(void)
Bookmark m_savedBookmark
QString url
MythUIText * m_titleText
void slotEditDialogExited(void)
void UpdateURLList(void)
bool Create(void) override
void slotDeleteMarked(void)
uint GetMarkedCount(void)
bool isHomepage
void slotDeleteCurrent(void)
Screen in which all other widgets are contained and rendered.
MythUITextEdit * m_zoomEdit
void slotEditBookmark(void)
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
MythUIButton * m_cancelButton
void slotSettings(void)
BookmarkManager(MythScreenStack *parent, const char *name)
Bookmark(void)