~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/timeadjust/clockphotodialog.h

  • Committer: Package Import Robot
  • Author(s): Felix Geyer, Rohan Garg, Philip Muškovac, Felix Geyer
  • Date: 2011-09-23 18:18:55 UTC
  • mfrom: (1.2.36 upstream)
  • Revision ID: package-import@ubuntu.com-20110923181855-ifs67wxkugshev9k
Tags: 2:2.1.1-0ubuntu1
[ Rohan Garg ]
* New upstream release (LP: #834190)
  - debian/control
    + Build with libqtwebkit-dev
 - debian/kipi-plugins-common
    + Install libkvkontakte required by kipi-plugins
 - debian/digikam
    + Install panoramagui

[ Philip Muškovac ]
* New upstream release
  - debian/control:
    + Add libcv-dev, libcvaux-dev, libhighgui-dev, libboost-graph1.46-dev,
      libksane-dev, libxml2-dev, libxslt-dev, libqt4-opengl-dev, libqjson-dev,
      libgpod-dev and libqca2-dev to build-deps
    + Add packages for kipi-plugins, libmediawiki, libkface, libkgeomap and
      libkvkontakte
  - debian/rules:
    + Don't build with gphoto2 since it doesn't build with it.
  - Add kubuntu_fix_test_linking.diff to fix linking of the dngconverter test
  - update install files
  - update kubuntu_01_mysqld_executable_name.diff for new cmake layout
    and rename to kubuntu_mysqld_executable_name.diff
* Fix typo in digikam-data description (LP: #804894)
* Fix Vcs links

[ Felix Geyer ]
* Move library data files to the new packages libkface-data, libkgeomap-data
  and libkvkontakte-data.
* Override version of the embedded library packages to 1.0~digikam<version>.
* Exclude the library packages from digikam-dbg to prevent file conflicts in
  the future.
* Call dh_install with --list-missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of kipi-plugins project
 
4
 * http://www.kipi-plugins.org
 
5
 *
 
6
 * Date        : 2009-05-31
 
7
 * Description : Figure out camera clock delta from a clock picture.
 
8
 *
 
9
 * Copyright (C) 2009 by Pieter Edelman (p dot edelman at gmx dot net)
 
10
 *
 
11
 * This program is free software; you can redistribute it
 
12
 * and/or modify it under the terms of the GNU General
 
13
 * Public License as published by the Free Software Foundation;
 
14
 * either version 2, or (at your option) any later version.
 
15
 *
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 *
 
21
 * ============================================================ */
 
22
 
 
23
#ifndef CLOCKPHOTODIALOG_H
 
24
#define CLOCKPHOTODIALOG_H
 
25
 
 
26
// Qt includes
 
27
 
 
28
#include <QDateTime>
 
29
#include <QScrollArea>
 
30
#include <QScrollBar>
 
31
#include <QLabel>
 
32
 
 
33
// KDE includes
 
34
 
 
35
#include <kdialog.h>
 
36
#include <kurl.h>
 
37
 
 
38
namespace KIPI
 
39
{
 
40
    class Interface;
 
41
}
 
42
 
 
43
namespace KIPIPlugins
 
44
{
 
45
    class ImageDialog;
 
46
}
 
47
 
 
48
namespace KIPITimeAdjustPlugin
 
49
{
 
50
 
 
51
/* Overloaded class for displaying the image in a QScrollArea, to provide
 
52
 * support for dragging it around with the middle button. */
 
53
class ImageDisplay : public QLabel
 
54
{
 
55
    Q_OBJECT
 
56
 
 
57
public:
 
58
 
 
59
    ImageDisplay(QScrollArea *);
 
60
 
 
61
protected:
 
62
 
 
63
    void mousePressEvent(QMouseEvent*);
 
64
    void mouseMoveEvent(QMouseEvent*);
 
65
    void mouseReleaseEvent(QMouseEvent*);
 
66
 
 
67
private:
 
68
 
 
69
    int         currX;
 
70
    int         currY;
 
71
 
 
72
    QScrollBar *barX;
 
73
    QScrollBar *barY;
 
74
};
 
75
 
 
76
// -----------------------------------------------------------------------------------
 
77
 
 
78
class ClockPhotoDialogPrivate;
 
79
 
 
80
/* Class for determining the camera time difference from a photo of a time
 
81
 * display. The user can load a photo and tell the time displayed on this
 
82
 * photo. This class calculates the time difference and stores it in a set
 
83
 * of public variables: deltaNegative indicates whether the time should be
 
84
 * added (false) or subtracted (true). deltaDays, deltaHours, deltaMinutes
 
85
 * and deltaSeconds hold the numbers of days, hours, minutes and seconds
 
86
 * to add or subtract. Months and years are not used, because these can be
 
87
 * ambigious. */
 
88
class ClockPhotoDialog : public KDialog
 
89
{
 
90
    Q_OBJECT
 
91
 
 
92
public:
 
93
 
 
94
    ClockPhotoDialog(KIPI::Interface* interface, QWidget* parent);
 
95
    ~ClockPhotoDialog();
 
96
 
 
97
    /* The public variables that hold the time difference. */
 
98
    bool deltaNegative;
 
99
    int  deltaDays;
 
100
    int  deltaHours;
 
101
    int  deltaMinutes;
 
102
    int  deltaSeconds;
 
103
 
 
104
    /* Try to load the photo specified by the KUrl, and set the datetime widget
 
105
     * to the photo time. Return true on succes, or false if eithe the photo
 
106
     * can't be read or the datetime information can't be read. */
 
107
    bool setImage(const KUrl&);
 
108
 
 
109
protected:
 
110
 
 
111
    void resizeEvent(QResizeEvent *);
 
112
 
 
113
private Q_SLOTS:
 
114
 
 
115
    void slotLoadPhoto();
 
116
    void slotAdjustZoom(int);
 
117
    void slotZoomOut();
 
118
    void slotZoomIn();
 
119
    void slotOk();
 
120
    void slotCancel();
 
121
 
 
122
private:
 
123
 
 
124
    /* Calculate the minimum value for the scroll slider according to the window
 
125
     * size. If fit is true, the image is made to fit in the viewport. */
 
126
    void adjustToWindowSize(bool);
 
127
 
 
128
    void saveSize();
 
129
 
 
130
private:
 
131
 
 
132
    QDateTime                photoDateTime;
 
133
    ClockPhotoDialogPrivate* const d;
 
134
};
 
135
 
 
136
}  // namespace KIPITimeAdjustPlugin
 
137
 
 
138
#endif /* CLOCKPHOTODIALOG_H */