24#ifndef NOTIFYICONMENU_H
25#define NOTIFYICONMENU_H
37 enum class NotifyIconMenuItemType
46 class NotifyIconMenuItem
53 NotifyIconMenuItem(NotifyIconMenuItemType type);
57 virtual ~NotifyIconMenuItem() =
default;
62 NotifyIconMenuItemType getType()
const;
65 NotifyIconMenuItemType m_type;
71 class NotifyIconSeparatorMenuItem :
public NotifyIconMenuItem
77 NotifyIconSeparatorMenuItem();
83 class NotifyIconActionMenuItem :
public NotifyIconMenuItem
91 NotifyIconActionMenuItem(
const std::string& label,
const std::function<
void()>& action);
96 const std::string& getLabel()
const;
104 void operator()()
const;
108 std::function<void()> m_action;
120 NotifyIconMenu() =
default;
137 const std::shared_ptr<NotifyIconMenuItem>&
get(
size_t index)
const;
142 size_t addSeparator();
148 bool insertSeparator(
size_t index);
154 bool removeSeparator(
size_t index);
161 size_t addAction(
const std::string& label,
const std::function<
void()>& action);
169 bool insertAction(
size_t index,
const std::string& label,
const std::function<
void()>& action);
175 bool removeAction(
size_t index);
182 const std::shared_ptr<NotifyIconMenuItem>& operator[](
size_t index)
const;
185 std::vector<std::shared_ptr<NotifyIconMenuItem>> m_items;
std::filesystem::path get(UserDirectory directory)
Gets the path of a user directory.
Definition notificationsenteventargs.h:31