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


Interface class for creating custom context menus.  




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

Inheritance diagram for Context\+Menu\+Interface\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=12.000000cm]{a00460}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{a00460_a4218366cfae9b474e0f62ff75239ea66}{add\+Context\+Menu\+Item} (Q\+Action $\ast$\+\_\+action, \hyperlink{a02438_a238952a111d7daede783625350d7b287}{Context\+Menu\+Type} \+\_\+type)
\begin{DoxyCompactList}\small\item\em Add an entry for a context \hyperlink{a00802}{Menu}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a00460_a60e636363c9fd434860c981ef926b0d2}{virtual \hyperlink{a00460_a60e636363c9fd434860c981ef926b0d2}{$\sim$\+Context\+Menu\+Interface} ()}\label{a00460_a60e636363c9fd434860c981ef926b0d2}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
virtual void \hyperlink{a00460_adef99c7fe7a2bc953f8e3f2adc5e3204}{add\+Context\+Menu\+Item} (Q\+Action $\ast$\+\_\+action, \hyperlink{a00477}{Data\+Type} \+\_\+object\+Type, \hyperlink{a02438_a238952a111d7daede783625350d7b287}{Context\+Menu\+Type} \+\_\+type)
\begin{DoxyCompactList}\small\item\em Add an entry for a context \hyperlink{a00802}{Menu}. \end{DoxyCompactList}\item 
\hypertarget{a00460_a0cc8237794b623236a8ef682628a6e48}{virtual void \hyperlink{a00460_a0cc8237794b623236a8ef682628a6e48}{hide\+Context\+Menu} ()}\label{a00460_a0cc8237794b623236a8ef682628a6e48}

\begin{DoxyCompactList}\small\item\em hide the main context menu \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Slots}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{a00460_a74cbe2257620672cbc565cc6536c0332}{slot\+Update\+Context\+Menu} (int \+\_\+object\+Id)
\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{a00460_a5f04c1c620257db8a0b45b41265bdf37}{slot\+Update\+Context\+Menu\+Node} (int \+\_\+node\+Id)
\item 
virtual void \hyperlink{a00460_a4ef981a842558cedae3b6c882af11416}{slot\+Update\+Context\+Menu\+Background} ()
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interface class for creating custom context menus. 

\hyperlink{contextMenuInterfacePage}{Detailed description} ~\newline
~\newline
Using this interface you can create custom context menus for your plugin. You can choose between context menus for objects, nodes or the background.~\newline
Before a menu of the requested type is shown, an update function for the specific type will be invoked by the core. You have to create a Q\+Action. The signals and slots of your actions have to be connected to your plugin. Just connect them as usual. Only visibility of the menu is handled by the core. You can also add submenus to the context menus. Just add the action for the menu ( menu-\/$>$menu\+Action() ) 

Definition at line 101 of file Context\+Menu\+Interface.\+hh.



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


Add an entry for a context \hyperlink{a00802}{Menu}. 

Create an Action (Can also be the action of a \hyperlink{a00802}{Menu}) and register this menu as a context menu to the core. This Action will be visible when you right click in the viewer widget on an item of the given context menu type. You can add a whole menu here by adding the action\+: menu-\/$>$menu\+Action() of your own menu.


\begin{DoxyParams}{Parameters}
{\em \+\_\+action} & Pointer to the new Action \\
\hline
{\em \+\_\+type} & Type context menu type \\
\hline
\end{DoxyParams}


Definition at line 120 of file Context\+Menu\+Interface.\+hh.

