1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.widgets.fileiconprovider;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.fileinfo;
19 import qt.core.flags;
20 import qt.core.scopedpointer;
21 import qt.core.string;
22 import qt.gui.icon;
23 import qt.helpers;
24 
25 extern(C++, class) struct QFileIconProviderPrivate;
26 
27 class /+ Q_WIDGETS_EXPORT +/ QFileIconProvider
28 {
29 public:
30     this();
31     /+ virtual +/~this();
32     enum IconType { Computer, Desktop, Trashcan, Network, Drive, Folder, File }
33 
34     enum Option {
35         DontUseCustomDirectoryIcons = 0x00000001
36     }
37     /+ Q_DECLARE_FLAGS(Options, Option) +/
38 alias Options = QFlags!(Option);
39     /+ virtual +/ QIcon icon(IconType type) const;
40     /+ virtual +/ QIcon icon(ref const(QFileInfo) info) const;
41     /+ virtual +/ QString type(ref const(QFileInfo) info) const;
42 
43     final void setOptions(Options options);
44     final Options options() const;
45 
46 private:
47     /+ Q_DECLARE_PRIVATE(QFileIconProvider) +/
48     QScopedPointer!(QFileIconProviderPrivate) d_ptr;
49     /+ Q_DISABLE_COPY(QFileIconProvider) +/
50 }
51 /+pragma(inline, true) QFlags!(QFileIconProvider.Options.enum_type) operator |(QFileIconProvider.Options.enum_type f1, QFileIconProvider.Options.enum_type f2)/+noexcept+/{return QFlags!(QFileIconProvider.Options.enum_type)(f1)|f2;}+/
52 /+pragma(inline, true) QFlags!(QFileIconProvider.Options.enum_type) operator |(QFileIconProvider.Options.enum_type f1, QFlags!(QFileIconProvider.Options.enum_type) f2)/+noexcept+/{return f2|f1;}+/
53 /+pragma(inline, true) QIncompatibleFlag operator |(QFileIconProvider.Options.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
54 
55 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QFileIconProvider::Options) +/