summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/impl/dcim/dcim_lister.h
blob: d0a2031652e56ca814aa76778bfaabb4ffb67162 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * GPLv2 zecke@handhelds.org
 */

#ifndef DCIM_LISTER_H
#define DCIM_LISTER_H

#include <iface/dirlister.h>

#include <qmap.h>

class Config;

/**
 * The DirLister is responsible for
 * telling the GUI about files and folders
 * and to load them.
 * The DCIM is a special FileSystem lister
 * in the that it starts with an overview
 * of available 'Cameras'. It looks via 'Storage'
 * for paths including a 'dcim' directory.
 * And offers these as folders.
 * Then it only lists Images. It tries to use
 * the 'preview' directory to generate a thumbnail
 * but will use the full image for the QImage
 * call.
 *
 */
class DCIM_DirLister : public PDirLister {
    Q_OBJECT
public:
    enum ListMode{
        ListingUnknown = -1,
        ListingStart=1,  /* give an overview over files   */
        ListingFolder, /* give access to albums         */
	ListingFiles,   /* list the content of the album */
	ListingReFolder
    };
    DCIM_DirLister();
    ~DCIM_DirLister();

    QString defaultPath()const;
    QString setStartPath( const QString& );

    QString currentPath()const;
    QStringList folders()const;
    QStringList files()  const;

    void deleteImage( const QString& );

    void thumbNail( const QString&, int, int );
    QImage image( const QString&, Factor, int );
    void imageInfo( const QString& );
    void fullImageInfo( const QString& );


    virtual QString nameToFname( const QString& )const;
    virtual QString dirUp(const QString& )const;

private:
    QStringList findCameras()const;
    QStringList findAlbums ()const;
    QStringList findImages ()const;

private:
    mutable QString  m_path;
    mutable ListMode m_mode;
    mutable QMap<QString, QString> m_map;
};

#endif