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 class QIconSet; 00036 class QPopupMenu; 00037 00047 class KDEUI_EXPORT KLanguageButton : public QWidget 00048 { 00049 Q_OBJECT 00050 00051 public: 00058 KLanguageButton(QWidget * parent = 0, const char * name = 0); 00059 00067 KLanguageButton(const QString & text, QWidget * parent = 0, const char * name = 0); 00068 00072 virtual ~KLanguageButton(); 00073 00083 void insertItem( const QIconSet& icon, const QString &text, 00084 const QString & id, const QString &submenu = QString::null, 00085 int index = -1 ); 00094 void insertItem( const QString &text, const QString & id, 00095 const QString &submenu = QString::null, int index = -1 ); 00102 void insertSeparator( const QString &submenu = QString::null, 00103 int index = -1 ); 00113 void insertSubmenu( const QIconSet & icon, const QString &text, 00114 const QString & id, const QString &submenu = QString::null, 00115 int index = -1); 00124 void insertSubmenu( const QString &text, const QString & id, 00125 const QString &submenu = QString::null, int index = -1); 00126 00127 00128 void insertLanguage( const QString& path, const QString& name, 00129 const QString& sub = QString::null, 00130 const QString &submenu = QString::null, int index = -1); 00131 00132 00133 int count() const; 00137 void clear(); 00141 void setText(const QString & text); 00145 QString current() const; 00149 bool contains( const QString & id ) const; 00153 void setCurrentItem( const QString & id ); 00154 00155 QString id( int i ) const; 00156 00157 signals: 00162 void activated( const QString & id ); 00163 void highlighted( const QString & id ); 00164 00165 private slots: 00166 void slotActivated( int ); 00167 void slotHighlighted( int ); 00168 00169 private: 00170 int currentItem() const; 00171 void setCurrentItem( int ); 00172 void init(const char * name); 00173 00174 // work space for the new class 00175 QStringList *m_ids; 00176 QPopupMenu *m_popup, *m_oldPopup; 00177 int m_current; 00178 00179 KLanguageButtonPrivate * d; 00180 }; 00181 00182 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 14 00:10:12 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003