filehandle.h 1.84 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
/***************************************************************************
                          filehandle.h
                             -------------------
    begin                : Sun Feb 29 2004
    copyright            : (C) 2004 by Scott Wheeler
    email                : wheeler@kde.org
***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef JUK_FILEHANDLE_H
#define JUK_FILEHANLDE_H

class Tag;

/**
 * An value based, explicitly shared wrapper around file related information
 * used in JuK's playlists.
 */

class FileHandle
{
public:
    FileHandle();
    FileHandle(const FileHandle &f);
33
    FileHandle(const QFileInfo &info, const QString &path = QString::null);
34
    explicit FileHandle(const QString &path);
35 36
    ~FileHandle();

37 38 39 40
    /**
     * Forces the FileHandle to reread its information from the disk.
     */
    void refresh();
41
    void setFile(const QString &path);
42

43
    Tag *tag() const;
44 45
    QString absFilePath() const;
    const QFileInfo &fileInfo() const;
46

47 48 49
    bool current() const;
    const QDateTime &lastModified() const;

50 51 52 53 54 55 56 57 58
    FileHandle &operator=(const FileHandle &f);
    bool operator==(const FileHandle &f) const;

private:
    class FileHandlePrivate;
    FileHandlePrivate *d;
};

#endif