\section{QXEmbed Class Reference}
\label{classQXEmbed}\index{QXEmbed@{QXEmbed}}
A QXEmbed widget serves as an embedder that can manage one single embedded X-window. The QXEmbed widget is a graphical socket that can embed an external X-Window.  


{\tt \#include $<$qxembed.h$>$}

Inheritance diagram for QXEmbed:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=49pt]{classQXEmbed__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for QXEmbed:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=49pt]{classQXEmbed__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Protocol} \{ {\bf XEMBED}, 
{\bf XPLAIN}
 \}
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf embedded\-Window\-Destroyed} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf QXEmbed} ({\bf QWidget} $\ast$parent=0, const char $\ast$name=0, WFlags f=0)
\item 
{\bf $\sim$QXEmbed} ()
\item 
void {\bf set\-Protocol} (Protocol proto)
\item 
Protocol {\bf protocol} ()
\item 
void {\bf embed} (WId w)
\item 
WId {\bf embedded\-Win\-Id} () const 
\item 
void {\bf send\-Delete} (void)
\item 
void {\bf set\-Auto\-Delete} (bool)
\item 
bool {\bf auto\-Delete} () const 
\item 
{\bf QSize} {\bf size\-Hint} () const \label{classQXEmbed_a9}

\item 
{\bf QSize} {\bf minimum\-Size\-Hint} () const \label{classQXEmbed_a10}

\item 
{\bf QSize\-Policy} {\bf size\-Policy} () const \label{classQXEmbed_a11}

\item 
bool {\bf event\-Filter} ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)\label{classQXEmbed_a12}

\item 
bool {\bf custom\-Whats\-This} () const \label{classQXEmbed_a13}

\item 
void {\bf enter\-Whats\-This\-Mode} ()\label{classQXEmbed_a14}

\item 
virtual void {\bf reparent} ({\bf QWidget} $\ast$parent, WFlags f, const {\bf QPoint} \&p, bool show\-It=false)\label{classQXEmbed_a15}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static void {\bf initialize} ()
\item 
static void {\bf embed\-Client\-Into\-Window} ({\bf QWidget} $\ast$client, WId window)
\item 
static bool {\bf process\-Client\-Cmdline} ({\bf QWidget} $\ast$client, int \&argc, char $\ast$$\ast$argv)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
bool {\bf event} ({\bf QEvent} $\ast$)\label{classQXEmbed_b0}

\item 
void {\bf key\-Press\-Event} ({\bf QKey\-Event} $\ast$)\label{classQXEmbed_b1}

\item 
void {\bf key\-Release\-Event} ({\bf QKey\-Event} $\ast$)\label{classQXEmbed_b2}

\item 
void {\bf focus\-In\-Event} ({\bf QFocus\-Event} $\ast$)\label{classQXEmbed_b3}

\item 
void {\bf focus\-Out\-Event} ({\bf QFocus\-Event} $\ast$)\label{classQXEmbed_b4}

\item 
void {\bf resize\-Event} ({\bf QResize\-Event} $\ast$)\label{classQXEmbed_b5}

\item 
void {\bf show\-Event} ({\bf QShow\-Event} $\ast$)\label{classQXEmbed_b6}

\item 
bool {\bf x11Event} (XEvent $\ast$)\label{classQXEmbed_b7}

\item 
virtual void {\bf window\-Changed} (WId w)
\item 
bool {\bf focus\-Next\-Prev\-Child} (bool next)\label{classQXEmbed_b9}

\end{CompactItemize}


\subsection{Detailed Description}
A QXEmbed widget serves as an embedder that can manage one single embedded X-window. The QXEmbed widget is a graphical socket that can embed an external X-Window. 

These so-called client windows can be arbitrary {\bf Qt} or non {\bf Qt} applications.

There are two different ways of using QXEmbed, from the client side or from the embedder's side.

Embedding from the client's side requires that the client knows the window identifier of the respective embedder widget. Use either {\bf embed\-Client\-Into\-Window()}{\rm (p.\,\pageref{classQXEmbed_e1})} or the high-level wrapper {\bf process\-Client\-Cmdline()}{\rm (p.\,\pageref{classQXEmbed_e2})}. This is only possible when the client is a {\bf Qt} application.

When using it from the embedder's side, you must know the window identifier of the window that should be embedded. Simply call {\bf embed()}{\rm (p.\,\pageref{classQXEmbed_a4})} with this identifier as parameter. If the client is a {\bf Qt} application, make sure it has called {\bf QXEmbed::initialize()}{\rm (p.\,\pageref{classQXEmbed_e0})}. Otherwise you should probably call set\-Protocol(XPLAIN) before {\bf embed()}{\rm (p.\,\pageref{classQXEmbed_a4})}.

Reimplement the change handler {\bf window\-Changed()}{\rm (p.\,\pageref{classQXEmbed_b8})} to catch embedding or the destruction of embedded windows. In the latter case, the embedder also emits a signal {\bf embedded\-Window\-Destroyed()}{\rm (p.\,\pageref{classQXEmbed_l0})} for convenience.



