Update mussa to build on ubuntu 10.04 with qt 4.6.2 +boost 1.40.0.1
[mussa.git] / qui / ImageScaler.hpp
1 #ifndef _IMAGESCALER_H_
2 #define _IMAGESCALER_H_
3
4 #include <QFrame>
5
6 class QSpinBox;
7 class QLabel;
8 class QAction;
9 class QCheckBox;
10
11 class ImageScaler : public QFrame
12 {
13   Q_OBJECT
14
15 public:
16   ImageScaler(QWidget *parent = 0);
17
18   int getMaxHeight() const;
19   int getMaxWidth() const;
20   int getWidth() const;
21   int getHeight() const;
22
23 public slots:
24   void setMaxWidth(int newValue);
25   void setMaxHeight(int newValue);
26
27   //! Locks apsect ratio with true/false.
28   void setLockAspectRatio(bool state);
29   //! Locks aspect ratio with parameter Qt::Checked or Qt::Unchecked.
30   void setLockAspectRatio(int state);
31
32
33   void setWidth(int newValue);
34   void setHeight(int newValue);
35
36 signals:
37   void maxWidthChanged(int newWidth);
38   void maxHeightChanged(int newHeight);
39   void widthChanged(int newWidth);
40   void heightChanged(int newHeight);
41
42 private:
43   QSpinBox *widthBox;
44   QSpinBox *heightBox;
45   QLabel *widthLabel;
46   QLabel *heightLabel;
47   QAction *lockAspectAction;
48   QCheckBox *lockButton;
49
50   bool lockAspectRatio;
51   float aspectRatio;
52   int maxWidth;
53   int minWidth;
54   int curWidth;
55   int maxHeight;
56   int minHeight;
57   int curHeight;
58
59 };
60
61 #endif