MythTV  master
galleryutil.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 /* ============================================================
3  * File : exifutil.h
4  * Description :
5  *
6 
7  * This program is free software; you can redistribute it
8  * and/or modify it under the terms of the GNU General
9  * Public License as published bythe Free Software Foundation;
10  * either version 2, or (at your option)
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * ============================================================ */
19 
20 #ifndef GALLERYUTIL_H
21 #define GALLERYUTIL_H
22 
23 #include <QDateTime>
24 #include <QFileInfo>
25 
26 #include "iconview.h"
27 
28 typedef enum {
32  kScaleMaxCount // must be last
33 } ScaleMax;
34 
36 {
37  public:
38  static QStringList GetImageFilter(void);
39  static QStringList GetMovieFilter(void);
40  static QStringList GetMediaFilter(void);
41 
42  static bool IsImage(const QString &filePath);
43  static bool IsMovie(const QString &filePath);
44  static long GetNaturalRotation(const unsigned char *buffer, int size);
45  static long GetNaturalRotation(const QString &filePath);
46 
47  static QString GetCaption(const QString &filePath);
48  static QDateTime GetTimestamp(const QString &filePath);
49 
50  static bool LoadDirectory(ThumbList &itemList, const QString &dir,
51  const GalleryFilter& flt, bool recurse,
52  ThumbHash *itemHash, ThumbGenerator *thumbGen);
53 
54  static QSize ScaleToDest(const QSize &src, const QSize &dest, ScaleMax scaleMax);
55 
56  static bool CopyMove(const QFileInfo &src, QFileInfo &dst, bool move)
57  { if (move) return Move(src, dst); else return Copy(src, dst); }
58 
59  static bool Copy(const QFileInfo &src, QFileInfo &dst);
60  static bool Move(const QFileInfo &src, QFileInfo &dst);
61  static bool Delete(const QFileInfo &file);
62  static bool Rename(const QString &currDir, const QString &oldName,
63  const QString &newName);
64 
65  static void PlayVideo(const QString &filename);
66 
67  private:
68  static bool CopyDirectory(const QFileInfo& src, QFileInfo &dst);
69  static bool MoveDirectory(const QFileInfo& src, QFileInfo &dst);
70  static bool DeleteDirectory(const QFileInfo &dir);
71  static bool RenameDirectory(const QString &currDir, const QString &oldName,
72  const QString &newName);
73  static long GetNaturalRotation(void *exifData);
74 };
75 
76 #endif /* GALLERYUTIL_H */
static long GetNaturalRotation(const unsigned char *buffer, int size)
static void PlayVideo(const QString &filename)
static bool Rename(const QString &currDir, const QString &oldName, const QString &newName)
static bool LoadDirectory(ThumbList &itemList, const QString &dir, const GalleryFilter &flt, bool recurse, ThumbHash *itemHash, ThumbGenerator *thumbGen)
QList< ThumbItem * > ThumbList
Definition: thumbview.h:78
static bool RenameDirectory(const QString &currDir, const QString &oldName, const QString &newName)
QHash< QString, ThumbItem * > ThumbHash
Definition: thumbview.h:79
static bool IsMovie(const QString &filePath)
static bool Copy(const QFileInfo &src, QFileInfo &dst)
static bool IsImage(const QString &filePath)
static bool CopyMove(const QFileInfo &src, QFileInfo &dst, bool move)
Definition: galleryutil.h:56
static QStringList GetMediaFilter(void)
Definition: galleryutil.cpp:95
static bool Delete(const QFileInfo &file)
static QSize ScaleToDest(const QSize &src, const QSize &dest, ScaleMax scaleMax)
static QDateTime GetTimestamp(const QString &filePath)
static bool MoveDirectory(const QFileInfo &src, QFileInfo &dst)
static QString GetCaption(const QString &filePath)
ScaleMax
Definition: galleryutil.h:28
static bool DeleteDirectory(const QFileInfo &dir)
static QStringList GetMovieFilter(void)
Definition: galleryutil.cpp:74
static QStringList GetImageFilter(void)
Definition: galleryutil.cpp:58
static bool CopyDirectory(const QFileInfo &src, QFileInfo &dst)
static bool Move(const QFileInfo &src, QFileInfo &dst)