Definition at line 58 of file qxembed.h.

\subsection{Constructor \& Destructor Documentation}
\index{QXEmbed@{QXEmbed}!QXEmbed@{QXEmbed}}
\index{QXEmbed@{QXEmbed}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}QXEmbed::QXEmbed ({\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0}, WFlags {\em f} = {\tt 0})}\label{classQXEmbed_a0}


Constructs a xembed widget. 

The parent, name and f arguments are passed to the {\bf QFrame} constructor. 

Definition at line 608 of file qxembed.cpp.

References initialize(), QWidget::QWidget(), QApplication::send\-Posted\-Events(), QWidget::set\-Accept\-Drops(), QWidget::set\-Focus\-Policy(), QWidget::set\-Key\-Compression(), QWidget::top\-Level\-Widget(), and QWidget::win\-Id().\index{QXEmbed@{QXEmbed}!~QXEmbed@{$\sim$QXEmbed}}
\index{~QXEmbed@{$\sim$QXEmbed}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}QXEmbed::$\sim${\bf QXEmbed} ()}\label{classQXEmbed_a1}


Destructor. 

Cleans up the focus if necessary. 

Definition at line 668 of file qxembed.cpp.

References auto\-Delete(), send\-Delete(), QWidget::top\-Level\-Widget(), and QWidget::win\-Id().

\subsection{Member Function Documentation}
\index{QXEmbed@{QXEmbed}!initialize@{initialize}}
\index{initialize@{initialize}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QXEmbed::initialize ()\hspace{0.3cm}{\tt  [static]}}\label{classQXEmbed_e0}


Embedded applications should call this function to make sure they support the XEMBED protocol. 

It is called automatically when you use {\bf embed\-Client\-Into\-Window()}{\rm (p.\,\pageref{classQXEmbed_e1})} or {\bf process\-Client\-Cmdline()}{\rm (p.\,\pageref{classQXEmbed_e2})}. Clients might have to call it manually when you use {\bf embed()}{\rm (p.\,\pageref{classQXEmbed_a4})}. 

Definition at line 568 of file qxembed.cpp.

References QPtr\-Dict::set\-Auto\-Delete().

Referenced by embed\-Client\-Into\-Window(), KSystem\-Tray::KSystem\-Tray(), and QXEmbed().\index{QXEmbed@{QXEmbed}!setProtocol@{setProtocol}}
\index{setProtocol@{setProtocol}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QXEmbed::set\-Protocol (Protocol {\em proto})}\label{classQXEmbed_a2}


Sets the protocol used for embedding windows. 

This function must be called before embedding a window. Protocol XEMBED provides maximal functionality (focus, tabs, etc) but requires explicit cooperation from the embedded window. Protocol XPLAIN provides maximal compatibility with embedded applications that do not support the XEMBED protocol. The default is XEMBED.

Non {\bf KDE} applications should be embedded with protocol XPLAIN. This does not happen automatically yet. You must call {\bf set\-Protocol()}{\rm (p.\,\pageref{classQXEmbed_a2})} explicitly. 

Definition at line 739 of file qxembed.cpp.\index{QXEmbed@{QXEmbed}!protocol@{protocol}}
\index{protocol@{protocol}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}QXEmbed::Protocol QXEmbed::protocol ()}\label{classQXEmbed_a3}


Returns the protocol used for embedding the current window. 

\begin{Desc}
\item[Returns:]the protocol used by QXEmbed. \end{Desc}


Definition at line 749 of file qxembed.cpp.\index{QXEmbed@{QXEmbed}!embed@{embed}}
\index{embed@{embed}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QXEmbed::embed (WId {\em w})}\label{classQXEmbed_a4}


Embeds the window with the identifier w into this xembed widget. 

This function is useful if the embedder knows about the client window that should be embedded. Often it is vice versa: the client knows about its target embedder. In that case, it is not necessary to call {\bf embed()}{\rm (p.\,\pageref{classQXEmbed_a4})}. Instead, the client will call the static function {\bf embed\-Client\-Into\-Window()}{\rm (p.\,\pageref{classQXEmbed_e1})}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em w}]the identifier of the window to embed \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf embedded\-Win\-Id()}{\rm (p.\,\pageref{classQXEmbed_a5})} \end{Desc}


Definition at line 958 of file qxembed.cpp.

References endl(), QApplication::flush\-X(), kd\-Debug(), and QWidget::win\-Id().\index{QXEmbed@{QXEmbed}!embeddedWinId@{embeddedWinId}}
\index{embeddedWinId@{embeddedWinId}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}WId QXEmbed::embedded\-Win\-Id () const}\label{classQXEmbed_a5}


Returns the window identifier of the embedded window, or 0 if no window is embedded yet. 

\begin{Desc}
\item[Returns:]the id of the embedded window (0 if no window is embedded) \end{Desc}