\hypertarget{a00460_adef99c7fe7a2bc953f8e3f2adc5e3204}{\index{Context\+Menu\+Interface@{Context\+Menu\+Interface}!add\+Context\+Menu\+Item@{add\+Context\+Menu\+Item}}
\index{add\+Context\+Menu\+Item@{add\+Context\+Menu\+Item}!Context\+Menu\+Interface@{Context\+Menu\+Interface}}
\subsubsection[{add\+Context\+Menu\+Item}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Context\+Menu\+Interface\+::add\+Context\+Menu\+Item (
\begin{DoxyParamCaption}
\item[{Q\+Action $\ast$}]{\+\_\+action, }
\item[{{\bf Data\+Type}}]{\+\_\+object\+Type, }
\item[{{\bf Context\+Menu\+Type}}]{\+\_\+type}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a00460_adef99c7fe7a2bc953f8e3f2adc5e3204}


Add an entry for a context \hyperlink{a00802}{Menu}. 

Create an action (Can also be the action of a \hyperlink{a00802}{Menu}) and register this action as a context menu entry to the core. This Action will only be visible if the picked object is of the given \hyperlink{a00477}{Data\+Type}. To support multiple object types with your menu, you can emit this signal multiple times with the same action but different Data\+Types. You can add a whole \hyperlink{a00802}{Menu} here by adding the action\+: menu-\/$>$menu\+Action()


\begin{DoxyParams}{Parameters}
{\em \+\_\+action} & Pointer to the new action \\
\hline
{\em \+\_\+object\+Type} & Type of the picked object \\
\hline
{\em \+\_\+type} & Type of the context \hyperlink{a00802}{Menu} ( See Context\+Menu\+Type ) \\
\hline
\end{DoxyParams}


Definition at line 134 of file Context\+Menu\+Interface.\+hh.

\hypertarget{a00460_a74cbe2257620672cbc565cc6536c0332}{\index{Context\+Menu\+Interface@{Context\+Menu\+Interface}!slot\+Update\+Context\+Menu@{slot\+Update\+Context\+Menu}}
\index{slot\+Update\+Context\+Menu@{slot\+Update\+Context\+Menu}!Context\+Menu\+Interface@{Context\+Menu\+Interface}}
\subsubsection[{slot\+Update\+Context\+Menu}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Context\+Menu\+Interface\+::slot\+Update\+Context\+Menu (
\begin{DoxyParamCaption}
\item[{int}]{\+\_\+object\+Id}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}, {\ttfamily [virtual]}, {\ttfamily [slot]}}}\label{a00460_a74cbe2257620672cbc565cc6536c0332}
When the main application requests a context menu, this slot is called before showing the window. If an object is picked the id will be given in this call so you can change the contents of your menu depending on the given object.


\begin{DoxyParams}{Parameters}
{\em \+\_\+object\+Id} & id of the object \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{a01348_ac99c2fe84fcfe3bf7b1b7a282c55c00a}{Type\+B\+Spline\+Curve\+Plugin}, \hyperlink{a01349_a9bcd155b6560208d4616fd98d776e137}{Type\+B\+Spline\+Surface\+Plugin}, and \hyperlink{a01368_a453c3df89aeafbd81fb6938967f187e2}{Type\+Skeleton\+Plugin}.



Definition at line 147 of file Context\+Menu\+Interface.\+hh.

\hypertarget{a00460_a4ef981a842558cedae3b6c882af11416}{\index{Context\+Menu\+Interface@{Context\+Menu\+Interface}!slot\+Update\+Context\+Menu\+Background@{slot\+Update\+Context\+Menu\+Background}}
\index{slot\+Update\+Context\+Menu\+Background@{slot\+Update\+Context\+Menu\+Background}!Context\+Menu\+Interface@{Context\+Menu\+Interface}}
\subsubsection[{slot\+Update\+Context\+Menu\+Background}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Context\+Menu\+Interface\+::slot\+Update\+Context\+Menu\+Background (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}, {\ttfamily [virtual]}}}\label{a00460_a4ef981a842558cedae3b6c882af11416}
When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating that the background has been picked. 

Definition at line 161 of file Context\+Menu\+Interface.\+hh.

\hypertarget{a00460_a5f04c1c620257db8a0b45b41265bdf37}{\index{Context\+Menu\+Interface@{Context\+Menu\+Interface}!slot\+Update\+Context\+Menu\+Node@{slot\+Update\+Context\+Menu\+Node}}
\index{slot\+Update\+Context\+Menu\+Node@{slot\+Update\+Context\+Menu\+Node}!Context\+Menu\+Interface@{Context\+Menu\+Interface}}
\subsubsection[{slot\+Update\+Context\+Menu\+Node}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Context\+Menu\+Interface\+::slot\+Update\+Context\+Menu\+Node (
\begin{DoxyParamCaption}
\item[{int}]{\+\_\+node\+Id}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}, {\ttfamily [virtual]}}}\label{a00460_a5f04c1c620257db8a0b45b41265bdf37}
When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating that a scenegraph node not belonging to an object has been picked.


\begin{DoxyParams}{Parameters}
{\em \+\_\+node\+Id} & id of the picked node \\
\hline
\end{DoxyParams}


Definition at line 155 of file Context\+Menu\+Interface.\+hh.



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