global.h
来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· C头文件 代码 · 共 545 行 · 第 1/2 页
H
545 行
* Returns translated error details for @p errorCode using the * additional error information provided by @p errorText , @p reqUrl * (the request URL), and the ioslave @p method . * * @param errorCode the error code * @param errorText the additional error text * @param reqUrl the request URL * @param method the ioslave method * @return the following data: * @li QString errorName - the name of the error * @li QString techName - if not null, the more technical name of the error * @li QString description - a description of the error * @li QStringList causes - a list of possible causes of the error * @li QStringList solutions - a liso of solutions for the error */ KIO_EXPORT QByteArray rawErrorDetail(int errorCode, const QString &errorText, const KURL *reqUrl = 0L, int method = -1 ); /** * Returns an appropriate error message if the given command @p cmd * is an unsupported action (ERR_UNSUPPORTED_ACTION). * @param protocol name of the protocol * @param cmd given command * @see enum Command * @since 3.2 */ KIO_EXPORT QString unsupportedActionErrorString(const QString &protocol, int cmd); /** * Constants used to specify the type of a KUDSAtom. */ enum UDSAtomTypes { /// First let's define the item types UDS_STRING = 1, UDS_LONG = 2, UDS_TIME = 4 | UDS_LONG, // To add new UDS entries below, you can use a step of 8 // (i.e. 8, 16, 24, 32, etc.) Only the last 3 bits are a bitfield, // the rest isn't. /// Size of the file UDS_SIZE = 8 | UDS_LONG, UDS_SIZE_LARGE = 32768 | UDS_LONG, // For internal use only /// User ID of the file owner UDS_USER = 16 | UDS_STRING, /// Name of the icon, that should be used for displaying. /// It overrides all other detection mechanisms /// @since 3.2 UDS_ICON_NAME = 24 | UDS_STRING, /// Group ID of the file owner UDS_GROUP = 32 | UDS_STRING, /// Extra data (used only if you specified Columns/ColumnsTypes) /// This is the only UDS entry that can be repeated. /// @since 3.2 UDS_EXTRA = 48 | UDS_STRING, /// Filename - as displayed in directory listings etc. /// "." has the usual special meaning of "current directory" UDS_NAME = 64 | UDS_STRING, /// A local file path if the ioslave display files sitting /// on the local filesystem (but in another hierarchy, e.g. media:/) UDS_LOCAL_PATH = 72 | UDS_STRING, /// Treat the file as a hidden file or as a normal file, /// regardless of (the absence of) a leading dot in the filename. UDS_HIDDEN = 80 | UDS_LONG, /// Indicates that the entry has extended ACL entries /// @since 3.5 UDS_EXTENDED_ACL = 88 | UDS_LONG, /// The access control list serialized into a single string. /// @since 3.5 UDS_ACL_STRING = 96 | UDS_STRING, /// The default access control list serialized into a single string. /// Only available for directories. /// @since 3.5 UDS_DEFAULT_ACL_STRING = 104 | UDS_STRING, // available: 112, 120 /// Access permissions (part of the mode returned by stat) UDS_ACCESS = 128 | UDS_LONG, /// The last time the file was modified UDS_MODIFICATION_TIME = 256 | UDS_TIME, /// The last time the file was opened UDS_ACCESS_TIME = 512 | UDS_TIME, /// The time the file was created UDS_CREATION_TIME = 1024 | UDS_TIME, /// File type, part of the mode returned by stat /// (for a link, this returns the file type of the pointed item) /// check UDS_LINK_DEST to know if this is a link UDS_FILE_TYPE = 2048 | UDS_LONG, /// Name of the file where the link points to /// Allows to check for a symlink (don't use S_ISLNK !) UDS_LINK_DEST = 4096 | UDS_STRING, /// An alternative URL (If different from the caption) UDS_URL = 8192 | UDS_STRING, /// A mime type; prevents guessing UDS_MIME_TYPE = 16384 | UDS_STRING, /// A mime type to be used for displaying only. /// But when 'running' the file, the mimetype is re-determined UDS_GUESSED_MIME_TYPE = 16392 | UDS_STRING, /// XML properties, e.g. for WebDAV /// @since 3.1 UDS_XML_PROPERTIES = 0x8000 | UDS_STRING }; /** * Specifies how to use the cache. * @see parseCacheControl() * @see getCacheControlString() */ enum CacheControl { CC_CacheOnly, ///< Fail request if not in cache CC_Cache, ///< Use cached entry if available CC_Verify, ///< Validate cached entry with remote site if expired CC_Refresh, ///< Always validate cached entry with remote site ///< @since 3.1 CC_Reload ///< Always fetch from remote site. }; /** * Parses the string representation of the cache control option. * * @param cacheControl the string representation * @return the cache control value * @see getCacheControlString() */ KIO_EXPORT KIO::CacheControl parseCacheControl(const QString &cacheControl); /** * Returns a string representation of the given cache control method. * * @param cacheControl the cache control method * @return the string representation * @see parseCacheControl() */ KIO_EXPORT QString getCacheControlString(KIO::CacheControl cacheControl); /** * Returns the mount point where @p device is mounted * right now. This means, it has to be mounted, not just * defined in fstab. */ KIO_EXPORT QString findDeviceMountPoint( const QString& device ); /** * Returns the mount point on which resides @p filename. * For instance if /home is a separate partition, findPathMountPoint("/home/user/blah") * will return /home * @param filename the file name to check * @return the mount point of the given @p filename */ KIO_EXPORT QString findPathMountPoint( const QString & filename ); /** * Checks if the path belongs to a filesystem that is probably * slow. It checks for NFS or for paths belonging to automounted * paths not yet mounted * @param filename the file name to check * @return true if the filesystem is probably slow */ KIO_EXPORT bool probably_slow_mounted(const QString& filename); /** * Checks if the path belongs to a filesystem that is manually * mounted. * @param filename the file name to check * @return true if the filesystem is manually mounted */ KIO_EXPORT bool manually_mounted(const QString& filename); enum FileSystemFlag { SupportsChmod, SupportsChown, SupportsUTime, SupportsSymlinks, CaseInsensitive }; /** * Checks the capabilities of the filesystem to which a given file belongs. * given feature (e.g. chmod). * @param filename the file name to check * @param flag the flag to check * @return true if the filesystem has that flag, false if not (or some error occurred) * * The availables flags are: * @li SupportsChmod: returns true if the filesystem supports chmod * (e.g. msdos filesystems return false) * @li SupportsChown: returns true if the filesystem supports chown * (e.g. msdos filesystems return false) * @li SupportsUtime: returns true if the filesystems supports utime * (e.g. msdos filesystems return false) * @li SupportsSymlinks: returns true if the filesystems supports symlinks * (e.g. msdos filesystems return false) * @li CaseInsensitive: returns true if the filesystem treats * "foo" and "FOO" as being the same file (true for msdos systems) * */ KIO_EXPORT bool testFileSystemFlag(const QString& filename, FileSystemFlag flag);/************ * * Universal Directory Service * * Any file or URL can be represented by the UDSEntry type below * A UDSEntry is a list of atoms * Each atom contains a specific bit of information for the file * * The following UDS constants represent the different possible values * for m_uds in the UDS atom structure below * * Each atom contains a specific bit of information for the file */class KIO_EXPORT UDSAtom{public: /** * Whether 'm_str' or 'm_long' is used depends on the value of 'm_uds'. */ QString m_str; /** * Whether 'm_str' or 'm_long' is used depends on the value of 'm_uds'. */ long long m_long; /** * Holds one of the UDS_XXX constants */ unsigned int m_uds;};/** * An entry is the list of atoms containing all the informations for a file or URL */typedef QValueList<UDSAtom> UDSEntry;typedef QValueList<UDSEntry> UDSEntryList;typedef QValueListIterator<UDSEntry> UDSEntryListIterator;typedef QValueListConstIterator<UDSEntry> UDSEntryListConstIterator;/** * MetaData is a simple map of key/value strings. */class KIO_EXPORT MetaData : public QMap<QString, QString>{public: /** * Creates an empty meta data map. */ MetaData() : QMap<QString, QString>() { }; /** * Copy constructor. */ MetaData(const QMap<QString, QString>&metaData) : QMap<QString, QString>(metaData) { }; /** * Adds the given meta data map to this map. * @param metaData the map to add * @return this map */ MetaData & operator+= ( const QMap<QString,QString> &metaData ) { QMap<QString,QString>::ConstIterator it; for( it = metaData.begin(); it != metaData.end(); ++it) { replace(it.key(), it.data()); } return *this; }};}#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?