kio
kfile.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KFILE_H
00019 #define KFILE_H
00020
00021 #include <qdir.h>
00022
00023 #include "kdelibs_export.h"
00024
00031 class KIO_EXPORT KFile
00032 {
00033 public:
00042 enum Mode {
00043 File = 1,
00044 Directory = 2,
00045 Files = 4,
00046 ExistingOnly = 8,
00047 LocalOnly = 16,
00048 ModeMax = 65536
00049 };
00050
00051 enum FileView {
00052 Default = 0,
00053 Simple = 1,
00054 Detail = 2,
00055 SeparateDirs = 4,
00056 PreviewContents = 8,
00057 PreviewInfo = 16,
00058 FileViewMax = 65536
00059 };
00060
00061 enum SelectionMode {
00062 Single = 1,
00063 Multi = 2,
00064 Extended = 4,
00065 NoSelection = 8
00066 };
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 static bool isSortByName( const QDir::SortSpec& sort ) {
00078 return (sort & QDir::Time) != QDir::Time &&
00079 (sort & QDir::Size) != QDir::Size;
00080 }
00081
00082 static bool isSortBySize( const QDir::SortSpec& sort ) {
00083 return (sort & QDir::Size) == QDir::Size;
00084 }
00085
00086 static bool isSortByDate( const QDir::SortSpec& sort ) {
00087 return (sort & QDir::Time) == QDir::Time;
00088 }
00089
00090 static bool isSortDirsFirst( const QDir::SortSpec& sort ) {
00091 return (sort & QDir::DirsFirst) == QDir::DirsFirst;
00092 }
00093
00094 static bool isSortCaseInsensitive( const QDir::SortSpec& sort ) {
00095 return (sort & QDir::IgnoreCase) == QDir::IgnoreCase;
00096 }
00097
00098
00099
00100 static bool isDefaultView( const FileView& view ) {
00101 return (view & Default) == Default;
00102 }
00103
00104 static bool isSimpleView( const FileView& view ) {
00105 return (view & Simple) == Simple;
00106 }
00107
00108 static bool isDetailView( const FileView& view ) {
00109 return (view & Detail) == Detail;
00110 }
00111
00112 static bool isSeparateDirs( const FileView& view ) {
00113 return (view & SeparateDirs) == SeparateDirs;
00114 }
00115
00116 static bool isPreviewContents( const FileView& view ) {
00117 return (view & PreviewContents) == PreviewContents;
00118 }
00119
00123 static bool isPreviewInfo( const FileView& view ) {
00124 return (view & PreviewInfo) == PreviewInfo;
00125 }
00126
00127 };
00128
00129 #endif // KFILE_H