summaryrefslogtreecommitdiff
path: root/library/categoryselect.h
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /library/categoryselect.h
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'library/categoryselect.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/categoryselect.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/library/categoryselect.h b/library/categoryselect.h
new file mode 100644
index 0000000..5c6b565
--- a/dev/null
+++ b/library/categoryselect.h
@@ -0,0 +1,105 @@
1/**********************************************************************
2** Copyright (C) 2001 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#ifndef __CATEGORYCOMBO_H__
22#define __CATEGORYCOMBO_H__
23
24#include <qcombobox.h>
25#include <qhbox.h>
26#include <qstring.h>
27#include <qarray.h>
28
29extern QString categoryFileName();
30
31class QToolButton;
32
33class CategoryComboPrivate;
34class CategoryCombo : public QComboBox
35{
36 Q_OBJECT
37
38public:
39 CategoryCombo( QWidget *parent, const char* name = 0 );
40 ~CategoryCombo();
41
42 int currentCategory() const;
43 void setCurrentCategory( int id );
44 // depreciated.
45 void initCombo( const QArray<int> &recCats, const QString &appName );
46 void initCombo( const QArray<int> &recCats, const QString &appName,
47 const QString &visibleName /* = appName */ );
48
49signals:
50 void sigCatChanged( int newUid );
51
52private slots:
53 void slotValueChanged( int );
54
55private:
56 void setCurrentText( const QString &str );
57 CategoryComboPrivate *d;
58};
59
60#endif
61
62class CategorySelectPrivate;
63class CategorySelect : public QHBox
64{
65 Q_OBJECT
66public:
67 // we need two constructors, the first gets around designer limitations
68 CategorySelect( QWidget *parent = 0, const char *name = 0 );
69
70 CategorySelect( const QArray<int> &vlCats, const QString &appName,
71 QWidget *parent = 0, const char *name = 0 );
72 CategorySelect( const QArray<int> &vlCats, const QString &appName,
73 const QString &visibleName, QWidget *parent = 0,
74 const char *name = 0 );
75 ~CategorySelect();
76
77 const QArray<int> &currentCategories() const;
78 int currentCategory() const;
79 void setCurrentCategory( int newCatUid );
80 // pretty much if you don't set it the constructor, you need to
81 // call it here ASAP!
82 // however this call is depreciated...
83 void setCategories( const QArray<int> &vlCats, const QString &appName );
84 // use this one instead (for translating )
85 void setCategories( const QArray<int> &vlCats, const QString &appName,
86 const QString &visibleName );
87
88 // these were added for find dialog.
89 void setRemoveCategoryEdit( bool remove );
90 void setAllCategories( bool add );
91
92signals:
93 void signalSelected( int );
94
95private slots:
96 void slotDialog();
97 void slotNewCat( int id );
98
99private:
100 void init();
101 QString mStrAppName;
102 CategoryCombo *cmbCat;
103 QToolButton *cmdCat;
104 CategorySelectPrivate *d;
105};