qxembed.h
00001 /**************************************************************************** 00002 Definition of QXEmbed class 00003 00004 Copyright (C) 1999-2000 Troll Tech AS 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 *****************************************************************************/ 00021 00022 #ifndef QXEMBED_H 00023 #define QXEMBED_H 00024 00025 #include <tqwidget.h> 00026 #include <kdelibs_export.h> 00027 00028 #ifdef Q_MOC_RUN 00029 #define Q_WS_X11 00030 #endif // Q_MOC_RUN 00031 00032 #ifdef Q_WS_X11 00033 00034 class QXEmbedData; 00035 00062 class KDEUI_EXPORT QXEmbed : public TQWidget 00063 { 00064 Q_OBJECT 00065 TQ_OBJECT 00066 00067 public: 00068 00076 QXEmbed( TQWidget *parent=0, const char *name=0, WFlags f = 0 ); 00077 00081 ~QXEmbed(); 00082 00090 static void initialize(); 00091 00092 enum Protocol { XEMBED, XPLAIN }; 00093 00108 void setProtocol( Protocol proto ); 00109 00116 Protocol protocol(); 00117 00130 void embed( WId w ); 00131 00138 WId embeddedWinId() const; 00139 00148 static void embedClientIntoWindow( TQWidget* client, WId window ); 00149 00160 static bool processClientCmdline( TQWidget* client, int& argc, char ** argv ); 00161 00169 void sendDelete( void ); 00170 00180 void setAutoDelete( bool ); 00181 00188 bool autoDelete() const; 00189 00190 /* Reimp */ 00191 TQSize sizeHint() const; 00192 TQSize minimumSizeHint() const; 00193 TQSizePolicy sizePolicy() const; 00194 bool eventFilter( TQObject *, TQEvent * ); 00195 bool customWhatsThis() const; 00196 void enterWhatsThisMode(); // temporary, fix in Qt (Matthias, Mon Jul 17 15:20:55 CEST 2000 ) 00197 virtual void reparent( TQWidget * parent, WFlags f, const TQPoint & p, bool showIt = false ); 00198 00202 void updateEmbeddedFocus( bool hasfocus ); 00203 00204 signals: 00210 // KDE4 rename to embeddedWindowLost() 00211 void embeddedWindowDestroyed(); 00212 00213 protected: 00214 bool event( TQEvent * ); 00215 void keyPressEvent( TQKeyEvent * ); 00216 void keyReleaseEvent( TQKeyEvent * ); 00217 void focusInEvent( TQFocusEvent * ); 00218 void focusOutEvent( TQFocusEvent * ); 00219 void resizeEvent(TQResizeEvent *); 00220 void showEvent( TQShowEvent * ); 00221 bool x11Event( XEvent* ); 00222 00230 virtual void windowChanged( WId w ); 00231 00232 bool focusNextPrevChild( bool next ); 00233 00234 private: 00235 WId window; 00236 QXEmbedData* d; 00237 void checkGrab(); 00238 void sendSyntheticConfigureNotifyEvent(); 00239 void handleEmbed(); 00240 }; 00241 00242 00243 #endif 00244 #endif