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 class KLanguageButtonPrivate;
00033 
00043 class KLanguageButton : public QWidget
00044 {
00045   Q_OBJECT
00046 
00047 public:
00054   KLanguageButton(QWidget * parent = 0, const char * name = 0);
00055   
00063   KLanguageButton(const QString & text, QWidget * parent = 0, const char * name = 0);
00064   
00068   virtual ~KLanguageButton();
00069 
00079   void insertItem( const QIconSet& icon, const QString &text,
00080                    const QString & id, const QString &submenu = QString::null,
00081                    int index = -1 );
00090   void insertItem( const QString &text, const QString & id,
00091                    const QString &submenu = QString::null, int index = -1 );
00098   void insertSeparator( const QString &submenu = QString::null,
00099                         int index = -1 );
00109   void insertSubmenu( const QIconSet & icon, const QString &text,
00110                       const QString & id, const QString &submenu = QString::null,
00111                       int index = -1);
00120   void insertSubmenu( const QString &text, const QString & id,
00121                       const QString &submenu = QString::null, int index = -1);
00122 
00123 
00124   void insertLanguage( const QString& path, const QString& name,
00125                        const QString& sub = QString::null,
00126                        const QString &submenu = QString::null, int index = -1);
00127 
00128 
00129   int count() const;
00133   void clear();
00137   void setText(const QString & text);
00141   QString current() const;
00145   bool contains( const QString & id ) const;
00149   void setCurrentItem( const QString & id );
00150 
00151     QString id( int i ) const;
00152 
00153 signals:
00158   void activated( const QString & id );
00159   void highlighted( const QString & id );
00160 
00161 private slots:
00162   void slotActivated( int );
00163   void slotHighlighted( int );
00164 
00165 private:
00166   int currentItem() const;
00167   void setCurrentItem( int );
00168   void init(const char * name);
00169 
00170   // work space for the new class
00171   QStringList *m_ids;
00172   QPopupMenu *m_popup, *m_oldPopup;
00173   int m_current;
00174 
00175   KLanguageButtonPrivate * d;
00176 };
00177 
00178 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Jan 15 13:32:53 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003