5#ifndef MOBROWSER_TRAY_HPP
6#define MOBROWSER_TRAY_HPP
11#include "mobrowser/tray/tray_events.hpp"
39 static std::shared_ptr<Tray>
create(std::shared_ptr<App>
app);
44 virtual std::shared_ptr<App>
app() = 0;
96 virtual void setImage(
const std::string& file_path) = 0;
112 virtual void setMenu(std::shared_ptr<CustomMenu> menu) = 0;
122 virtual void openMenu(std::shared_ptr<CustomMenu> menu) = 0;
140 virtual std::string
title()
const = 0;
A class that contains all tray events.
Definition tray_events.hpp:39
A system tray item.
Definition tray.hpp:28
virtual void setTitle(const std::string &title)=0
Sets the tray title.
static std::shared_ptr< Tray > create(std::shared_ptr< App > app)
Creates a new tray item for the given application and displays it in the system tray on macOS or noti...
virtual void openMenu(std::shared_ptr< CustomMenu > menu)=0
Opens the pull-down menu of the tray item.
virtual void setImage(const std::string &file_path)=0
Sets the tray image from the given absolute image file path.
virtual bool isDestroyed() const =0
Indicates whether the tray item is destroyed.
virtual std::string title() const =0
Returns the tray title.
virtual void setTooltip(const std::string &text)=0
Sets the tray tooltip text.
virtual void setMenu(std::shared_ptr< CustomMenu > menu)=0
Sets the pull-down menu displayed when the user clicks the tray icon.
virtual void destroy()=0
Destroys the tray.
virtual std::string tooltip() const =0
Returns the tray tooltip text.
virtual std::shared_ptr< App > app()=0
Returns the application instance for this tray.