SCIMBridge 0.4.x

client-qt/scim-bridge-client-imcontext-qt.h

Go to the documentation of this file.
00001 /*
00002  * SCIM Bridge
00003  *
00004  * Copyright (c) 2006 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
00005  *
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation and 
00010  * appearing in the file LICENSE.LGPL included in the package of this file.
00011  * You can also redistribute it and/or modify it under the terms of 
00012  * the GNU General Public License as published by the Free Software Foundation and 
00013  * appearing in the file LICENSE.GPL included in the package of this file.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018  */
00019 
00026 #ifndef SCIMBRIDGECLIENTIMCONTEXTQT_H_
00027 #define SCIMBRIDGECLIENTIMCONTEXTQT_H_
00028 
00029 #ifdef QT4
00030 #include <QApplication>
00031 #include <QEvent>
00032 #include <QFont>
00033 #include <QInputContext>
00034 #include <QInputMethodEvent>
00035 #include <QObject>
00036 #include <QPoint>
00037 #include <QWidget>
00038 #else
00039 #include <qapplication.h>
00040 #include <qevent.h>
00041 #include <qfont.h>
00042 #include <qinputcontext.h>
00043 #include <qobject.h>
00044 #include <qptrlist.h>
00045 #include <qpoint.h>
00046 #include <qwidget.h>
00047 #endif
00048 
00049 #include "scim-bridge.h"
00050 #include "scim-bridge-attribute.h"
00051 
00052 #include "scim-bridge-client-imcontext.h"
00053 
00054 #include "scim-bridge-client-common-qt.h"
00055 
00059 struct _ScimBridgeClientIMContext: public QInputContext
00060 {
00061 
00062     public:
00063 
00067         static void static_initialize ();
00068         
00072         static void static_finalize ();
00073 
00077         static void connection_opened ();
00078 
00082         static void connection_closed ();
00083 
00089         static _ScimBridgeClientIMContext *alloc ();
00090 
00094         virtual ~_ScimBridgeClientIMContext () {}
00095 
00103         virtual bool x11FilterEvent (QWidget *widget, XEvent *event) = 0;
00104 
00111         virtual bool filterEvent (const QEvent *event) = 0;
00112 
00113 #ifdef QT4
00114 
00117         virtual void update () = 0;
00118 
00124         virtual QString identifierName () = 0;
00125 
00131         virtual QString language () = 0;
00132 
00139         virtual void mouseHandler (int offset, QMouseEvent *event) = 0;
00140 
00146         virtual void widgetDestroyed (QWidget *widget) = 0;
00147 
00148 #else
00149 
00153         virtual void setFocus () = 0;
00154 
00158         virtual void unsetFocus () = 0;
00159         
00169         virtual void setMicroFocus (int x, int y, int w, int h, QFont *font = 0) = 0;
00170 
00179         virtual void mouseHandler (int offset, QEvent::Type type, ButtonState button, ButtonState state) = 0;
00180 
00181 #endif
00182 
00186         virtual void reset () = 0;
00187 
00188     protected:
00189 
00193         _ScimBridgeClientIMContext () {}
00194 
00195 };
00196 
00197 #endif                                            /*SCIMBRIDGECLIENTIMCONTEXTQT_H_*/