FontMetricsBridge.h

00001 /*
00002  * @(#)FontMetricsBridge.h  0.2.0 / 2007-09-13
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 FONTMETRICSBRIDGE_H
00010 #define FONTMETRICSBRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 /*^**************************************************************************^*/
00015 /*- FontMetricsBridge Class.                                                 -*/
00016 /*^**************************************************************************^*/
00017 
00024 class JAVAQX_EXPORT FontMetricsBridge
00025 {
00026 public: // native calls
00027   static void getMetrics(JNIEnv *env, jobject obj, QFontMetrics *fontMetrics);
00028   static jint stringWidth(JNIEnv *env, jobject obj, QFontMetrics *fontMetrics,
00029                           jstring str);
00030   static void initialize(JNIEnv *env, jclass cls);
00031 private:
00032   static jfieldID sm_ascentFID;
00033   static jfieldID sm_descentFID;
00034   static jfieldID sm_heightFID;
00035   static jfieldID sm_leadingFID;
00036   static jmethodID sm_stringWidthMID;
00037 };
00038 
00039 /*^**************************************************************************^*/
00040 /*- Macro Definition.                                                        -*/
00041 /*^**************************************************************************^*/
00042 
00043 #define qFontMetrics (reinterpret_cast<QFontMetrics *>(fontMetricsPointer))
00044 
00045 #endif //FONTMETRICSBRIDGE_H
00046 
00047 /*^*****************************************************************************
00048   File History:
00049 
00050  - 2007-09-13 10:02:26 Slobodan
00051    Initial version
00052 
00053 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.