AlbumShaper  1.0a3
photoDescEdit.h
Go to the documentation of this file.
1 //Added by qt3to4:
2 #include <QPixmap>
3 #include <Q3GridLayout>
4 #include <QLabel>
5 #include <QKeyEvent>
6 #include <Q3PopupMenu>
7 #include <QFocusEvent>
8 //==============================================
9 // copyright : (C) 2003-2005 by Will Stokes
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
14 // Foundation; either version 2 of the License, or
15 // (at your option) any later version.
16 //==============================================
17 
18 #ifndef GUI_PHOTODESCEDIT_H
19 #define GUI_PHOTODESCEDIT_H
20 
21 //--------------------
22 //forward declarations
23 class Q3GridLayout;
24 class QLabel;
25 class QTimer;
26 class QImage;
27 class QPixmap;
28 class Q3TextEdit;
29 class PhotoPreviewWidget;
30 class TextEdit;
31 //--------------------
32 
33 #define STATIC 0
34 #define APPEARING 1
35 #define DISAPPEARING 2
36 #define DISAPPEARED 3
37 
38 #include <qwidget.h>
39 #include <qdatetime.h>
40 #include <q3textedit.h>
41 //=====================================
42 class PhotoDescEdit : public QWidget
43 {
44 Q_OBJECT
45 //----------------------
46 public:
47  PhotoDescEdit( PhotoPreviewWidget* ppw, bool useAnimation, QWidget *parent=0, const char* name=0);
49 //----------------------
50 public slots:
51  void hide();
52 //----------------------
53 private slots:
55  void animate();
56 
59  void disappear();
60 //----------------------
61 private:
64 
67 
69  QImage *imageLarge;
70 
72  QImage* textRectangle;
73 
74  //beginning and end positions of the photo
75  QPoint initPos, finalPos;
76 
78  int left, right, top, bottom;
79 
82 
85  QPixmap* backgroundImage;
86 
90  //Main grid
91  Q3GridLayout* mainGrid;
94 
97 
99  QPixmap* buffer;
102 
104  Q3GridLayout* staticGrid;
105 
108 
111 
116 
117  //timer stuff
119 
120  //appearing or disappearing
121  int mode;
122 
125 
126  //timer and time variables for ongoing animation
127  QTimer* timer;
130 };
131 
132 //======================
133 class TextEdit : public Q3TextEdit
134 {
135 Q_OBJECT
136 //----------------------
137 public:
138  TextEdit(QWidget *parent=0, const char* name=0);
139  void paintNow();
140 //----------------------
141 private:
142  Q3PopupMenu* contextMenu;
143 //----------------------
144 protected:
145  void keyPressEvent ( QKeyEvent* e );
146  void focusOutEvent ( QFocusEvent* );
147  Q3PopupMenu* createPopupMenu ( const QPoint& pos );
148 //----------------------
149 signals:
150  void finished();
151 //----------------------
152 private slots:
153  void contextMenuHiding();
154 };
155 //======================
156 
157 
158 
159 #endif //GUI_PHOTODESCEDIT_H
QPixmap * buffer
buffer we&#39;ll iteratively update and use for the label which shows the animation taking place ...
Definition: photoDescEdit.h:99
QWidget * staticFrame
frame which contains static widget
QImage * textRectangle
text area widget used to computing painting surface
Definition: photoDescEdit.h:72
Q3GridLayout * mainGrid
Definition: photoDescEdit.h:91
int idealTextSize
ultimate text dimension
Definition: photoDescEdit.h:81
Displays photo thumbnail and description.
Q3GridLayout * staticGrid
Static Widgets
TextEdit * photoDesc
photo description
QImage * imageLarge
beginning and end pixmaps
Definition: photoDescEdit.h:69
int initDelay
Animation Stuff
void disappear()
this method is called by the acceptAndClose and rejectAndClose slots and actually initiates the closi...
int smallWidth
small size
Definition: photoDescEdit.h:88
QLabel * staticPhoto
photo being displayed
QLabel * animationLabel
Animating Widgets
Definition: photoDescEdit.h:96
int left
bounaries of entire animation
Definition: photoDescEdit.h:78
void animate()
this method is iteratively called and animates the opening/closing of the image
QTimer * timer
PhotoPreviewWidget * ppw
photo preview widget pointer
Definition: photoDescEdit.h:66
PhotoDescEdit(PhotoPreviewWidget *ppw, bool useAnimation, QWidget *parent=0, const char *name=0)
QPixmap * backgroundImage
this pixmap contains the screen contents for the entire region which we will be painting on top of ...
Definition: photoDescEdit.h:85
Q3PopupMenu * contextMenu
bool dropShadowsEnabled
are drop shadows enabled in windows (xp)?
bool useAnimation
actually animate the opening/closing process?
Definition: photoDescEdit.h:63