\hypertarget{a00804}{\section{Menu\+Interface Class Reference}
\label{a00804}\index{Menu\+Interface@{Menu\+Interface}}
}


Interface for all plugins which provide entries to the main menubar.  




{\ttfamily \#include $<$Open\+Flipper/\+Base\+Plugin/\+Menu\+Interface.\+hh$>$}

Inheritance diagram for Menu\+Interface\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=0.963855cm]{a00804}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{a00804_ac65606e94a8c030c72489616cb8015f9}{get\+Menubar\+Menu} (Q\+String \+\_\+name, Q\+Menu $\ast$\&\+\_\+menu, bool \+\_\+create)
\begin{DoxyCompactList}\small\item\em Get a existing top level menu pointer or create a new one. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a00804_a9691f35ec992aed2d68ea655f5dfeebf}{virtual \hyperlink{a00804_a9691f35ec992aed2d68ea655f5dfeebf}{$\sim$\+Menu\+Interface} ()}\label{a00804_a9691f35ec992aed2d68ea655f5dfeebf}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
virtual void \hyperlink{a00804_abf5e3c6a60ec91483e4ca307899370f9}{add\+Menubar\+Action} (Q\+Action $\ast$\+\_\+action, Q\+String \+\_\+name)
\begin{DoxyCompactList}\small\item\em Adds an action to the menubar. \end{DoxyCompactList}\item 
virtual void \hyperlink{a00804_a666d875592f8337f24b78a8529524b58}{add\+Menubar\+Actions} (std\+::vector$<$ Q\+Action $\ast$ $>$ \&\+\_\+actions, Q\+String \+\_\+name)
\begin{DoxyCompactList}\small\item\em Add multiple actions to the menu bar. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interface for all plugins which provide entries to the main menubar. 

\hyperlink{menuInterfacePage}{Detailed description} ~\newline
~\newline
To add custom menus or actions to the menubar, you have to use this interface class. Create your own Q\+Menu or Q\+Action and emit add\+Menubar\+Action to add it to one of the menubar top level menus. You can also get a pointer to one existing top level menu or create a new one with the get\+Menubar\+Menu function. You can connect the signals and slots for your menu or action inside the plugin. 

Definition at line 91 of file Menu\+Interface.\+hh.



\subsection{Member Function Documentation}
\hypertarget{a00804_abf5e3c6a60ec91483e4ca307899370f9}{\index{Menu\+Interface@{Menu\+Interface}!add\+Menubar\+Action@{add\+Menubar\+Action}}
\index{add\+Menubar\+Action@{add\+Menubar\+Action}!Menu\+Interface@{Menu\+Interface}}
\subsubsection[{add\+Menubar\+Action}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Menu\+Interface\+::add\+Menubar\+Action (
\begin{DoxyParamCaption}
\item[{Q\+Action $\ast$}]{\+\_\+action, }
\item[{Q\+String}]{\+\_\+name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a00804_abf5e3c6a60ec91483e4ca307899370f9}


Adds an action to the menubar. 

Add an action to one of the menubar top level menus ~\newline
~\newline
 Example \+: ~\newline

\begin{DoxyCode}
QMenu *colorMenu = \textcolor{keyword}{new} QMenu(tr(\textcolor{stringliteral}{"&Colors"})); 
emit \hyperlink{a00804_abf5e3c6a60ec91483e4ca307899370f9}{addMenubarAction}( colorMenu->menuAction(), \hyperlink{a02445_a42935e766956ccb9af2c230681ddc155}{TOOLSMENU} );
\end{DoxyCode}


All actions or sub actions can be freely controlled by yourself. You have to connect the required signals and slots to your plugin.


\begin{DoxyParams}{Parameters}
{\em \+\_\+action} & Pointer to the new action \\
\hline
{\em \+\_\+name} & Name of the menu \\
\hline
\end{DoxyParams}


Definition at line 126 of file Menu\+Interface.\+hh.

\hypertarget{a00804_a666d875592f8337f24b78a8529524b58}{\index{Menu\+Interface@{Menu\+Interface}!add\+Menubar\+Actions@{add\+Menubar\+Actions}}
\index{add\+Menubar\+Actions@{add\+Menubar\+Actions}!Menu\+Interface@{Menu\+Interface}}
\subsubsection[{add\+Menubar\+Actions}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Menu\+Interface\+::add\+Menubar\+Actions (
\begin{DoxyParamCaption}
\item[{std\+::vector$<$ Q\+Action $\ast$ $>$ \&}]{\+\_\+actions, }
\item[{Q\+String}]{\+\_\+name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a00804_a666d875592f8337f24b78a8529524b58}


Add multiple actions to the menu bar. 

Does the same as multiple calls to add\+Menubar\+Action except it doesn't insert a separator between the individual items.


\begin{DoxyParams}{Parameters}
{\em \+\_\+actions} & Vector of pointers to the new actions. \\
\hline
{\em \+\_\+name} & Name of the menu. \\
\hline
\end{DoxyParams}


Definition at line 136 of file Menu\+Interface.\+hh.

\hypertarget{a00804_ac65606e94a8c030c72489616cb8015f9}{\index{Menu\+Interface@{Menu\+Interface}!get\+Menubar\+Menu@{get\+Menubar\+Menu}}
\index{get\+Menubar\+Menu@{get\+Menubar\+Menu}!Menu\+Interface@{Menu\+Interface}}
\subsubsection[{get\+Menubar\+Menu}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Menu\+Interface\+::get\+Menubar\+Menu (
\begin{DoxyParamCaption}
\item[{Q\+String}]{\+\_\+name, }
\item[{Q\+Menu $\ast$\&}]{\+\_\+menu, }
\item[{bool}]{\+\_\+create}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}, {\ttfamily [signal]}}}\label{a00804_ac65606e94a8c030c72489616cb8015f9}


Get a existing top level menu pointer or create a new one. 

Checks if a top level menu is present and creates one if needed ~\newline
 
\begin{DoxyParams}{Parameters}
{\em \+\_\+name} & \hyperlink{a00802}{Menu} name (see F\+I\+L\+E\+M\+E\+N\+U/\+V\+I\+E\+W\+M\+E\+N\+U/\+T\+O\+O\+L\+S\+M\+E\+N\+U example defines or use other Q\+Strings ) \\
\hline
{\em \+\_\+menu} & The returned top level menu \\
\hline
{\em \+\_\+create} & Should a new menu be created if id doesn't exist \\
\hline
\end{DoxyParams}


Definition at line 108 of file Menu\+Interface.\+hh.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Open\+Flipper/\+Base\+Plugin/\hyperlink{a02445}{Menu\+Interface.\+hh}\end{DoxyCompactItemize}
