1 #ifndef OPT_ICONSET_H 2 #define OPT_ICONSET_H 3 4 #include "optionstab.h" 5 #include <QEvent> 6 7 class QWidget; 8 class QListWidgetItem; 9 class IconsetLoadThread; 10 class QTreeWidgetItem; 11 12 class OptionsTabIconsetSystem : public OptionsTab 13 { 14 Q_OBJECT 15 public: 16 OptionsTabIconsetSystem(QObject *parent); 17 ~OptionsTabIconsetSystem(); 18 19 QWidget *widget(); 20 void applyOptions(); 21 void restoreOptions(); stretchable()22 bool stretchable() const { return true; } 23 24 private slots: 25 void setData(PsiCon *, QWidget *); 26 void previewIconset(); 27 28 protected: 29 bool event(QEvent *); 30 void cancelThread(); 31 32 private: 33 QWidget *w, *parentWidget; 34 PsiCon *psi; 35 36 int numIconsets, iconsetsLoaded; 37 IconsetLoadThread *thread; 38 }; 39 40 class OptionsTabIconsetEmoticons : public OptionsTab 41 { 42 Q_OBJECT 43 public: 44 OptionsTabIconsetEmoticons(QObject *parent); 45 ~OptionsTabIconsetEmoticons(); 46 47 QWidget *widget(); 48 void applyOptions(); 49 void restoreOptions(); stretchable()50 bool stretchable() const { return true; } 51 52 private slots: 53 void setData(PsiCon *, QWidget *); 54 void previewIconset(); 55 56 protected: 57 bool event(QEvent *); 58 void cancelThread(); 59 60 private: 61 QWidget *w, *parentWidget; 62 PsiCon *psi; 63 64 int numIconsets, iconsetsLoaded; 65 IconsetLoadThread *thread; 66 }; 67 68 class OptionsTabIconsetMoods : public OptionsTab 69 { 70 Q_OBJECT 71 public: 72 OptionsTabIconsetMoods(QObject *parent); 73 ~OptionsTabIconsetMoods(); 74 75 QWidget *widget(); 76 void applyOptions(); 77 void restoreOptions(); stretchable()78 bool stretchable() const { return true; } 79 80 private slots: 81 void setData(PsiCon *, QWidget *); 82 void previewIconset(); 83 84 protected: 85 bool event(QEvent *); 86 void cancelThread(); 87 88 private: 89 QWidget *w, *parentWidget; 90 PsiCon *psi; 91 92 int numIconsets, iconsetsLoaded; 93 IconsetLoadThread *thread; 94 }; 95 96 class OptionsTabIconsetActivity : public OptionsTab 97 { 98 Q_OBJECT 99 public: 100 OptionsTabIconsetActivity(QObject *parent); 101 ~OptionsTabIconsetActivity(); 102 103 QWidget *widget(); 104 void applyOptions(); 105 void restoreOptions(); stretchable()106 bool stretchable() const { return true; } 107 108 private slots: 109 void setData(PsiCon *, QWidget *); 110 void previewIconset(); 111 112 protected: 113 bool event(QEvent *); 114 void cancelThread(); 115 116 private: 117 QWidget *w, *parentWidget; 118 PsiCon *psi; 119 120 int numIconsets, iconsetsLoaded; 121 IconsetLoadThread *thread; 122 }; 123 124 class OptionsTabIconsetClients : public OptionsTab 125 { 126 Q_OBJECT 127 public: 128 OptionsTabIconsetClients(QObject *parent); 129 ~OptionsTabIconsetClients(); 130 131 QWidget *widget(); 132 void applyOptions(); 133 void restoreOptions(); stretchable()134 bool stretchable() const { return true; } 135 136 private slots: 137 void setData(PsiCon *, QWidget *); 138 void previewIconset(); 139 140 protected: 141 bool event(QEvent *); 142 void cancelThread(); 143 144 private: 145 QWidget *w, *parentWidget; 146 PsiCon *psi; 147 148 int numIconsets, iconsetsLoaded; 149 IconsetLoadThread *thread; 150 }; 151 152 class OptionsTabIconsetAffiliations : public OptionsTab 153 { 154 Q_OBJECT 155 public: 156 OptionsTabIconsetAffiliations(QObject *parent); 157 ~OptionsTabIconsetAffiliations(); 158 159 QWidget *widget(); 160 void applyOptions(); 161 void restoreOptions(); stretchable()162 bool stretchable() const { return true; } 163 164 private slots: 165 void setData(PsiCon *, QWidget *); 166 void previewIconset(); 167 168 protected: 169 bool event(QEvent *); 170 void cancelThread(); 171 172 private: 173 QWidget *w, *parentWidget; 174 PsiCon *psi; 175 176 int numIconsets, iconsetsLoaded; 177 IconsetLoadThread *thread; 178 }; 179 180 class OptionsTabIconsetRoster : public OptionsTab 181 { 182 Q_OBJECT 183 public: 184 OptionsTabIconsetRoster(QObject *parent); 185 ~OptionsTabIconsetRoster(); 186 187 QWidget *widget(); 188 void applyOptions(); 189 void restoreOptions(); stretchable()190 bool stretchable() const { return true; } 191 192 private slots: 193 void setData(PsiCon *, QWidget *); 194 195 void defaultDetails(); 196 void servicesDetails(); 197 void customDetails(); 198 199 void isServices_iconsetSelected(QListWidgetItem *current, QListWidgetItem *previous); 200 void isServices_selectionChanged(QTreeWidgetItem *); 201 202 void isCustom_iconsetSelected(QListWidgetItem *current, QListWidgetItem *previous); 203 void isCustom_selectionChanged(QTreeWidgetItem *); 204 void isCustom_textChanged(); 205 void isCustom_add(); 206 void isCustom_delete(); 207 QString clipCustomText(QString); 208 209 protected: 210 bool event(QEvent *); 211 void cancelThread(); 212 213 private: 214 QWidget* w; 215 QWidget* parentWidget; 216 PsiCon *psi; 217 int numIconsets, iconsetsLoaded; 218 IconsetLoadThread *thread; 219 220 enum { 221 IconsetRole = Qt::UserRole + 0, 222 ServiceRole = Qt::UserRole + 1, 223 RegexpRole = Qt::UserRole + 2 224 }; 225 226 void addService(const QString& id, const QString& name); 227 }; 228 229 #endif 230