Definition at line 1012 of file qxembed.cpp.\index{QXEmbed@{QXEmbed}!embedClientIntoWindow@{embedClientIntoWindow}}
\index{embedClientIntoWindow@{embedClientIntoWindow}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QXEmbed::embed\-Client\-Into\-Window ({\bf QWidget} $\ast$ {\em client}, WId {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classQXEmbed_e1}


A function for clients that embed themselves. {\bf process\-Client\-Cmdline()}{\rm (p.\,\pageref{classQXEmbed_e2})}. 

The widget client will be embedded in the window window. The application has to ensure that window is the handle of the window identifier of an QXEmbed widget.

Definition at line 1234 of file qxembed.cpp.

References initialize().

Referenced by process\-Client\-Cmdline().\index{QXEmbed@{QXEmbed}!processClientCmdline@{processClientCmdline}}
\index{processClientCmdline@{processClientCmdline}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool QXEmbed::process\-Client\-Cmdline ({\bf QWidget} $\ast$ {\em client}, int \& {\em argc}, char $\ast$$\ast$ {\em argv})\hspace{0.3cm}{\tt  [static]}}\label{classQXEmbed_e2}


A utility function for clients that embed theirselves. 

The widget client will be embedded in the window that is passed as -embed command line argument.

The function returns true on success or false if no such command line parameter is specified.

\begin{Desc}
\item[See also:]{\bf embed\-Client\-Into\-Window()}{\rm (p.\,\pageref{classQXEmbed_e1})} \end{Desc}


Definition at line 1202 of file qxembed.cpp.

References embed\-Client\-Into\-Window(), and QCString::to\-Int().\index{QXEmbed@{QXEmbed}!sendDelete@{sendDelete}}
\index{sendDelete@{sendDelete}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QXEmbed::send\-Delete (void)}\label{classQXEmbed_a6}


Sends a WM\_\-DELETE\_\-WINDOW message to the embedded window. 

This is what typically happens when you click on the close button of a window manager decoration. This should cause the embedded application to cleanly close the window. Signal {\bf embedded\-Window\-Destroyed()}{\rm (p.\,\pageref{classQXEmbed_l0})} can be used to monitor the status of the embedded window. 

Definition at line 723 of file qxembed.cpp.

Referenced by $\sim$QXEmbed().\index{QXEmbed@{QXEmbed}!setAutoDelete@{setAutoDelete}}
\index{setAutoDelete@{setAutoDelete}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QXEmbed::set\-Auto\-Delete (bool)}\label{classQXEmbed_a7}


Selects what shoud be done with the embedded window when the embedding window is destroyed. 

When the argument is true, the embedded window is kept alive, is hidden, and receives a WM\_\-DELETE\_\-WINDOW message using {\bf send\-Delete()}{\rm (p.\,\pageref{classQXEmbed_a6})}. This is the default. Otherwise, the destruction of the QXEmbed object simply destroys the embedded window.

\begin{Desc}
\item[See also:]{\bf send\-Delete()}{\rm (p.\,\pageref{classQXEmbed_a6})} \end{Desc}


Definition at line 1282 of file qxembed.cpp.\index{QXEmbed@{QXEmbed}!autoDelete@{autoDelete}}
\index{autoDelete@{autoDelete}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool QXEmbed::auto\-Delete () const}\label{classQXEmbed_a8}


Returns the value of flag indicating what shoud be done with the embedded window when the embedding window is destroyed. 

\begin{Desc}
\item[See also:]{\bf set\-Auto\-Delete()}{\rm (p.\,\pageref{classQXEmbed_a7})} \end{Desc}


Definition at line 1288 of file qxembed.cpp.

Referenced by $\sim$QXEmbed().\index{QXEmbed@{QXEmbed}!embeddedWindowDestroyed@{embeddedWindowDestroyed}}
\index{embeddedWindowDestroyed@{embeddedWindowDestroyed}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QXEmbed::embedded\-Window\-Destroyed ()\hspace{0.3cm}{\tt  [signal]}}\label{classQXEmbed_l0}


This signal is emitted when the embedded window has been lost (destroyed or reparented away). 

\begin{Desc}
\item[See also:]{\bf embedded\-Win\-Id()}{\rm (p.\,\pageref{classQXEmbed_a5})} \end{Desc}
\index{QXEmbed@{QXEmbed}!windowChanged@{windowChanged}}
\index{windowChanged@{windowChanged}!QXEmbed@{QXEmbed}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QXEmbed::window\-Changed (WId {\em w})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classQXEmbed_b8}


A change handler that indicates that the embedded window has been changed. 

The window handle can also be retrieved with {\bf embedded\-Win\-Id()}{\rm (p.\,\pageref{classQXEmbed_a5})}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em w}]the handle of the window that changed \end{description}
\end{Desc}


Definition at line 1195 of file qxembed.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
qxembed.h\item 
qxembed.cpp\end{CompactItemize}
