JQInternalFrameBridge.h

00001 /*
00002  * @(#)JQInternalFrameBridge.h  0.2.0 / 2007-11-19
00003  *
00004  * Copyright (c) 2007, ETF and contributors. All rights reserved.
00005  *
00006  * This software is licensed under the LGPL, version 2.1, license.
00007  * A copy of the license is included in the file LICENSE-LGPL.txt.
00008  */
00009 #ifndef JQINTERNALFRAMEBRIDGE_H
00010 #define JQINTERNALFRAMEBRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 #include "JQWindowBridge.h"
00015 
00016 /*^**************************************************************************^*/
00017 /*- JQInternalFrameBridge Class.                                             -*/
00018 /*^**************************************************************************^*/
00019 
00026 class JAVAQX_EXPORT JQInternalFrameBridge : public JQWindowBridge
00027 {
00028   Q_OBJECT
00029 protected:
00030   JQInternalFrameBridge(JNIEnv *env, jobject obj);
00031 public slots: // native calls
00032   void insertChild(JNIEnv *env, jlong childBridge, jint index);
00033 public: // native calls
00034   static void initialize(JNIEnv *env, jclass cls);
00035   static jlong newInstance(JNIEnv *env, jobject obj);
00036 public:
00037   virtual void setFocusable(JNIEnv *env, jboolean focusable);
00038   virtual void requestFocus(JNIEnv *env);
00039   virtual jobject getBackground(JNIEnv *env, jclass colorClass);
00040   virtual void setBackground(JNIEnv *env, jint argb);
00041   virtual void setNullBackground(JNIEnv *env);
00042   virtual jobject getForeground(JNIEnv *env, jclass colorClass);
00043   virtual void setForeground(JNIEnv *env, jint argb);
00044   virtual void setNullForeground(JNIEnv *env);
00045   virtual jobject getFont(JNIEnv *env, jclass fontClass);
00046   virtual void setFont(JNIEnv *env, jobject font);
00047   virtual jint getCursor(JNIEnv *env);
00048   virtual void setCursor(JNIEnv *env, jint type);
00049   virtual void setComponentOrientation(JNIEnv *env, jint orientation);
00050   virtual void setToolTipText(JNIEnv *env, jstring text);
00051   virtual void setStatusTipText(JNIEnv *env, jstring text);
00052   virtual void setWhatsThisText(JNIEnv *env, jstring text);
00053 public: // native callbacks
00054   QSize getLayoutPreferredSize();
00055 public:
00056   inline QMdiSubWindow *qMdiSubWindow() const;
00057   inline QWidget *qMdiSubWidget() const;
00058 protected:
00059   virtual bool eventFilter(QObject *obj, QEvent *e);
00060   virtual void filterEnabledEvents();
00061   virtual QWidget *paintingWidget();
00062   friend class JQDesktopPaneBridge; // uses jniObject() function member
00063 private:
00064   QWidget *m_internalWidget;
00065 private:
00066   static jmethodID sm_getLayoutPreferredSizeMID;
00067 };
00068 
00069 /*^**************************************************************************^*/
00070 /*- JQFrameBridge :: Public Inline Member Functions.                         -*/
00071 /*^**************************************************************************^*/
00072 
00078 inline QMdiSubWindow *JQInternalFrameBridge::qMdiSubWindow() const
00079 {
00080   return static_cast<QMdiSubWindow *>(qObject());
00081 }
00082 
00088 inline QWidget *JQInternalFrameBridge::qMdiSubWidget() const
00089 {
00090   return m_internalWidget;
00091 }
00092 
00093 /*^**************************************************************************^*/
00094 /*- Macro Definition.                                                        -*/
00095 /*^**************************************************************************^*/
00096 
00097 #define jqInternalFrameCast(bridge) \
00098     (reinterpret_cast<JQInternalFrameBridge *>(bridge))
00099 #define jqInternalFrameBridge jqInternalFrameCast(bridge)
00100 
00101 #endif //JQINTERNALFRAMEBRIDGE_H
00102 
00103 /*^*****************************************************************************
00104   File History:
00105 
00106  - 2007-11-19 16:04:41 Slobodan
00107    Initial version
00108 
00109 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.