Warning: That file was not part of the compilation database. It may have many parsing errors.
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., 51 Franklin Street, Fifth Floor, |
21 | Boston, MA 02110-1301, USA. |
22 | */ |
23 | |
24 | #ifndef KRESOURCES_SELECTDIALOG_H |
25 | #define KRESOURCES_SELECTDIALOG_H |
26 | |
27 | #include "kresources_export.h" |
28 | |
29 | #include <kdialog.h> |
30 | |
31 | #include <QtCore/QObject> |
32 | #include <QtCore/QMap> |
33 | #include <QtCore/QList> |
34 | |
35 | namespace KRES { |
36 | |
37 | class Resource; |
38 | |
39 | /** |
40 | * Dialog for selecting a resource. |
41 | * |
42 | * Example: |
43 | * |
44 | * \code |
45 | * |
46 | * QList<Resource *> list = ... // can be retrived from KRES::Manager (e.g. KABC::AddressBook) |
47 | * |
48 | * Resource *res = SelectDialog::getResource( list, parentWdg ); |
49 | * if ( !res ) { |
50 | * // no resource selected |
51 | * } else { |
52 | * // do something with resource |
53 | * } |
54 | * \endcode |
55 | */ |
56 | class KRESOURCES_EXPORT SelectDialog : KDialog |
57 | { |
58 | public: |
59 | /** |
60 | * Constructor. |
61 | * @param list The list of available resources |
62 | * @param parent The parent widget |
63 | */ |
64 | explicit SelectDialog( QList<Resource *> list, QWidget *parent = 0 ); |
65 | |
66 | /** |
67 | * Destructor. |
68 | */ |
69 | ~SelectDialog(); |
70 | |
71 | /** |
72 | * Returns selected resource. |
73 | */ |
74 | Resource *resource(); |
75 | |
76 | /** |
77 | * Opens a dialog showing the available resources and returns the resource |
78 | * the user has selected. Returns 0, if the dialog was canceled. |
79 | */ |
80 | static Resource *getResource( QList<Resource *> list, QWidget *parent = 0 ); |
81 | |
82 | private: |
83 | class SelectDialogPrivate; |
84 | SelectDialogPrivate *const d; |
85 | }; |
86 | |
87 | } |
88 | |
89 | #endif |
90 |
Warning: That file was not part of the compilation database. It may have many parsing errors.