5#ifndef MOLYBDEN_TRAY_HPP
6#define MOLYBDEN_TRAY_HPP
11#include "molybden/tray/tray_events.hpp"
12#include "molybden/ui/bitmap.hpp"
36 static std::shared_ptr<Tray>
create(std::shared_ptr<App>
app);
41 virtual std::shared_ptr<App>
app() = 0;
92 virtual void setImage(
const std::string& file_path) = 0;
99 virtual void setMenu(std::shared_ptr<CustomMenu> menu) = 0;
111 virtual std::string
title()
const = 0;
A class that contains all tray events.
Definition tray_events.hpp:27
A system tray item.
Definition tray.hpp:26
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 setTitle(const std::string &title)=0
Sets the tray title.
virtual std::shared_ptr< App > app()=0
Returns the application instance for this tray.
virtual bool isDestroyed() const =0
Indicates whether the tray is destroyed.
virtual void setImage(const std::string &file_path)=0
Sets the tray image from the given absolute image file path.
virtual std::string tooltip() const =0
Returns the tray tooltip text.
virtual void setTooltip(const std::string &text)=0
Sets the tray tooltip text.
virtual void destroy()=0
Destroys the tray.
virtual std::string title() const =0
Returns the tray title.
virtual void setMenu(std::shared_ptr< CustomMenu > menu)=0
Sets the pull-down menu displayed when the user clicks the tray icon.