PrinterBridge.h

00001 /*
00002  * @(#)PrinterBridge.h  0.2.0 / 2007-11-15
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 PRINTERBRIDGE_H
00010 #define PRINTERBRIDGE_H
00011 
00012 #include "JavaQxQSwing.h"
00013 
00014 /*^**************************************************************************^*/
00015 /*- PrinterBridge Class.                                                     -*/
00016 /*^**************************************************************************^*/
00017 
00024 class JAVAQX_EXPORT PrinterBridge : public QObject
00025 {
00026   Q_OBJECT
00027 protected:
00028   PrinterBridge(JNIEnv *env, jobject obj);
00029   virtual ~PrinterBridge();
00030 public slots: // native calls
00031   void destroy(JNIEnv *env);
00032   void pageDialog(JNIEnv *env);
00033   jboolean printerDialog(JNIEnv *env);
00034 public: // native calls
00035   static void initialize(JNIEnv *env, jclass cls);
00036   static jlong newInstance(JNIEnv *env, jobject obj);
00037 public:
00038   inline QPrinter *qPrinter() const;
00039 public:
00040   static QPrinter *toQPrinter(JNIEnv *env, jobject printer);
00041 private:
00042   jweak m_wobjref;
00043   QPrinter *m_printer;
00044 private:
00045   static jfieldID sm_bridgeFID;
00046   static jmethodID sm_createMID;
00047 };
00048 
00049 /*^**************************************************************************^*/
00050 /*- TextDocumentBridge :: Inline Member Function.                            -*/
00051 /*^**************************************************************************^*/
00052 
00058 inline QPrinter *PrinterBridge::qPrinter() const
00059 {
00060   return m_printer;
00061 }
00062 
00063 /*^**************************************************************************^*/
00064 /*- Macro Definitions.                                                       -*/
00065 /*^**************************************************************************^*/
00066 
00067 #define printerCast(bridge) (reinterpret_cast<PrinterBridge *>(bridge))
00068 #define printerBridge printerCast(bridge)
00069 
00070 #endif //PRINTERBRIDGE_H
00071 
00072 /*^*****************************************************************************
00073   File History:
00074 
00075  - 2007-11-15 08:27:12 Slobodan
00076    Initial version
00077 
00078 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.