\hypertarget{classMenuInterface}{}\section{Menu\+Interface Class Reference}
\label{classMenuInterface}\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]{classMenuInterface}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{classMenuInterface_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 
\mbox{\Hypertarget{classMenuInterface_a9691f35ec992aed2d68ea655f5dfeebf}\label{classMenuInterface_a9691f35ec992aed2d68ea655f5dfeebf}} 
virtual \hyperlink{classMenuInterface_a9691f35ec992aed2d68ea655f5dfeebf}{$\sim$\+Menu\+Interface} ()
\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
virtual void \hyperlink{classMenuInterface_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{classMenuInterface_acc17c24eef7fae4e5b2e7060833c5f5e}{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 81 of file Menu\+Interface.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{classMenuInterface_abf5e3c6a60ec91483e4ca307899370f9}\label{classMenuInterface_abf5e3c6a60ec91483e4ca307899370f9}} 
\index{Menu\+Interface@{Menu\+Interface}!add\+Menubar\+Action@{add\+Menubar\+Action}}
\index{add\+Menubar\+Action@{add\+Menubar\+Action}!Menu\+Interface@{Menu\+Interface}}
\subsubsection{\texorpdfstring{add\+Menubar\+Action()}{addMenubarAction()}}
{\footnotesize\ttfamily 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]}}



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{classMenuInterface_abf5e3c6a60ec91483e4ca307899370f9}{addMenubarAction}( colorMenu->menuAction(), \hyperlink{MenuInterface_8hh_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 116 of file Menu\+Interface.\+hh.

\mbox{\Hypertarget{classMenuInterface_acc17c24eef7fae4e5b2e7060833c5f5e}\label{classMenuInterface_acc17c24eef7fae4e5b2e7060833c5f5e}} 
\index{Menu\+Interface@{Menu\+Interface}!add\+Menubar\+Actions@{add\+Menubar\+Actions}}
\index{add\+Menubar\+Actions@{add\+Menubar\+Actions}!Menu\+Interface@{Menu\+Interface}}
\subsubsection{\texorpdfstring{add\+Menubar\+Actions()}{addMenubarActions()}}
{\footnotesize\ttfamily 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]}}



Add multiple actions to the menu bar. 

Does the same as multiple calls to add\+Menubar\+Action except it doesn\textquotesingle{}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 126 of file Menu\+Interface.\+hh.

\mbox{\Hypertarget{classMenuInterface_ac65606e94a8c030c72489616cb8015f9}\label{classMenuInterface_ac65606e94a8c030c72489616cb8015f9}} 
\index{Menu\+Interface@{Menu\+Interface}!get\+Menubar\+Menu@{get\+Menubar\+Menu}}
\index{get\+Menubar\+Menu@{get\+Menubar\+Menu}!Menu\+Interface@{Menu\+Interface}}
\subsubsection{\texorpdfstring{get\+Menubar\+Menu}{getMenubarMenu}}
{\footnotesize\ttfamily 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]}}



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{classMenu}{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\+NU 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\textquotesingle{}t exist \\
\hline
\end{DoxyParams}


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



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