fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kio / kfile / kfile.h
blob0b31672af883a8f2bd5b85b17b4cc45c9a637173
1 /* This file is part of the KDE libraries
2 Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
18 #ifndef KFILE_H
19 #define KFILE_H
21 #include <QtCore/QDir>
23 #include <kio/kio_export.h>
25 /**
26 * KFile is a class which provides a namespace for some enumerated
27 * values associated with the kfile library. You will never need to
28 * construct a KFile object itself.
31 class KIO_EXPORT KFile
33 Q_GADGET
34 Q_FLAGS(KFile::Modes)
35 public:
36 /**
37 * Modes of operation for the dialog.
38 * @li @p File - Get a single file name from the user.
39 * @li @p Directory - Get a directory name from the user.
40 * @li @p Files - Get multiple file names from the user.
41 * @li @p ExistingOnly - Never return a filename which does not exist yet
42 * @li @p LocalOnly - Don't return remote filenames
44 enum Mode {
45 File = 1,
46 Directory = 2,
47 Files = 4,
48 ExistingOnly = 8,
49 LocalOnly = 16,
50 ModeMax = 65536
52 Q_DECLARE_FLAGS(Modes, Mode)
54 enum FileView {
55 Default = 0,
56 Simple = 1,
57 Detail = 2,
58 SeparateDirs = 4,
59 PreviewContents = 8,
60 PreviewInfo = 16,
61 Tree = 32,
62 DetailTree = 64,
63 FileViewMax = 65536
66 enum SelectionMode {
67 Single = 1,
68 Multi = 2,
69 Extended = 4,
70 NoSelection = 8
75 // some bittests
78 // sorting specific
80 static bool isSortByName( const QDir::SortFlags& sort );
82 static bool isSortBySize( const QDir::SortFlags& sort );
84 static bool isSortByDate( const QDir::SortFlags& sort );
86 static bool isSortByType( const QDir::SortFlags& sort );
88 static bool isSortDirsFirst( const QDir::SortFlags& sort );
90 static bool isSortCaseInsensitive( const QDir::SortFlags& sort );
93 // view specific
94 static bool isDefaultView( const FileView& view );
96 static bool isSimpleView( const FileView& view );
98 static bool isDetailView( const FileView& view );
100 static bool isSeparateDirs( const FileView& view );
102 static bool isPreviewContents( const FileView& view );
104 static bool isPreviewInfo( const FileView& view );
106 static bool isTreeView( const FileView& view );
108 static bool isDetailTreeView( const FileView& view );
110 private:
111 KFile(); // forbidden
114 Q_DECLARE_OPERATORS_FOR_FLAGS(KFile::Modes)
116 #endif // KFILE_H