kdeui Library API Documentation

klanguagebutton.h

00001 /*
00002  * klangbutton.h - Button with language selection drop down menu.
00003  *                 Derived from the KLangCombo class by Hans Petter Bieker.
00004  *
00005  * Copyright (c) 1999-2003 Hans Petter Bieker <bieker@kde.org>
00006  *           (c) 2001      Martijn Klingens <klingens@kde.org>
00007  *
00008  * Requires the Qt widget libraries, available at no cost at
00009  * http://www.troll.no/
00010  *
00011  *  This program is free software; you can redistribute it and/or modify
00012  *  it under the terms of the GNU General Public License as published by
00013  *  the Free Software Foundation; either version 2 of the License, or
00014  *  (at your option) any later version.
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU General Public License for more details.
00020  *
00021  *  You should have received a copy of the GNU General Public License
00022  *  along with this program; if not, write to the Free Software
00023  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00024  */
00025 
00026 
00027 #ifndef __KLANGBUTTON_H__
00028 #define __KLANGBUTTON_H__
00029 
00030 #include <qwidget.h>
00031 
00032 #include <kdelibs_export.h>
00033 
00034 class KLanguageButtonPrivate;
00035 
00045 class KDEUI_EXPORT KLanguageButton : public QWidget
00046 {
00047   Q_OBJECT
00048 
00049 public:
00056   KLanguageButton(QWidget * parent = 0, const char * name = 0);
00057   
00065   KLanguageButton(const QString & text, QWidget * parent = 0, const char * name = 0);
00066   
00070   virtual ~KLanguageButton();
00071 
00081   void insertItem( const QIconSet& icon, const QString &text,
00082                    const QString & id, const QString &submenu = QString::null,
00083                    int index = -1 );
00092   void insertItem( const QString &text, const QString & id,
00093                    const QString &submenu = QString::null, int index = -1 );
00100   void insertSeparator( const QString &submenu = QString::null,
00101                         int index = -1 );
00111   void insertSubmenu( const QIconSet & icon, const QString &text,
00112                       const QString & id, const QString &submenu = QString::null,
00113                       int index = -1);
00122   void insertSubmenu( const QString &text, const QString & id,
00123                       const QString &submenu = QString::null, int index = -1);
00124 
00125 
00126   void insertLanguage( const QString& path, const QString& name,
00127                        const QString& sub = QString::null,
00128                        const QString &submenu = QString::null, int index = -1);
00129 
00130 
00131   int count() const;
00135   void clear();
00139   void setText(const QString & text);
00143   QString current() const;
00147   bool contains( const QString & id ) const;
00151   void setCurrentItem( const QString & id );
00152 
00153     QString id( int i ) const;
00154 
00155 signals:
00160   void activated( const QString & id );
00161   void highlighted( const QString & id );
00162 
00163 private slots:
00164   void slotActivated( int );
00165   void slotHighlighted( int );
00166 
00167 private:
00168   int currentItem() const;
00169   void setCurrentItem( int );
00170   void init(const char * name);
00171 
00172   // work space for the new class
00173   QStringList *m_ids;
00174   QPopupMenu *m_popup, *m_oldPopup;
00175   int m_current;
00176 
00177   KLanguageButtonPrivate * d;
00178 };
00179 
00180 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:12:01 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003