ImageSel Pile   version 0.0.1
ImageSel pile.
imagesel.h
Go to the documentation of this file.
1 
10 #ifndef GUARD_IMAGESEL_H_INCLUDE
11 #define GUARD_IMAGESEL_H_INCLUDE
12 
13 #include <imagesel/imagesel-config.h>
14 #include <QWidget>
15 
16 class ActiveGrip;
17 class LayoutInterf;
18 
20 class IMAGESEL_EXPORT ImageSel : public QWidget {
21  Q_OBJECT
22 
23  friend class ActiveGrip;
24 
25 public:
26 
28  enum BuildInLay {
29  Invalid = -1,
30 
31  Rectangular,
32  Square,
33  Ellipse,
34  Circle,
35 
36  BuildinMax
37  };
38 
39 
40 
42  ImageSel (
43  QWidget * parent = NULL);
44 
46  virtual ~ImageSel();
47 
49  void
51  const QPixmap & value) {
52  image_ = value;
53  update ();
54  }
55 
57  void
59  image_ = QPixmap ();
60  update ();
61  }
62 
64  const QPixmap &
65  image () const {
66  return image_;
67  }
68 
70  void
71  setBuildInLayout (
72  BuildInLay kind);
73 
75  void
77  LayoutInterf * value) {
78  lay_ = value;
79  update ();
80  }
81 
83  LayoutInterf *
84  lay () const {
85  return lay_;
86  }
87 
89  LayoutInterf *
90  takeLay () {
91  LayoutInterf * tmp = lay_;
92  lay_ = NULL;
93  return tmp;
94  }
95 
96 
97 
98 protected:
99 
101  QPoint
102  gripMode (
103  ActiveGrip * grip,
104  const QPoint & pos);
105 
106  void mousePressEvent (QMouseEvent *);
107  void mouseReleaseEvent (QMouseEvent *);
108  void mouseMoveEvent (QMouseEvent *);
109  void paintEvent (QPaintEvent *);
110 
111 private:
112  QPixmap image_;
113  QPoint offset_;
114  LayoutInterf * lay_;
115 };
116 
117 #endif // GUARD_IMAGESEL_H_INCLUDE
LayoutInterf * lay() const
Get the layout interface.
Definition: imagesel.h:84
void setLay(LayoutInterf *value)
Set the layout interface; ownership transfered to this instance.
Definition: imagesel.h:76
const QPixmap & image() const
The image that's being presented to the user.
Definition: imagesel.h:65
void clearImage()
Remove the image that's being presented to the user.
Definition: imagesel.h:58
brief description
Definition: layoutinterf.h:20
brief description
Definition: activegrip.h:19
void setImage(const QPixmap &value)
Change the image that's being presented to the user.
Definition: imagesel.h:50
BuildInLay
The list of build-in layouts.
Definition: imagesel.h:28
brief description
Definition: imagesel.h:20
LayoutInterf * takeLay()
Take ownership of the layout interface.
Definition: imagesel.h:90