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_SUBALBUMWIDGET_H 00018 #define GUI_SUBALBUMWIDGET_H 00019 00020 //-------------------- 00021 //forward declarations 00022 class QGridLayout; 00023 class QLabel; 00024 class QLineEdit; 00025 class QPixmap; 00026 class QIconView; 00027 class PhotosIconView; 00028 class QPushButton; 00029 class QFrame; 00030 class Subalbum; 00031 class LayoutWidget; 00032 class Photo; 00033 00034 class QIconViewItem; 00035 //-------------------- 00036 00037 #include <qwidget.h> 00038 00039 //===================================== 00042 //===================================== 00043 class SubalbumWidget : public QWidget 00044 { 00045 Q_OBJECT 00046 00047 public: 00049 SubalbumWidget(Subalbum* salbum, 00050 QWidget *parent=0, 00051 const char* name=0); 00052 00054 ~SubalbumWidget(); 00055 00057 void setSubalbum(Subalbum* salbum); 00058 00060 void refreshPhotos(); 00061 00063 void refreshSelectedPhotos(); 00064 00066 void syncPhotos(); 00067 00069 Subalbum* getSubalbum(); 00070 00072 Photo* getSelectedPhoto(); 00073 00075 QIconView* getPhotos(); 00076 00078 void updateButtons(bool enable); 00079 //---------------------- 00080 private slots: 00082 void updateName( const QString& val ); 00083 00085 void updateDescription( const QString& val ); 00086 00088 void setImageAction(); 00089 00091 void updateButtons(); 00092 00094 void addImageAction(); 00095 00097 void removeImageAction(); 00098 00100 void rotate90ImageAction(); 00101 00103 void rotate270ImageAction(); 00104 00106 void flipHorizontallyImageAction(); 00107 00109 void flipVerticallyImageAction(); 00110 00112 void editAction(); 00113 00115 void rearrangeAndSaveCurrent( QIconViewItem* item); 00116 00117 //Rearranges subalbums in grid 00118 void reorder(); 00119 //---------------------- 00120 protected: 00121 void resizeEvent( QResizeEvent * ); 00122 //---------------------- 00123 private: 00125 QGridLayout* grid; 00126 00128 QFrame* buttons; 00129 00130 QGridLayout* grid2; 00131 00133 QLabel* subalbumName; 00134 00136 QLineEdit* subalbumNameVal; 00137 00139 QLabel* subalbumDescription; 00140 00142 QLineEdit* subalbumDescriptionVal; 00143 00145 QLabel* representativeImageText; 00146 00148 QPixmap* setImageImage; 00149 00151 QPushButton* setImage; 00152 00154 QLabel* representativeLogo; 00155 00157 QPixmap* representativeImage; 00158 00160 PhotosIconView* photos; 00161 00163 Subalbum* subalbum; 00164 00166 QPixmap* addImageImage; 00167 00169 QPushButton* addImage; 00170 00172 QPixmap* removeImageImage; 00173 00175 QPushButton* removeImage; 00176 00178 QPixmap* rotate90ImageImage; 00179 00181 QPushButton* rotate90Image; 00182 00184 QPixmap* rotate270ImageImage; 00185 00187 QPushButton* rotate270Image; 00188 00190 QPixmap* flipHorizontallyImageImage; 00191 00193 QPushButton* flipHorizontallyImage; 00194 00196 QPixmap* flipVerticallyImageImage; 00197 00199 QPushButton* flipVerticallyImage; 00200 00202 QPixmap* editImage; 00203 00205 QPushButton* editButton; 00206 00208 LayoutWidget* layout; 00209 00211 bool buttonsState; 00212 //---------------------- 00213 }; 00214 //====================== 00215 00216 #endif //GUI_SUBALBUMWIDGET_H