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:
99  void subalbumNameChanged();
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
int numRecentMenuItems
Definition: titleWidget.h:220
void albumStatistics()
Pops up album statistics window.
QLineEdit * albumNameVal
Definition: titleWidget.h:249
QLabel * albumName
Definition: titleWidget.h:248
#define ABOUT
Definition: titleWidget.h:44
Q3Frame * subalbumAnnotationFrame
Definition: titleWidget.h:257
Q3PopupMenu * file
File menu.
Definition: titleWidget.h:215
int EXPORT_SMALL_WEB_GALLERY
Definition: titleWidget.h:294
Q3PopupMenu * openRecent
Open recent submenu.
Definition: titleWidget.h:218
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image...
Definition: photo.h:44
void refreshCollectionAnnotations(Subalbum *collection)
Update displayed collection name and cover image.
RecentAlbumMenuItem ** customRecentMenuItems
Definition: titleWidget.h:221
void dragEnterEvent(QDragEnterEvent *e)
int BEGIN_PRESENTATION
tools menu item id&#39;s
Definition: titleWidget.h:302
Help window widget.
Definition: helpWindow.h:28
QLineEdit * albumAuthorVal
Definition: titleWidget.h:253
void saveAlbum()
Saves album.
void newAlbum()
Resets to empty album.
Window * window
Window pointer.
Definition: titleWidget.h:268
void dropEvent(QDropEvent *e)
void unsetAlbumImage()
Unsets the Album Image.
Top level widget, encapsulates the title widget, the layout widget, and the toolbar widget...
Definition: window.h:39
void updateMenus(bool anySelected=false, bool anyRevertable=false)
update begin presentation menu entry - disabled when no photos in album
Q3Frame * albumAnnotationFrame
Definition: titleWidget.h:246
void unsetSubalbumImage()
Unsets the Subalbum Image.
void quitApplication()
Quit slot.
void aboutProgram(int mode=ABOUT)
Pops up about dialog.
ALabel * subalbumImage
Definition: titleWidget.h:258
A custom menu entry, displays album image, name, and number of photos.
QLineEdit * subalbumNameVal
Definition: titleWidget.h:260
void subalbumNameChanged()
Emitted when user changes subalbum name.
void settingsWindowClosed()
void setBusy(bool val)
set program busy state
ALabel * albumImage
Definition: titleWidget.h:247
void setAlbumImage()
Sets the Album Image.
bool busy
Is the program currently busy? helps block other operations.
Definition: titleWidget.h:283
int * recentMenuItems
Definition: titleWidget.h:219
void saveAsAlbum()
Saves album as.
Album Statistics Window.
Q3GridLayout * subalbumAnnotationGrid
Subalbum annotation grid.
Definition: titleWidget.h:256
AlbumStatistics * albumStats
Album Statistics dialog pointer.
Definition: titleWidget.h:271
Q3Frame * mainFrame
Definition: titleWidget.h:242
void refreshOpenRecentMenu()
Refreshes open recent menu.
void storeAnnotations()
Store annotations.
void removeSelectedPhotoDesc()
Strip descriptions from selected photos.
bool getBusy()
is program busy?
void revertPhotos()
Revert selected photos to original form.
QLabel * albumDescription
Definition: titleWidget.h:250
void setSubalbumImage()
Sets the Subalbum Image.
Definition: ALabel.h:41
QString tmpDirErrorDesc
Definition: titleWidget.h:309
About window widget.
Definition: about.h:38
A subalbum contains photos.
Definition: subalbum.h:48
Shortcuts window widget.
QLabel * albumAuthor
Definition: titleWidget.h:252
About * about
About dialog pointer.
Definition: titleWidget.h:277
void useAnimation(bool val)
Use animation for rep images?
void loadAlbum()
Loads an album specified with file chooser.
void albumStatisticsClosed()
Frees album statistics dialog once closed.
This class maintains and handles saving and loading a list of recently viewed albums.
Definition: recentAlbums.h:26
int BEGIN_PRESENTATION_AT
Definition: titleWidget.h:303
QLabel * subalbumName
Definition: titleWidget.h:259
int REVERT_TO_SAVED_ALBUM
Definition: titleWidget.h:293
void setAlbum(Album *val)
Sets new pointer to the album object.
bool proceedWithLoad()
Helper function for load methods, checks if there are any unsaved changes and if so warns user any su...
void loadRecentAlbum(int index)
Loads a recent album.
void settings()
Pops up settings window.
QMenuBar * menu
Menubar file menu and help menu inserted in.
Definition: titleWidget.h:212
void exportSmallWebGallery()
Export small web gallery (excludes full size images and Album.xml file)
Album * albm
Backend album object.
Definition: titleWidget.h:265
QLineEdit * albumDescriptionVal
Definition: titleWidget.h:251
QString createTmpDir(QString albumPath=QString::null)
TitleWidget(QWidget *parent=0, const char *name=0)
Creates layout.
Definition: titleWidget.cpp:68
RecentAlbums recentAlbums
Definition: titleWidget.h:312
void exportLargeImages()
Export large images only to a new directory for printing purposes.
Q3PopupMenu * tools
Tools menu.
Definition: titleWidget.h:228
void clearOpenRecentMenu()
Clears albums from open recent menu.
void help()
Pops up HelpWindow.
Q3PopupMenu * helpMenu
Window menu, only used in OSX.
Definition: titleWidget.h:238
Widget which displays album name, description, representative image, and album shaper logo...
Definition: titleWidget.h:56
Q3GridLayout * mainGrid
Main grid.
Definition: titleWidget.h:241
An album contains Subalbums.
Definition: album.h:52
bool detectModifications
Definition: titleWidget.h:286
Q3GridLayout * albumAnnotationGrid
Album annotation grid.
Definition: titleWidget.h:245
QString tmpDirErrorMessage
error message and description when temp directory cannot be created
Definition: titleWidget.h:309
void revertToSaved()
Revert to last saved album.
Configuration/Settings Interface.
ConfigurationWidget * settingsWindow
Settings dialog pointer.
Definition: titleWidget.h:274
int REVERT_PHOTOS
Definition: titleWidget.h:299
int SAVEAS_ALBUM
Definition: titleWidget.h:292
QLineEdit * subalbumDescriptionVal
Definition: titleWidget.h:262
Q3PopupMenu * photoMenu
Photos menu.
Definition: titleWidget.h:225
Album * getAlbum()
Returns a pointer to the album object.
RecentAlbums * getRecentAlbums()
returns handle to recent albums object
int EXPORT_LARGE_IMAGES
Definition: titleWidget.h:295
QLabel * subalbumDescription
Definition: titleWidget.h:261
~TitleWidget()
Deletes stuff!
void populateOpenRecentMenu()
Populates the open recent menu with a default set of 9 items + clear.
bool cacheSetButtonState
cached set button state
Definition: titleWidget.h:306
void refresh()
Refreshs data from backend objects.
void windowStateChanged(bool state)
Enables/disables "minimize" window menu entry depending on window state.
HelpWindow * helpWindow
HelpWindow pointer.
Definition: titleWidget.h:280
int REMOVE_DESCRIPTIONS
photos menu item id&#39;s
Definition: titleWidget.h:298
void aboutClosed()
Frees about dialog once closed.
void helpClosed()
Frees HelpWindow once closed.
void updateAlbumAnnotations()
Updates subalbum annotations.