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

startmenu.h

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 
00021 #ifndef __START_MENU_H__
00022 #define __START_MENU_H__
00023 
00024 #include <qtopia/applnk.h>
00025 #include <qintdict.h>
00026 #include <qstring.h>
00027 #include <qlist.h>
00028 #include <qmap.h>
00029 #include <qdir.h>
00030 #include <qlabel.h>
00031 #include <qpopupmenu.h>
00032 
00033 #include <qtopia/menuappletinterface.h>
00034 
00035 class StartPopupMenu : public QPopupMenu
00036 {
00037 
00038 public:
00039     StartPopupMenu( QWidget *parent ) : QPopupMenu( parent ) {}
00040     
00041 protected:
00042     void keyPressEvent( QKeyEvent *e );
00043 
00044 };
00045 
00046 class QLibrary;
00047 
00048 
00049 struct MenuApplet {
00050     QLibrary *library;
00051     MenuAppletInterface *iface;
00052     int id;
00053     QPopupMenu *popup;
00054 };
00055 
00056 class StartMenu : public QLabel {
00057     
00058     Q_OBJECT
00059         
00060 public:
00061     StartMenu( QWidget * );
00062     ~StartMenu();
00063 
00064     void refreshMenu();
00065 
00066 public:
00067     StartPopupMenu *launchMenu;
00068 
00069 signals:
00070     void tabSelected(const QString&);
00071 
00072 public slots:
00073     void launch( );
00074     void createMenu( );
00075 
00076 protected slots:
00077     void itemSelected( int id );
00078 
00079 protected:
00080     virtual void mousePressEvent( QMouseEvent * );
00081 
00082 private:
00083     void loadApplets();
00084     void clearApplets();
00085     void addApplets( QPopupMenu* menu );
00086     bool loadMenu( QPopupMenu *menu );
00087     void createMenuEntries( QPopupMenu *menu, QDir dir, bool ltabs, bool lot );
00088     void createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool lot );
00089     void createAppEntry( QPopupMenu *menu, QDir dir, QString file );
00090 
00091 private:
00092     bool useWidePopupMenu;
00093     QString popupMenuSidePixmap;
00094 
00095     bool startButtonIsFlat;
00096     QString startButtonPixmap;
00097 
00098     int currentItem;
00099 
00100     QIntDict<AppLnk> appLnks;
00101     QIntDict<QString> tabNames;
00102     QIntDict<MenuApplet> menuApplets;
00103     
00104 };
00105 
00106 #endif // __START_MENU_H__

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