summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/selectdialog.h
Unidiff
Diffstat (limited to 'microkde/kresources/selectdialog.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/selectdialog.h92
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;
34class QListBox;
35
36namespace KRES {
37
38class 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
55class 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