AlbumShaper
1.0a3
|
00001 //============================================== 00002 // copyright : (C) 2003-2005 by Will Stokes 00003 //============================================== 00004 // This program is free software; you can redistribute it 00005 // and/or modify it under the terms of the GNU General 00006 // Public License as published by the Free Software 00007 // Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 //============================================== 00010 00011 #ifndef GUI_TITLEWIDGET_H 00012 #define GUI_TITLEWIDGET_H 00013 00014 //-------------------- 00015 //forward declarations 00016 class QMenuBar; 00017 class QPopupMenu; 00018 class QGridLayout; 00019 class QLabel; 00020 class QLineEdit; 00021 class QPixmap; 00022 class QToolButton; 00023 class Album; 00024 class Subalbum; 00025 class Window; 00026 class AlbumStatistics; 00027 class ConfigurationWidget; 00028 class About; 00029 class HelpWindow; 00030 class Shortcuts; 00031 class ALabel; 00032 class QIconViewItem; 00033 class Photo; 00034 class RecentAlbumMenuItem; 00035 //-------------------- 00036 00037 #define ABOUT 0 00038 #define UPDATES 1 00039 #define UPCOMING 2 00040 00041 #include <qframe.h> 00042 #include "../backend/recentAlbums.h" 00043 00044 //===================================== 00048 //===================================== 00049 class TitleWidget : public QFrame 00050 { 00051 Q_OBJECT 00052 00053 public: 00055 TitleWidget(QWidget *parent=0, const char* name=0); 00056 00058 ~TitleWidget(); 00059 00061 void useAnimation(bool val); 00062 00064 void setAlbum( Album* val); 00065 00067 Album* getAlbum(); 00068 00070 void refresh(); 00071 00073 bool getBusy(); 00074 00076 void setBusy(bool val); 00077 00079 RecentAlbums* getRecentAlbums(); 00080 //---------------------- 00081 protected: 00082 void dragEnterEvent( QDragEnterEvent* e); 00083 void dropEvent( QDropEvent* e); 00084 00085 //create and return path to temporary directory for an album, 00086 //if no string is provided temporary directory is created 00087 //using user prefernce for default temporary directories 00088 QString createTmpDir(QString albumPath = QString::null ); 00089 //---------------------- 00090 signals: 00092 void subalbumNameChanged(); 00093 //---------------------- 00094 public slots: 00096 void albumStatisticsClosed(); 00097 00099 void aboutClosed(); 00100 00102 void helpClosed(); 00103 00105 void quitApplication(); 00106 00107 //Settings closed 00108 void settingsWindowClosed(); 00109 00111 void updateAlbumAnnotations(); 00112 00114 void refreshCollectionAnnotations(Subalbum* collection); 00115 00117 void setAlbumImage(Photo* photo); 00118 00120 void setSubalbumImage(Photo* photo); 00121 00123 void aboutProgram(int mode = ABOUT); 00124 00126 void help(); 00127 00129 void windowStateChanged(bool state); 00130 00132 void updateMenus(bool anySelected=false, bool anyRevertable=false); 00133 //---------------------- 00134 private slots: 00136 void storeAnnotations(); 00137 00139 void setAlbumImage(); 00140 00142 void unsetAlbumImage(); 00143 00145 void setSubalbumImage(); 00146 00148 void unsetSubalbumImage(); 00149 00151 void newAlbum(); 00152 //---------------------------- 00154 void loadAlbum(); 00155 00157 void loadRecentAlbum(int index); 00158 00162 bool proceedWithLoad(); 00163 00165 void loadAlbum(QString location); 00166 //---------------------------- 00168 void saveAlbum(); 00169 00171 void saveAsAlbum(); 00172 00174 void revertToSaved(); 00175 00177 void exportSmallWebGallery(); 00178 00180 void exportLargeImages(); 00181 00183 void settings(); 00184 00186 void removeSelectedPhotoDesc(); 00187 00189 void revertPhotos(); 00190 00192 void albumStatistics(); 00193 00195 void clearOpenRecentMenu(); 00196 //---------------------- 00197 private: 00199 void populateOpenRecentMenu(); 00200 00202 void refreshOpenRecentMenu(); 00203 00205 QMenuBar* menu; 00206 00208 QPopupMenu* file; 00209 00211 QPopupMenu* openRecent; 00212 int* recentMenuItems; 00213 int numRecentMenuItems; 00214 RecentAlbumMenuItem** customRecentMenuItems; 00215 00216 00218 QPopupMenu* photoMenu; 00219 00221 QPopupMenu* tools; 00222 00223 //PLATFORM_SPECIFIC_CODE 00225 #if defined(Q_OS_MACX) 00226 QPopupMenu* windowMenu; 00227 int WINDOW_MINIMIZE; 00228 #endif 00229 00231 QPopupMenu* helpMenu; 00232 00234 QGridLayout* mainGrid; 00235 QFrame* mainFrame; 00236 00238 QGridLayout* albumAnnotationGrid; 00239 QFrame* albumAnnotationFrame; 00240 ALabel* albumImage; 00241 QLabel* albumName; 00242 QLineEdit* albumNameVal; 00243 QLabel* albumDescription; 00244 QLineEdit* albumDescriptionVal; 00245 QLabel* albumAuthor; 00246 QLineEdit* albumAuthorVal; 00247 00249 QGridLayout* subalbumAnnotationGrid; 00250 QFrame* subalbumAnnotationFrame; 00251 ALabel* subalbumImage; 00252 QLabel* subalbumName; 00253 QLineEdit* subalbumNameVal; 00254 QLabel* subalbumDescription; 00255 QLineEdit* subalbumDescriptionVal; 00256 00258 Album* albm; 00259 00261 Window* window; 00262 00264 AlbumStatistics* albumStats; 00265 00267 ConfigurationWidget* settingsWindow; 00268 00270 About* about; 00271 00273 HelpWindow* helpWindow; 00274 00276 bool busy; 00277 00278 //modification detection enabled/disabled 00279 bool detectModifications; 00280 00281 //file menu item id's 00282 int NEW_ALBUM; 00283 int OPEN_ALBUM; 00284 int SAVE_ALBUM; 00285 int SAVEAS_ALBUM; 00286 int REVERT_TO_SAVED_ALBUM; 00287 int EXPORT_SMALL_WEB_GALLERY; 00288 int EXPORT_LARGE_IMAGES; 00289 00291 int REMOVE_DESCRIPTIONS; 00292 int REVERT_PHOTOS; 00293 00295 int BEGIN_PRESENTATION; 00296 int BEGIN_PRESENTATION_AT; 00297 00299 bool cacheSetButtonState; 00300 00302 QString tmpDirErrorMessage, tmpDirErrorDesc; 00303 00304 //recent albums object 00305 RecentAlbums recentAlbums; 00306 //---------------------- 00307 }; 00308 //====================== 00309 00310 #endif //GUI_TITLEWIDGET_H