author | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
commit | b9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff) | |
tree | 2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/kresources/selectdialog.h | |
download | kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2 |
Initial revision
Diffstat (limited to 'microkde/kresources/selectdialog.h') (more/less context) (show whitespace changes)
-rw-r--r-- | microkde/kresources/selectdialog.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/microkde/kresources/selectdialog.h b/microkde/kresources/selectdialog.h new file mode 100644 index 0000000..7026212 --- a/dev/null +++ b/microkde/kresources/selectdialog.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | This file is part of libkresources. | ||
3 | |||
4 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | ||
5 | Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org> | ||
6 | Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Library General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Library General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Library General Public License | ||
19 | along with this library; see the file COPYING.LIB. If not, write to | ||
20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
21 | Boston, MA 02111-1307, USA. | ||
22 | */ | ||
23 | |||
24 | #ifndef KRESOURCES_SELECTDIALOG_H | ||
25 | #define KRESOURCES_SELECTDIALOG_H | ||
26 | |||
27 | #include <qobject.h> | ||
28 | #include <qptrlist.h> | ||
29 | #include <qmap.h> | ||
30 | |||
31 | #include <kdialogbase.h> | ||
32 | |||
33 | //US class KListBox; | ||
34 | class QListBox; | ||
35 | |||
36 | namespace KRES { | ||
37 | |||
38 | class Resource; | ||
39 | |||
40 | /** | ||
41 | * Dialog for selecting a resource. | ||
42 | * | ||
43 | * Example: | ||
44 | * | ||
45 | * <pre> | ||
46 | * KABC::Resource *res = KABC::SelectDialog::getResource(); | ||
47 | * if ( !( res ) ) { | ||
48 | * // no resource selected | ||
49 | * } else { | ||
50 | * // do something with resource | ||
51 | * } | ||
52 | * </pre> | ||
53 | */ | ||
54 | //US class SelectDialog : KDialog | ||
55 | class SelectDialog : KDialogBase | ||
56 | { | ||
57 | // Q_OBJECT | ||
58 | public: | ||
59 | /** | ||
60 | * Constructor. | ||
61 | * @param ab The address book you want to select the resource from | ||
62 | * @param parent The parent widget | ||
63 | * @param name The name of the dialog | ||
64 | */ | ||
65 | SelectDialog( QPtrList<Resource> list, QWidget *parent = 0, | ||
66 | const char *name = 0); | ||
67 | |||
68 | // ~SelectDialog(); | ||
69 | |||
70 | /** | ||
71 | * Return selected resource. | ||
72 | */ | ||
73 | Resource *resource(); | ||
74 | |||
75 | /** | ||
76 | * Open a dialog showing the available resources and return the resource the | ||
77 | * user has selected. Returns 0, if the dialog was canceled. | ||
78 | */ | ||
79 | static Resource *getResource( QPtrList<Resource> list, QWidget *parent = 0 ); | ||
80 | |||
81 | private: | ||
82 | //US KListBox *mResourceId; | ||
83 | QListBox *mResourceId; | ||
84 | |||
85 | QMap<int, Resource*> mResourceMap; | ||
86 | }; | ||
87 | |||
88 | |||
89 | |||
90 | } | ||
91 | |||
92 | #endif | ||