Qtopia library API Documentation

qpemenubar.h

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 
00021 #ifndef QPEMENUBAR_H
00022 #define QPEMENUBAR_H
00023 
00024 #include <qmenubar.h>
00025 #include <qguardedptr.h>
00026 #include <qvaluelist.h>
00027 
00028 class QPEMenuToolFocusManager : public QObject
00029 {
00030     Q_OBJECT
00031 public:
00032     QPEMenuToolFocusManager();
00033 
00034     void addWidget( QWidget *w );
00035     void removeWidget( QWidget *w );
00036     void setActive( bool a );
00037     bool isActive() const;
00038     void moveFocus( bool next );
00039 
00040     static QPEMenuToolFocusManager *manager();
00041     static void initialize();
00042 
00043 protected:
00044     void setFocus( QWidget *w, bool next=TRUE );
00045     bool eventFilter( QObject *object, QEvent *event );
00046 
00047 private slots:
00048     void deactivate();
00049 
00050 private:
00051     typedef QGuardedPtr<QWidget> GuardedWidget;
00052     QValueList<GuardedWidget> list;
00053     GuardedWidget inFocus;
00054     GuardedWidget oldFocus;
00055     static QPEMenuToolFocusManager *me;
00056     
00057 private: // Sharp ROM compatibility
00058     void setMenukeyEnabled ( bool b );
00059 };
00060 
00061 
00062 class QPEMenuBar : public QMenuBar
00063 {
00064     Q_OBJECT
00065 public:
00066     QPEMenuBar( QWidget *parent=0, const char* name=0 );
00067     ~QPEMenuBar();
00068 
00069 protected:
00070     virtual void keyPressEvent( QKeyEvent *e );
00071 
00072     /* Patch from Mickey
00073      * Sharp Qtopia1.5 seems to have these functions
00074      * TO BE RESOLVED  - zecke
00075      */
00076     void activateItem( int index );
00077     void goodbye();
00078     
00079     // This is a special "lineo" add-on for the Sharp ROM
00080     // nobody knows, what it does, though ...
00081     int getOldFocus ( );
00082 };
00083 
00084 #endif
00085 
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:07 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001