summaryrefslogtreecommitdiffstats
path: root/src/utilities/cameragui/cameraui.h
blob: df9c7885839b83dfc490915e12d8bf8701c257fd (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/* ============================================================
 *
 * This file is a part of digiKam project
 * http://www.digikam.org
 *
 * Date        : 2004-09-16
 * Description : Camera interface dialog
 *
 * Copyright (C) 2004-2005 by Renchi Raju <[email protected]>
 * Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * 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, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * ============================================================ */

#ifndef CAMERAUI_H
#define CAMERAUI_H

// TQt includes.

#include <tqdatetime.h>
#include <tqstring.h>
#include <tqimage.h>

// KDE includes.

#include <kdialogbase.h>
#include <kurl.h>

// Local includes.

#include "gpiteminfo.h"

namespace Digikam
{

class Album;
class CameraIconViewItem;
class CameraUIPriv;

class CameraUI : public KDialogBase
{
    TQ_OBJECT
  

public:

    CameraUI(TQWidget* parent, const TQString& cameraTitle,
             const TQString& model, const TQString& port,
             const TQString& path, const TQDateTime lastAccess);
    ~CameraUI();

    bool isBusy() const;
    bool isClosed() const;

    bool autoRotateJpegFiles() const;

    /** Get status of JPEG conversion files to lossless format during download.*/
    bool convertLosslessJpegFiles() const;
    TQString losslessFormat();

    TQString cameraTitle() const;

signals:

    void signalLastDestination(const KURL&);
    void signalAlbumSettingsChanged();

public slots:

    void slotDownload(bool onlySelected, bool deleteAfter, Album *album=0);

protected:

    void closeEvent(TQCloseEvent* e);
    void keyPressEvent(TQKeyEvent *e);

private:

    void readSettings();
    void saveSettings();
    bool dialogClosed();
    bool createAutoAlbum(const KURL& parentURL, const TQString& sub,
                         const TQDate& date, TQString& errMsg);
    void addFileExtension(const TQString& ext);
    void finishDialog();
    void deleteItems(bool onlySelected, bool onlyDownloaded);
    void checkItem4Deletion(CameraIconViewItem* iconItem, TQStringList& folders, TQStringList& files,
                            TQStringList& deleteList, TQStringList& lockedList);

private slots:

    void slotClose();
    void slotCancelButton();
    void slotProcessURL(const TQString& url);

    void slotConnected(bool val);
    void slotBusy(bool val);
    void slotErrorMsg(const TQString& msg);
    void slotInformations();
    void slotCameraInformations(const TQString&, const TQString&, const TQString&);

    void slotFolderList(const TQStringList& folderList);
    void slotFileList(const GPItemInfoList& fileList);
    void slotThumbnail(const TQString&, const TQString&, const TQImage&);

    void slotIncreaseThumbSize();
    void slotDecreaseThumbSize();

    void slotUpload();
    void slotUploadItems(const KURL::List&);
    void slotDownloadSelected();
    void slotDownloadAll();
    void slotDeleteSelected();
    void slotDownloadAndDeleteSelected();
    void slotDeleteAll();
    void slotDownloadAndDeleteAll();
    void slotToggleLock();

    void slotFileView(CameraIconViewItem* item);

    void slotUploaded(const GPItemInfo&);
    void slotDownloaded(const TQString&, const TQString&, int);
    void slotSkipped(const TQString&, const TQString&);
    void slotDeleted(const TQString&, const TQString&, bool);
    void slotLocked(const TQString&, const TQString&, bool);

    void slotNewSelection(bool);
    void slotItemsSelected(CameraIconViewItem* item, bool selected);

    void slotExifFromFile(const TQString& folder, const TQString& file);
    void slotExifFromData(const TQByteArray& exifData);

    void slotFirstItem(void);
    void slotPrevItem(void);
    void slotNextItem(void);
    void slotLastItem(void);

private:

    CameraUIPriv* d;
};

}  // namespace Digikam

#endif /* CAMERAUI_H */