AlbumShaper  1.0a3
titleWidget.h
Go to the documentation of this file.
1 //Added by qt3to4:
2 #include <QDropEvent>
3 #include <Q3GridLayout>
4 #include <QPixmap>
5 #include <QLabel>
6 #include <Q3PopupMenu>
7 #include <QDragEnterEvent>
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_TITLEWIDGET_H
19 #define GUI_TITLEWIDGET_H
20 
21 //--------------------
22 //forward declarations
23 class QMenuBar;
24 class Q3PopupMenu;
25 class Q3GridLayout;
26 class QLabel;
27 class QLineEdit;
28 class QPixmap;
29 class QToolButton;
30 class Album;
31 class Subalbum;
32 class Window;
33 class AlbumStatistics;
35 class About;
36 class HelpWindow;
37 class Shortcuts;
38 class ALabel;
39 class Q3IconViewItem;
40 class Photo;
42 //--------------------
43 
44 #define ABOUT 0
45 #define UPDATES 1
46 #define UPCOMING 2
47 
48 #include <q3frame.h>
49 #include "../backend/recentAlbums.h"
50 
51 //=====================================
55 //=====================================
56 class TitleWidget : public Q3Frame
57 {
58 Q_OBJECT
59 
60 public:
62  TitleWidget(QWidget *parent=0, const char* name=0);
63 
65  ~TitleWidget();
66 
68  void useAnimation(bool val);
69 
71  void setAlbum( Album* val);
72 
74  Album* getAlbum();
75 
77  void refresh();
78 
80  bool getBusy();
81 
83  void setBusy(bool val);
84 
87 //----------------------
88 protected:
89  void dragEnterEvent( QDragEnterEvent* e);
90  void dropEvent( QDropEvent* e);
91 
92  //create and return path to temporary directory for an album,
93  //if no string is provided temporary directory is created
94  //using user prefernce for default temporary directories
95  QString createTmpDir(QString albumPath = QString::null );
96 //----------------------
97 signals:
100 //----------------------
101 public slots:
103  void albumStatisticsClosed();
104 
106  void aboutClosed();
107 
109  void helpClosed();
110 
112  void quitApplication();
113 
114  //Settings closed
115  void settingsWindowClosed();
116 
118  void updateAlbumAnnotations();
119 
121  void refreshCollectionAnnotations(Subalbum* collection);
122 
124  void setAlbumImage(Photo* photo);
125 
127  void setSubalbumImage(Photo* photo);
128 
130  void aboutProgram(int mode = ABOUT);
131 
133  void help();
134 
136  void windowStateChanged(bool state);
137 
139  void updateMenus(bool anySelected=false, bool anyRevertable=false);
140 //----------------------
141 private slots:
143  void storeAnnotations();
144 
146  void setAlbumImage();
147 
149  void unsetAlbumImage();
150 
152  void setSubalbumImage();
153 
155  void unsetSubalbumImage();
156 
158  void newAlbum();
159  //----------------------------
161  void loadAlbum();
162 
164  void loadRecentAlbum(int index);
165 
169  bool proceedWithLoad();
170 
172  void loadAlbum(QString location);
173  //----------------------------
175  void saveAlbum();
176 
178  void saveAsAlbum();
179 
181  void revertToSaved();
182 
184  void exportSmallWebGallery();
185 
187  void exportLargeImages();
188 
190  void settings();
191 
194 
196  void revertPhotos();
197 
199  void albumStatistics();
200 
202  void clearOpenRecentMenu();
203  //----------------------
204 private:
206  void populateOpenRecentMenu();
207 
209  void refreshOpenRecentMenu();
210 
212  QMenuBar* menu;
213 
215  Q3PopupMenu* file;
216 
218  Q3PopupMenu* openRecent;
222 
223 
225  Q3PopupMenu* photoMenu;
226 
228  Q3PopupMenu* tools;
229 
230  //PLATFORM_SPECIFIC_CODE
232  #if defined(Q_OS_MACX)
233  Q3PopupMenu* windowMenu;
234  int WINDOW_MINIMIZE;
235  #endif
236 
238  Q3PopupMenu* helpMenu;
239 
241  Q3GridLayout* mainGrid;
243 
245  Q3GridLayout* albumAnnotationGrid;
249  QLineEdit* albumNameVal;
253  QLineEdit* albumAuthorVal;
254 
256  Q3GridLayout* subalbumAnnotationGrid;
260  QLineEdit* subalbumNameVal;
263 
266 
269 
272 
275 
278 
281 
283  bool busy;
284 
285  //modification detection enabled/disabled
287 
288  //file menu item id's
296 
300 
304 
307 
310 
311  //recent albums object
313  //----------------------
314 };
315 //======================
316 
317 #endif //GUI_TITLEWIDGET_H
Definition: ALabel.h:42
About window widget.
Definition: about.h:39
Album Statistics Window.
An album contains Subalbums.
Definition: album.h:53
Configuration/Settings Interface.
Help window widget.
Definition: helpWindow.h:29
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image,...
Definition: photo.h:45
A custom menu entry, displays album image, name, and number of photos.
This class maintains and handles saving and loading a list of recently viewed albums.
Definition: recentAlbums.h:27
Shortcuts window widget.
A subalbum contains photos.
Definition: subalbum.h:49
Widget which displays album name, description, representative image, and album shaper logo.
Definition: titleWidget.h:57
void dropEvent(QDropEvent *e)
bool detectModifications
Definition: titleWidget.h:286
void settingsWindowClosed()
QString createTmpDir(QString albumPath=QString::null)
void windowStateChanged(bool state)
Enables/disables "minimize" window menu entry depending on window state.
int REVERT_PHOTOS
Definition: titleWidget.h:299
Q3Frame * albumAnnotationFrame
Definition: titleWidget.h:246
int REMOVE_DESCRIPTIONS
photos menu item id's
Definition: titleWidget.h:298
Album * getAlbum()
Returns a pointer to the album object.
QString tmpDirErrorDesc
Definition: titleWidget.h:309
void albumStatistics()
Pops up album statistics window.
TitleWidget(QWidget *parent=0, const char *name=0)
Creates layout.
Definition: titleWidget.cpp:68
bool cacheSetButtonState
cached set button state
Definition: titleWidget.h:306
Window * window
Window pointer.
Definition: titleWidget.h:268
void unsetAlbumImage()
Unsets the Album Image.
void revertToSaved()
Revert to last saved album.
RecentAlbums * getRecentAlbums()
returns handle to recent albums object
void loadRecentAlbum(int index)
Loads a recent album.
Q3PopupMenu * tools
Tools menu.
Definition: titleWidget.h:228
void albumStatisticsClosed()
Frees album statistics dialog once closed.
QLabel * subalbumName
Definition: titleWidget.h:259
int numRecentMenuItems
Definition: titleWidget.h:220
QLineEdit * albumDescriptionVal
Definition: titleWidget.h:251
void revertPhotos()
Revert selected photos to original form.
int BEGIN_PRESENTATION
tools menu item id's
Definition: titleWidget.h:302
QLineEdit * albumAuthorVal
Definition: titleWidget.h:253
void refreshOpenRecentMenu()
Refreshes open recent menu.
QLabel * albumDescription
Definition: titleWidget.h:250
void aboutClosed()
Frees about dialog once closed.
Q3Frame * subalbumAnnotationFrame
Definition: titleWidget.h:257
void clearOpenRecentMenu()
Clears albums from open recent menu.
void storeAnnotations()
Store annotations.
void exportLargeImages()
Export large images only to a new directory for printing purposes.
bool proceedWithLoad()
Helper function for load methods, checks if there are any unsaved changes and if so warns user any su...
void setBusy(bool val)
set program busy state
void quitApplication()
Quit slot.
int BEGIN_PRESENTATION_AT
Definition: titleWidget.h:303
Q3PopupMenu * file
File menu.
Definition: titleWidget.h:215
void subalbumNameChanged()
Emitted when user changes subalbum name.
HelpWindow * helpWindow
HelpWindow pointer.
Definition: titleWidget.h:280
void aboutProgram(int mode=ABOUT)
Pops up about dialog.
void updateAlbumAnnotations()
Updates subalbum annotations.
~TitleWidget()
Deletes stuff!
void removeSelectedPhotoDesc()
Strip descriptions from selected photos.
void helpClosed()
Frees HelpWindow once closed.
QLineEdit * subalbumDescriptionVal
Definition: titleWidget.h:262
int EXPORT_SMALL_WEB_GALLERY
Definition: titleWidget.h:294
ALabel * albumImage
Definition: titleWidget.h:247
QString tmpDirErrorMessage
error message and description when temp directory cannot be created
Definition: titleWidget.h:309
Q3PopupMenu * helpMenu
Window menu, only used in OSX.
Definition: titleWidget.h:238
void updateMenus(bool anySelected=false, bool anyRevertable=false)
update begin presentation menu entry - disabled when no photos in album
About * about
About dialog pointer.
Definition: titleWidget.h:277
void setAlbumImage()
Sets the Album Image.
int SAVEAS_ALBUM
Definition: titleWidget.h:292
void settings()
Pops up settings window.
int EXPORT_LARGE_IMAGES
Definition: titleWidget.h:295
void exportSmallWebGallery()
Export small web gallery (excludes full size images and Album.xml file)
QLabel * albumName
Definition: titleWidget.h:248
Q3Frame * mainFrame
Definition: titleWidget.h:242
bool getBusy()
is program busy?
void setSubalbumImage()
Sets the Subalbum Image.
Q3GridLayout * subalbumAnnotationGrid
Subalbum annotation grid.
Definition: titleWidget.h:256
Q3GridLayout * albumAnnotationGrid
Album annotation grid.
Definition: titleWidget.h:245
QLabel * subalbumDescription
Definition: titleWidget.h:261
void dragEnterEvent(QDragEnterEvent *e)
QLineEdit * albumNameVal
Definition: titleWidget.h:249
void help()
Pops up HelpWindow.
ALabel * subalbumImage
Definition: titleWidget.h:258
void setAlbum(Album *val)
Sets new pointer to the album object.
void unsetSubalbumImage()
Unsets the Subalbum Image.
void saveAlbum()
Saves album.
void populateOpenRecentMenu()
Populates the open recent menu with a default set of 9 items + clear.
RecentAlbums recentAlbums
Definition: titleWidget.h:312
int REVERT_TO_SAVED_ALBUM
Definition: titleWidget.h:293
void loadAlbum()
Loads an album specified with file chooser.
AlbumStatistics * albumStats
Album Statistics dialog pointer.
Definition: titleWidget.h:271
QMenuBar * menu
Menubar file menu and help menu inserted in.
Definition: titleWidget.h:212
QLabel * albumAuthor
Definition: titleWidget.h:252
void refresh()
Refreshs data from backend objects.
QLineEdit * subalbumNameVal
Definition: titleWidget.h:260
void newAlbum()
Resets to empty album.
void saveAsAlbum()
Saves album as.
ConfigurationWidget * settingsWindow
Settings dialog pointer.
Definition: titleWidget.h:274
void refreshCollectionAnnotations(Subalbum *collection)
Update displayed collection name and cover image.
bool busy
Is the program currently busy? helps block other operations.
Definition: titleWidget.h:283
Album * albm
Backend album object.
Definition: titleWidget.h:265
int * recentMenuItems
Definition: titleWidget.h:219
Q3PopupMenu * openRecent
Open recent submenu.
Definition: titleWidget.h:218
Q3GridLayout * mainGrid
Main grid.
Definition: titleWidget.h:241
Q3PopupMenu * photoMenu
Photos menu.
Definition: titleWidget.h:225
RecentAlbumMenuItem ** customRecentMenuItems
Definition: titleWidget.h:221
void useAnimation(bool val)
Use animation for rep images?
Top level widget, encapsulates the title widget, the layout widget, and the toolbar widget.
Definition: window.h:40
#define ABOUT
Definition: titleWidget.h:44