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 //-------------------- 00035 00036 #define ABOUT 0 00037 #define UPDATES 1 00038 #define UPCOMING 2 00039 00040 #include <qframe.h> 00041 #include "../backend/recentAlbums.h" 00042 00043 //===================================== 00047 //===================================== 00048 class TitleWidget : public QFrame 00049 { 00050 Q_OBJECT 00051 00052 public: 00054 TitleWidget(QWidget *parent=0, const char* name=0); 00055 00057 ~TitleWidget(); 00058 00060 void useAnimation(bool val); 00061 00063 void setAlbum( Album* val); 00064 00066 Album* getAlbum(); 00067 00069 void refresh(); 00070 00072 bool getBusy(); 00073 00075 void setBusy(bool val); 00076 00078 RecentAlbums* getRecentAlbums(); 00079 //---------------------- 00080 protected: 00081 void dragEnterEvent( QDragEnterEvent* e); 00082 void dropEvent( QDropEvent* e); 00083 00084 //create and return path to temporary directory for an album, 00085 //if no string is provided temporary directory is created 00086 //using user prefernce for default temporary directories 00087 QString createTmpDir(QString albumPath = QString::null ); 00088 //---------------------- 00089 signals: 00091 void subalbumNameChanged(); 00092 //---------------------- 00093 public slots: 00095 void albumStatisticsClosed(); 00096 00098 void aboutClosed(); 00099 00101 void helpClosed(); 00102 00104 void quitApplication(); 00105 00106 //Settings closed 00107 void settingsWindowClosed(); 00108 00110 void updateAlbumAnnotations(); 00111 00113 void refreshCollectionAnnotations(Subalbum* collection); 00114 00116 void setAlbumImage(Photo* photo); 00117 00119 void setSubalbumImage(Photo* photo); 00120 00122 void aboutProgram(int mode = ABOUT); 00123 00125 void help(); 00126 00128 void windowStateChanged(bool state); 00129 00131 void updateMenus(bool anySelected=false, bool anyRevertable=false); 00132 //---------------------- 00133 private slots: 00135 void storeAnnotations(); 00136 00138 void setAlbumImage(); 00139 00141 void unsetAlbumImage(); 00142 00144 void setSubalbumImage(); 00145 00147 void unsetSubalbumImage(); 00148 00150 void newAlbum(); 00151 //---------------------------- 00153 void loadAlbum(); 00154 00156 void loadRecentAlbum(int index); 00157 00161 bool proceedWithLoad(); 00162 00164 void loadAlbum(QString location); 00165 //---------------------------- 00167 void saveAlbum(); 00168 00170 void saveAsAlbum(); 00171 00173 void revertToSaved(); 00174 00176 void exportSmallWebGallery(); 00177 00179 void exportLargeImages(); 00180 00182 void settings(); 00183 00185 void removeSelectedPhotoDesc(); 00186 00188 void revertPhotos(); 00189 00191 void albumStatistics(); 00192 00194 void clearOpenRecentMenu(); 00195 //---------------------- 00196 private: 00198 void refreshOpenRecentMenu(); 00199 00201 QMenuBar* menu; 00202 00204 QPopupMenu* file; 00205 00207 QPopupMenu* openRecent; 00208 00210 QPopupMenu* photoMenu; 00211 00213 QPopupMenu* tools; 00214 00215 //PLATFORM_SPECIFIC_CODE 00217 #if defined(Q_OS_MACX) 00218 QPopupMenu* windowMenu; 00219 int WINDOW_MINIMIZE; 00220 #endif 00221 00223 QPopupMenu* helpMenu; 00224 00226 QGridLayout* mainGrid; 00227 QFrame* mainFrame; 00228 00230 QGridLayout* albumAnnotationGrid; 00231 QFrame* albumAnnotationFrame; 00232 ALabel* albumImage; 00233 QLabel* albumName; 00234 QLineEdit* albumNameVal; 00235 QLabel* albumDescription; 00236 QLineEdit* albumDescriptionVal; 00237 QLabel* albumAuthor; 00238 QLineEdit* albumAuthorVal; 00239 00241 QGridLayout* subalbumAnnotationGrid; 00242 QFrame* subalbumAnnotationFrame; 00243 ALabel* subalbumImage; 00244 QLabel* subalbumName; 00245 QLineEdit* subalbumNameVal; 00246 QLabel* subalbumDescription; 00247 QLineEdit* subalbumDescriptionVal; 00248 00250 Album* albm; 00251 00253 Window* window; 00254 00256 AlbumStatistics* albumStats; 00257 00259 ConfigurationWidget* settingsWindow; 00260 00262 About* about; 00263 00265 HelpWindow* helpWindow; 00266 00268 bool busy; 00269 00270 //modification detection enabled/disabled 00271 bool detectModifications; 00272 00273 //file menu item id's 00274 int NEW_ALBUM; 00275 int OPEN_ALBUM; 00276 int SAVE_ALBUM; 00277 int SAVEAS_ALBUM; 00278 int REVERT_TO_SAVED_ALBUM; 00279 int EXPORT_SMALL_WEB_GALLERY; 00280 int EXPORT_LARGE_IMAGES; 00281 00283 int REMOVE_DESCRIPTIONS; 00284 int REVERT_PHOTOS; 00285 00287 int BEGIN_PRESENTATION; 00288 int BEGIN_PRESENTATION_AT; 00289 00291 bool cacheSetButtonState; 00292 00294 QString tmpDirErrorMessage, tmpDirErrorDesc; 00295 00296 //recent albums object 00297 RecentAlbums recentAlbums; 00298 //---------------------- 00299 }; 00300 //====================== 00301 00302 #endif //GUI_TITLEWIDGET_H