kio Library API Documentation

kfile.h

00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     version 2, License as published by the Free Software Foundation.
00007 
00008     This library is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011     Library General Public License for more details.
00012 
00013     You should have received a copy of the GNU Library General Public License
00014     along with this library; see the file COPYING.LIB.  If not, write to
00015     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00016     Boston, MA 02111-1307, USA.
00017 */
00018 #ifndef KFILE_H
00019 #define KFILE_H
00020 
00021 #include <qdir.h>
00022 
00029 class KFile
00030 {
00031 public:
00040     enum Mode {
00041     File         = 1,
00042     Directory    = 2,
00043     Files        = 4,
00044     ExistingOnly = 8,
00045     LocalOnly    = 16,
00046         ModeMax      = 65536
00047     };
00048 
00049     enum FileView {
00050     Default         = 0,
00051     Simple          = 1,
00052     Detail          = 2,
00053     SeparateDirs    = 4,
00054     PreviewContents = 8,
00055     PreviewInfo     = 16,
00056         FileViewMax     = 65536
00057     };
00058 
00059     enum SelectionMode {
00060     Single      = 1,
00061     Multi       = 2,
00062     Extended    = 4,
00063     NoSelection = 8
00064     };
00065 
00066 
00067     //
00068     // some bittests
00069     //
00070 
00071 
00072     // sorting specific
00073 
00074     // grr, who had the idea to set QDir::Name to 0x0?
00075     static bool isSortByName( const QDir::SortSpec& sort ) {
00076     return (sort & QDir::Time) != QDir::Time &&
00077            (sort & QDir::Size) != QDir::Size;
00078     }
00079 
00080     static bool isSortBySize( const QDir::SortSpec& sort ) {
00081     return (sort & QDir::Size) == QDir::Size;
00082     }
00083 
00084     static bool isSortByDate( const QDir::SortSpec& sort ) {
00085     return (sort & QDir::Time) == QDir::Time;
00086     }
00087 
00088     static bool isSortDirsFirst( const QDir::SortSpec& sort ) {
00089     return (sort & QDir::DirsFirst) == QDir::DirsFirst;
00090     }
00091 
00092     static bool isSortCaseInsensitive( const QDir::SortSpec& sort ) {
00093     return (sort & QDir::IgnoreCase) == QDir::IgnoreCase;
00094     }
00095 
00096 
00097     // view specific
00098     static bool isDefaultView( const FileView& view ) {
00099     return (view & Default) == Default;
00100     }
00101 
00102     static bool isSimpleView( const FileView& view ) {
00103     return (view & Simple) == Simple;
00104     }
00105 
00106     static bool isDetailView( const FileView& view ) {
00107     return (view & Detail) == Detail;
00108     }
00109 
00110     static bool isSeparateDirs( const FileView& view ) {
00111     return (view & SeparateDirs) == SeparateDirs;
00112     }
00113 
00114     static bool isPreviewContents( const FileView& view ) {
00115     return (view & PreviewContents) == PreviewContents;
00116     }
00117 
00121     static bool isPreviewInfo( const FileView& view ) {
00122         return (view & PreviewInfo) == PreviewInfo;
00123     }
00124 
00125 };
00126 
00127 #endif // KFILE_H
KDE Logo
This file is part of the documentation for kio Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Jul 22 10:17:15 2005 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003