JQTextFieldBridge.h

00001 /*
00002  * @(#)JQTextFieldBridge.h  0.2.0 / 2007-11-21
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 JQTEXTFIELDBRIDGE_H
00010 #define JQTEXTFIELDBRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 #include "JQComponentBridge.h"
00015 
00016 /*^**************************************************************************^*/
00017 /*- JQTextFieldBridge Class.                                                 -*/
00018 /*^**************************************************************************^*/
00019 
00026 class JAVAQX_EXPORT JQTextFieldBridge : public JQComponentBridge
00027 {
00028   Q_OBJECT
00029 protected:
00030   JQTextFieldBridge(JNIEnv *env, jobject obj);
00031 public slots: // native calls
00032   jstring getText(JNIEnv *env);
00033   void setText(JNIEnv *env, jstring text);
00034   void setHorizontalAlignment(JNIEnv *env, jint alignment);
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 returnPressed(jint modifiers);
00040 public:
00041   inline QLineEdit *qLineEdit() const;
00042 protected slots:
00043   void returnPressedSlot();
00044 private:
00045   static jmethodID sm_returnPressedMID;
00046 };
00047 
00048 /*^**************************************************************************^*/
00049 /*- JQTextFieldBridge :: Inline Member Function.                             -*/
00050 /*^**************************************************************************^*/
00051 
00057 inline QLineEdit *JQTextFieldBridge::qLineEdit() const
00058 {
00059   return static_cast<QLineEdit *>(qObject());
00060 }
00061 
00062 /*^**************************************************************************^*/
00063 /*- Macro Definition.                                                        -*/
00064 /*^**************************************************************************^*/
00065 
00066 #define jqTextFieldBridge (reinterpret_cast<JQTextFieldBridge *>(bridge))
00067 
00068 #endif //JQTEXTFIELDBRIDGE_H
00069 
00070 /*^*****************************************************************************
00071   File History:
00072 
00073  - 2007-11-21 19:22:48 Slobodan
00074    Initial version
00075 
00076 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.