Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

pickboardimpl.cpp

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #include <qapplication.h>
00021 #include <qobject.h>
00022 #include <qpixmap.h>
00023 #include "pickboard.h"
00024 #include "pickboardimpl.h"
00025 
00026 /* XPM */
00027 static const char * pb_xpm[]={
00028 "28 7 2 1",
00029 "# c #303030",
00030 "  c None",  // No tr
00031 " ########################## ",
00032 " #   #   #   #   #   #    # ",
00033 " #   #   #   #   #   #    # ",
00034 " ########################## ",
00035 " #     #   #   #   #      # ",
00036 " #     #   #   #   #      # ",
00037 " ########################## "};
00038 
00039 
00040 PickboardImpl::PickboardImpl()
00041     : pickboard(0), icn(0)
00042 {
00043 }
00044 
00045 PickboardImpl::~PickboardImpl()
00046 {
00047     delete pickboard;
00048     delete icn;
00049 }
00050 
00051 QWidget *PickboardImpl::inputMethod( QWidget *parent, Qt::WFlags f )
00052 {
00053     if ( !pickboard )
00054         pickboard = new Pickboard( parent, "pickboard", f );
00055     return pickboard;
00056 }
00057 
00058 void PickboardImpl::resetState()
00059 {
00060     if ( pickboard )
00061         pickboard->resetState();
00062 }
00063 
00064 QPixmap *PickboardImpl::icon()
00065 {
00066     if ( !icn )
00067         icn = new QPixmap( (const char **)pb_xpm );
00068     return icn;
00069 }
00070 
00071 QString PickboardImpl::name()
00072 {
00073     return qApp->translate( "InputMethods", "Pickboard" );
00074 }
00075 
00076 void PickboardImpl::onKeyPress( QObject *receiver, const char *slot )
00077 {
00078     if ( pickboard )
00079         QObject::connect( pickboard, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot );
00080 }
00081 
00082 #ifndef QT_NO_COMPONENT
00083 QRESULT PickboardImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
00084 {
00085     *iface = 0;
00086     if ( uuid == IID_QUnknown )
00087         *iface = this;
00088     else if ( uuid == IID_InputMethod )
00089         *iface = this;
00090     else
00091         return QS_FALSE;
00092 
00093     if ( *iface )
00094         (*iface)->addRef();
00095     return QS_OK;
00096 }
00097 
00098 Q_EXPORT_INTERFACE()
00099 {
00100     Q_CREATE_INSTANCE( PickboardImpl )
00101 }
00102 #endif
00103 

Generated on Sat Nov 5 16:16:04 2005 for OPIE by  doxygen 1.4.2