• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

klanguagebutton.h

Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 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

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal