Qtopia Home - Classes - Annotated - Functions - Qt Embedded

inputmethodinterface.h

This is the verbatim text of the inputmethodinterface.h include file. It is provided only for illustration; the copyright remains with Trolltech.


/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/

#ifndef INPUTMETHODINTERFACE_H
#define INPUTMETHODINTERFACE_H

#include <qtopia/qcom.h>

#include <qnamespace.h>
#include <qstring.h>

#ifndef QT_NO_COMPONENT
// {637A8A14-AF98-41DA-969A-2BD16ECDA8C7}
# ifndef IID_InputMethod
#  define IID_InputMethod QUuid( 0x637a8a14, 0xaf98, 0x41da, 0x96, 0x9a, 0x2b, 0xd1, 0x6e, 0xcd, 0xa8, 0xc7)
# endif
#endif

class QWidget;
class QPixmap;
class QObject;
class QWSInputMethod;
class QWSGestureMethod;

struct InputMethodInterface : public QUnknownInterface
{
    virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ) = 0;
    virtual void resetState() = 0;
    virtual QPixmap *icon() = 0;
    virtual QString name() = 0;
    virtual void onKeyPress( QObject *receiver, const char *slot ) = 0;
};

// {70F0991C-8282-4625-A279-BD9D7D959FF6} 
#ifndef IID_ExtInputMethod
#define IID_ExtInputMethod QUuid( 0x70f0991c, 0x8282, 0x4625, 0xa2, 0x79, 0xbd, 0x9d, 0x7d, 0x95, 0x9f, 0xf6)
#endif

struct ExtInputMethodInterface : public QUnknownInterface
{
    //identifying functions.
    virtual QString name() = 0;
    virtual QPixmap *icon() = 0;

    // state managment.
    virtual void resetState() = 0;

    virtual QWidget *keyboardWidget( QWidget *parent, Qt::WFlags f ) = 0;
    // filenames, not menu names.
    virtual QStringList compatible() = 0;

    virtual QWSInputMethod *inputMethod() = 0;
    virtual QWidget *statusWidget( QWidget *parent, Qt::WFlags f )= 0;

    virtual void qcopReceive( const QCString &msg, const QByteArray &data )= 0;
};

// {b18b0cc2-7db9-48ae-9939-f40cc5f95e93}
#ifndef IID_CoopInputMethod
#define IID_CoopInputMethod QUuid( 0xb18b0cc2, 0x7db9, 0x48ae, 0x99, 0x39, 0xf4, 0x0c, 0xc5, 0xf9, 0x5e, 0x93)
#endif

/* TODO requires good documentation */
struct CoopInputMethodInterface : public QUnknownInterface
{
    enum Properties {
	RequireMouse = 0x0001,
	RequireKeypad = 0x0002,
	MouseFilter = 0x0004,
	KeyFilter = 0x0008,
	ProvidesGuess = 0x0010,
	InterpretsGuess = 0x0020
    };

    //identifying functions.
    virtual QString name() = 0;
    virtual QPixmap *icon() = 0;
    
    // a small widget that shows current status.  can be interacted with,
    // but MUST be small.
    // return 0 if should just use icon.
    virtual QWidget *statusWidget( QWidget *parent, Qt::WFlags f )= 0;

    // state managment.
    virtual void resetState() = 0;

    // proprities
    virtual int properties() = 0;
    virtual QStringList compatible() = 0;

    // return 0 if you don't have one.
    virtual QWidget *inputWidget( QWidget *parent, Qt::WFlags f ) = 0;
    virtual QWSInputMethod *inputModifier() = 0;
    virtual QWSGestureMethod *gestureModifier() = 0;

    virtual void qcopReceive( const QCString &msg, const QByteArray &data ) = 0;

    // Guess functions for cooperating input methods.
    // Only used if one provides guesses, and the other modifies them.
    // used to communicate between plugins.
    virtual void appendGuess(const QChar &, const QString &) = 0;
    virtual void revertGuess() = 0;
    virtual void function(const QString &) = 0;

    // signiture is "(const QChar&, const QString&)"
    // best guess, other guesses
    virtual void connectAppendGuess(QObject *receiver, const char *slot) = 0;
    virtual void disconnectAppendGuess(QObject *receiver, const char *slot) = 0;

    // signiture is "()"
    virtual void connectRevertGuess(QObject *receiver, const char *slot) = 0;
    virtual void disconnectRevertGuess(QObject *receiver, const char *slot) = 0;

    // signiture is "(const QString &)"
    virtual void connectFunction(QObject *receiver, const char *slot) = 0;
    virtual void disconnectFunction(QObject *receiver, const char *slot) = 0;

    virtual void setHint(const QString &) = 0;
};

#endif


Copyright © 2001-2004 Trolltech Trademarks
Qtopia version 2.0.1