JQTextAreaBridge.h

00001 /*
00002  * @(#)JQTextAreaBridge.h  0.2.0 / 2007-12-09
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 JQTEXTAREABRIDGE_H
00010 #define JQTEXTAREABRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 #include "JQTextComponentBridge.h"
00015 #include "QTextArea.h"
00016 
00017 /*^**************************************************************************^*/
00018 /*- JQTextAreaBridge Class.                                                  -*/
00019 /*^**************************************************************************^*/
00020 
00027 class JAVAQX_EXPORT JQTextAreaBridge : public JQTextComponentBridge
00028 {
00029   Q_OBJECT
00030 protected:
00031   JQTextAreaBridge(JNIEnv *env, jobject obj);
00032 public slots: // native calls
00033   void setWrapText(JNIEnv *env, jboolean textWrap);
00034   void paintComponentView(JNIEnv *env, jlong graphicsPointer);
00035 public: // native calls
00036   static void initialize(JNIEnv *env, jclass cls);
00037   static jlong newInstance(JNIEnv *env, jobject obj);
00038 public: // native callbacks
00039   void paintView(jlong graphicsPointer, jint x, jint y, jint width,
00040                  jint height);
00041 public:
00042   inline QTextArea *qTextArea() const;
00043 public:
00044   virtual void setDocument(JNIEnv *env, jobject document);
00045   virtual void setEditable(JNIEnv *env, jboolean editable);
00046   virtual void insertText(JNIEnv *env, jstring text);
00047   virtual void cut(JNIEnv *env);
00048   virtual void copy(JNIEnv *env);
00049   virtual void paste(JNIEnv *env);
00050   virtual void clear(JNIEnv *env);
00051   virtual void selectAll(JNIEnv *env);
00052   virtual jobject getBackground(JNIEnv *env, jclass colorClass);
00053   virtual void setBackground(JNIEnv *env, jint argb);
00054   virtual void setNullBackground(JNIEnv *env);
00055   virtual jint getCursor(JNIEnv *env);
00056   virtual void setCursor(JNIEnv *env, jint type);
00057 protected:
00058   virtual void filterEnabledEvents();
00059 private:
00060   static jmethodID sm_paintViewMID;
00061 };
00062 
00063 /*^**************************************************************************^*/
00064 /*- JQTextAreaBridge :: Inline Member Function.                              -*/
00065 /*^**************************************************************************^*/
00066 
00072 inline QTextArea *JQTextAreaBridge::qTextArea() const
00073 {
00074   return static_cast<QTextArea *>(qObject());
00075 }
00076 
00077 /*^**************************************************************************^*/
00078 /*- Macro Definition.                                                        -*/
00079 /*^**************************************************************************^*/
00080 
00081 #define jqTextAreaBridge (reinterpret_cast<JQTextAreaBridge *>(bridge))
00082 
00083 #endif //JQTEXTAREABRIDGE_H
00084 
00085 /*^*****************************************************************************
00086   File History:
00087 
00088  - 2007-12-09 08:59:51 Slobodan
00089    Initial version
00090 
00091 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.