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
23class Q3GridLayout;
24class QLabel;
25class QTimer;
26class QImage;
27class QPixmap;
28class Q3TextEdit;
30class 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//=====================================
42class PhotoDescEdit : public QWidget
43{
44Q_OBJECT
45//----------------------
46public:
47 PhotoDescEdit( PhotoPreviewWidget* ppw, bool useAnimation, QWidget *parent=0, const char* name=0);
49//----------------------
50public slots:
51 void hide();
52//----------------------
53private slots:
55 void animate();
56
59 void disappear();
60//----------------------
61private:
64
67
69 QImage *imageLarge;
70
73
74 //beginning and end positions of the photo
76
79
82
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//======================
133class TextEdit : public Q3TextEdit
134{
135Q_OBJECT
136//----------------------
137public:
138 TextEdit(QWidget *parent=0, const char* name=0);
139 void paintNow();
140//----------------------
141private:
142 Q3PopupMenu* contextMenu;
143//----------------------
144protected:
145 void keyPressEvent ( QKeyEvent* e );
146 void focusOutEvent ( QFocusEvent* );
147 Q3PopupMenu* createPopupMenu ( const QPoint& pos );
148//----------------------
149signals:
150 void finished();
151//----------------------
152private slots:
153 void contextMenuHiding();
154};
155//======================
156
157
158
159#endif //GUI_PHOTODESCEDIT_H
void disappear()
this method is called by the acceptAndClose and rejectAndClose slots and actually initiates the closi...
void animate()
this method is iteratively called and animates the opening/closing of the image
Q3GridLayout * mainGrid
QLabel * staticPhoto
photo being displayed
bool dropShadowsEnabled
are drop shadows enabled in windows (xp)?
QLabel * animationLabel
label which shows moving and expanding photo on background
Q3GridLayout * staticGrid
grid static widgets placed in
QImage * imageLarge
beginning and end pixmaps
TextEdit * photoDesc
photo description
int left
bounaries of entire animation
PhotoDescEdit(PhotoPreviewWidget *ppw, bool useAnimation, QWidget *parent=0, const char *name=0)
int smallWidth
small size
QPixmap * backgroundImage
this pixmap contains the screen contents for the entire region which we will be painting on top of
QWidget * staticFrame
frame which contains static widget
QPixmap * buffer
buffer we'll iteratively update and use for the label which shows the animation taking place
int idealTextSize
ultimate text dimension
QImage * textRectangle
text area widget used to computing painting surface
PhotoPreviewWidget * ppw
photo preview widget pointer
bool useAnimation
actually animate the opening/closing process?
Displays photo thumbnail and description.
void contextMenuHiding()
void focusOutEvent(QFocusEvent *)
TextEdit(QWidget *parent=0, const char *name=0)
void finished()
Q3PopupMenu * contextMenu
void keyPressEvent(QKeyEvent *e)
Q3PopupMenu * createPopupMenu(const QPoint &pos)
void paintNow()