Source /tmp/session_bus_address.user before invoking dbus-send in postinst script
[harmattan/cameraplus] / declarative / imageresolution.h
1 // -*- c++ -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library 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 GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22
23 #ifndef IMAGE_RESOLUTION_H
24 #define IMAGE_RESOLUTION_H
25
26 #include <QObject>
27 #include "qtcamimagesettings.h"
28
29 class ImageResolution : public QObject {
30   Q_OBJECT
31
32   Q_PROPERTY(QString resolutionLd READ resolutionId WRITE setResolutionId NOTIFY resolutionIdChanged);
33   Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged);
34   Q_PROPERTY(QString aspectRatio READ aspectRatio WRITE setAspectRatio NOTIFY aspectRatioChanged);
35   Q_PROPERTY(QSize captureResolution READ capture WRITE setCapture NOTIFY captureChanged);
36   Q_PROPERTY(QSize previewResolution READ preview WRITE setPreview NOTIFY previewChanged);
37   Q_PROPERTY(QSize viewfinderResolution READ viewfinder WRITE setViewfinder NOTIFY viewfinderChanged);
38   Q_PROPERTY(int frameRate READ fps WRITE setFps NOTIFY fpsChanged);
39   Q_PROPERTY(int nightFrameRate READ nightFps WRITE setNightFps NOTIFY nightFpsChanged);
40   Q_PROPERTY(int megaPixels READ megaPixels WRITE setMegaPixels NOTIFY megaPixelsChanged);
41
42 public:
43   ImageResolution(QObject *parent = 0);
44   ImageResolution(const QtCamImageResolution& resolution, QObject *parent = 0);
45   ~ImageResolution();
46
47   QtCamImageResolution resolution();
48
49   QString resolutionId() const;
50   void setResolutionId(const QString& resolutionId);
51
52   QString name() const;
53   void setName(const QString& name);
54
55   QString aspectRatio() const;
56   void setAspectRatio(const QString& aspectRatio);
57
58   QSize capture() const;
59   void setCapture(const QSize& capture);
60
61   QSize preview() const;
62   void setPreview(const QSize& preview);
63
64   QSize viewfinder() const;
65   void setViewfinder(const QSize& viewfinder);
66
67   int fps() const;
68   void setFps(int fps);
69
70   int nightFps() const;
71   void setNightFps(int nightFps);
72
73   int megaPixels() const;
74   void setMegaPixels(int megaPixels);
75
76 signals:
77   void resolutionIdChanged();
78   void nameChanged();
79   void captureChanged();
80   void previewChanged();
81   void viewfinderChanged();
82   void fpsChanged();
83   void nightFpsChanged();
84   void megaPixelsChanged();
85   void aspectRatioChanged();
86
87 private:
88   QString m_resolutionId;
89   QString m_name;
90   QString m_aspectRatio;
91   QSize m_capture;
92   QSize m_preview;
93   QSize m_viewfinder;
94   int m_fps;
95   int m_nightFps;
96   int m_megaPixels;
97 };
98
99 #endif /* IMAGE_RESOLUTION_H */