00001 //============================================== 00002 // copyright : (C) 2003 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 // As a special exception, Will Stokes gives permission to 00011 // link this program with Qt non-commercial edition, and 00012 // distribute the resulting executable, without including the 00013 // source code for the Qt non-commercial edition in the 00014 // source distribution. 00015 //============================================== 00016 00017 #ifndef GUI_TITLEWIDGET_H 00018 #define GUI_TITLEWIDGET_H 00019 00020 //-------------------- 00021 //forward declarations 00022 class QMenuBar; 00023 class QPopupMenu; 00024 class QGridLayout; 00025 class QLabel; 00026 class QLineEdit; 00027 class QPixmap; 00028 class QPushButton; 00029 class Album; 00030 class Window; 00031 class About; 00032 //-------------------- 00033 00034 #include <qframe.h> 00035 00036 //===================================== 00040 //===================================== 00041 class TitleWidget : public QFrame 00042 { 00043 Q_OBJECT 00044 00045 public: 00047 TitleWidget(QWidget *parent=0, const char* name=0); 00048 00050 ~TitleWidget(); 00051 00053 void setAlbum( Album* val); 00054 00056 Album* getAlbum(); 00057 00059 void refresh(); 00060 00062 void setSetButtonState(bool state); 00063 00065 bool getBusy(); 00066 00068 void setBusy(bool val); 00069 //---------------------- 00070 public slots: 00072 void aboutClosed(); 00073 //---------------------- 00074 private slots: 00076 void updateName( const QString& val ); 00077 00079 void updateDescription( const QString& val ); 00080 00082 void updateAuthor( const QString& val ); 00083 00085 void setImageAction(); 00086 00088 void newAlbum(); 00089 00091 void loadAlbum(); 00092 00094 void saveAlbum(); 00095 00097 void saveAsAlbum(); 00098 00100 void aboutProgram(); 00101 //---------------------- 00102 private: 00104 QMenuBar* menu; 00105 00107 QPopupMenu* file; 00108 00110 QPopupMenu* help; 00111 00113 QGridLayout* grid; 00114 00116 QLabel* albumName; 00117 00119 QLineEdit* albumNameVal; 00120 00122 QLabel* albumDescription; 00123 00125 QLineEdit* albumDescriptionVal; 00126 00128 QLabel* albumAuthor; 00129 00131 QLineEdit* albumAuthorVal; 00132 00134 QLabel* representativeImageText; 00135 00137 QPixmap* setImageImage; 00138 00140 QPushButton* setImage; 00141 00143 QLabel* representativeLogo; 00144 00146 QPixmap* representativeImage; 00147 00149 QPixmap* albumShaperImage; 00150 00152 QLabel* albumShaperLogo; 00153 00155 QFrame* line; 00156 00158 Album* albm; 00159 00161 Window* window; 00162 00164 About* about; 00165 00167 bool busy; 00168 00169 //file menu item id's 00170 int NEW_ALBUM; 00171 int OPEN_ALBUM; 00172 int SAVE_ALBUM; 00173 int SAVEAS_ALBUM; 00174 00175 //cached set button state 00176 bool cacheSetButtonState; 00177 00178 //---------------------- 00179 }; 00180 //====================== 00181 00182 #endif //GUI_TITLEWIDGET_H