Qtopia library API Documentation

categoryselect.h

00001 /**********************************************************************
00002 ** Copyright (C) 2001 Trolltech AS.  All rights reserved.
00003 ** Copyright (C) 2003 zecke Introduce Sharp to the glory of default arguments
00004 **
00005 ** This file is part of Qtopia Environment.
00006 **
00007 ** This file may be distributed and/or modified under the terms of the
00008 ** GNU General Public License version 2 as published by the Free Software
00009 ** Foundation and appearing in the file LICENSE.GPL included in the
00010 ** packaging of this file.
00011 **
00012 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00013 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00014 **
00015 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00016 **
00017 ** Contact info@trolltech.com if any conditions of this licensing are
00018 ** not clear to you.
00019 **
00020 **********************************************************************/
00021 
00022 #ifndef __CATEGORYCOMBO_H__
00023 #define __CATEGORYCOMBO_H__
00024 
00025 #include <qcombobox.h>
00026 #include <qhbox.h>
00027 #include <qstring.h>
00028 #include <qarray.h>
00029 
00030 extern QString categoryFileName();
00031 
00032 class QToolButton;
00033 
00034 class CategoryComboPrivate;
00035 class CategoryCombo : public QComboBox
00036 {
00037     Q_OBJECT
00038 
00039 public:
00040     CategoryCombo( QWidget *parent, const char* name = 0, int width = 0);
00041 
00042     ~CategoryCombo();
00043 
00044     int currentCategory() const;
00045     void setCurrentCategory( int id );
00046     // depreciated.
00047     void initCombo( const QArray<int> &recCats, const QString &appName );
00048     void initCombo( const QArray<int> &recCats, const QString &appName,
00049             const QString &visibleName /* = appName */ );
00050 
00051     QArray<int> initComboWithRefind( const QArray<int> &recCats, const QString &appName );
00052 
00053 signals:
00054     void sigCatChanged( int newUid );
00055 
00056 private slots:
00057     void slotValueChanged( int );
00058 
00059 private:
00060     void setCurrentText( const QString &str );
00061     CategoryComboPrivate *d;
00062 };
00063 
00064 #endif
00065 
00066 class CategorySelectPrivate;
00067 class CategorySelect : public QHBox
00068 {
00069     Q_OBJECT
00070 public:
00071     // we need two constructors, the first gets around designer limitations
00072 
00073     /*
00074      * The Sharp libqpe does have two c'tor and no default argument for int width
00075      * to stay BC cause the Kompany have the original headers and don't compile
00076      * against the normal SDK we need to provide the two symbols as well
00077      * -zecke
00078      */
00079     CategorySelect( QWidget* parent  =  0, const char* name = 0 );
00080     CategorySelect( QWidget *parent /*= 0 */, const char *name/* = 0*/ , int width /* = 0 if we break bc -zecke */ );
00081 
00082     CategorySelect( const QArray<int> &vlCats, const QString &appName,
00083             QWidget *parent = 0, const char *name = 0,
00084             int width = 0);
00085     CategorySelect( const QArray<int> &vlCats, const QString &appName,
00086             const QString &visibleName, QWidget *parent = 0,
00087             const char *name = 0 , int width = 0);
00088 
00089     ~CategorySelect();
00090 
00091     const QArray<int> &currentCategories() const;
00092     int currentCategory() const;
00093     void setCurrentCategory( int newCatUid );
00094     // pretty much if you don't set it the constructor, you need to
00095     // call it here ASAP!
00096     // however this call is depreciated...
00097 
00098     QString setCategories( const QArray<int> &vlCats, const QString &appName );
00099     QString setCategories( const QArray<int> &vlCats, const QString &appName,
00100             const QString &visibleName );
00101     // these were added for find dialog.
00102     void setRemoveCategoryEdit( bool remove );
00103     void setAllCategories( bool add );
00104 
00105     void setFixedWidth(int width);
00106 signals:
00107     void signalSelected( int );
00108 
00109 private slots:
00110     void slotDialog();
00111 
00112 public slots:
00113     void slotNewCat( int id );
00114 
00115 private:
00116     void init(int width=0);
00117     QString mStrAppName;
00118     CategoryCombo *cmbCat;
00119     QToolButton *cmdCat;
00120     CategorySelectPrivate *d;
00121 };
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:03 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001