kmail

kmfolderdia.h
1 
31 #ifndef __KMFOLDERDIA
32 #define __KMFOLDERDIA
33 
34 #include <kdialogbase.h>
35 #include "configuredialog_p.h"
36 #include <tqvaluevector.h>
37 
38 class TQCheckBox;
39 class TQPushButton;
40 class TQLineEdit;
41 class TQListBox;
42 class TQComboBox;
43 class KMFolder;
44 class KMFolderTreeItem;
45 class KMFolderDir;
46 class KIntNumInput;
47 class TDEIconButton;
48 class KEditListBox;
49 namespace KPIM { class IdentityCombo; }
50 class KMFolderDialog;
51 class KMFolderTree;
52 template <typename T> class TQGuardedPtr;
53 class TemplatesConfiguration;
54 class KPushButton;
55 
56 namespace KMail {
57  class FolderRequester;
69 class FolderDiaTab : public TQWidget
70 {
71  TQ_OBJECT
72 
73 public:
74  FolderDiaTab( TQWidget *parent=0, const char* name=0 )
75  : TQWidget( parent, name ) {}
76 
77  virtual void load() = 0;
78 
83  virtual bool save() = 0;
84 
85  enum AccepStatus { Accepted, Canceled, Delayed };
90  virtual AccepStatus accept() {
91  return save() ? Accepted : Canceled;
92  }
93 
94 signals:
98 
101  void cancelAccept();
102 
104  void changed(bool);
105 };
106 
112 {
113  TQ_OBJECT
114 
115 
116 public:
118  const TQString& aName,
119  TQWidget* parent, const char* name = 0 );
120 
121  virtual void load();
122  virtual bool save();
123 
124 private slots:
125  void slotChangeIcon( TQString icon );
126  /*
127  * is called if the folder dropdown changes
128  * then we update the other items to reflect the capabilities
129  */
130  void slotFolderNameChanged( const TQString& );
131  void slotFolderContentsSelectionChanged( int );
132 
133 private:
134  void initializeWithValuesFromFolder( KMFolder* folder );
135 
136 private:
137  TQComboBox *mShowSenderReceiverComboBox;
138  TQComboBox *mContentsComboBox;
139  TQComboBox *mIncidencesForComboBox;
140  TQCheckBox *mAlarmsBlockedCheckBox;
141  TQCheckBox *mSharedSeenFlagsCheckBox;
142  TQLabel *mNormalIconLabel;
143  TDEIconButton *mNormalIconButton;
144  TQLabel *mUnreadIconLabel;
145  TDEIconButton *mUnreadIconButton;
146  TQCheckBox *mIconsCheckBox;
147  TQCheckBox *mNewMailCheckBox;
148  TQCheckBox *mNotifyOnNewMailCheckBox;
149  TQCheckBox *mKeepRepliesInSameFolderCheckBox;
150  KLineEdit *mNameEdit;
151 
152  KPIM::IdentityCombo *mIdentityComboBox;
153 
154  KMFolderDialog* mDlg;
155  bool mIsLocalSystemFolder;
156  bool mIsResourceFolder;
157 };
158 
164 {
165  TQ_OBJECT
166 
167 
168 public:
169  FolderDiaTemplatesTab( KMFolderDialog *dlg, TQWidget *parent );
170 
171  virtual void load();
172  virtual bool save();
173 
174 public slots:
175  void slotEmitChanged(); // do nothing for now
176 
177  void slotCopyGlobal();
178 
179 private:
180  void initializeWithValuesFromFolder( KMFolder* folder );
181 
182 private:
183  TQCheckBox* mCustom;
184  TemplatesConfiguration* mWidget;
185  KPushButton* mCopyGlobal;
186  KMFolder* mFolder;
187  uint mIdentity;
188 
189  KMFolderDialog* mDlg;
190  bool mIsLocalSystemFolder;
191 };
192 
193 } // end of namespace KMail
194 
198 class KMFolderDialog : public KDialogBase
199 {
200  TQ_OBJECT
201 
202 
203 public:
204  KMFolderDialog( KMFolder *folder, KMFolderDir *aFolderDir,
205  KMFolderTree* parent, const TQString& caption,
206  const TQString& name = TQString() );
207 
208  KMFolder* folder() const { return mFolder; }
209  void setFolder( KMFolder* folder );
210  // Was mFolder just created? (This only makes sense from save())
211  // If Apply is clicked, or OK proceeeds half-way, then next time "new folder" will be false.
212  bool isNewFolder() const { return mIsNewFolder; }
213 
214  KMFolderDir* folderDir() const { return mFolderDir; }
215  typedef TQValueList<TQGuardedPtr<KMFolder> > FolderList;
216 
217  KMFolder* parentFolder() const { return mParentFolder; }
218 
219  KMFolderTree* folderTree() const { return mFolderTree; }
220 
221 protected slots:
222  void slotChanged( bool );
223  virtual void slotOk();
224  virtual void slotApply();
225 
226  void slotReadyForAccept();
227  void slotCancelAccept();
228 
229 private:
230  void addTab( KMail::FolderDiaTab* tab );
231 
232 private:
233  // Can be 0 initially when creating a folder, but will be set by save() in the first tab.
234  TQGuardedPtr<KMFolder> mFolder;
235  TQGuardedPtr<KMFolderDir> mFolderDir;
236  TQGuardedPtr<KMFolder> mParentFolder;
237 
238  bool mIsNewFolder; // if true, save() did set mFolder.
239 
240  TQValueVector<KMail::FolderDiaTab*> mTabs;
241  int mDelayedSavingTabs; // this should go into a base class one day
242  KMFolderTree* mFolderTree;
243 };
244 
245 #endif /*__KMFOLDERDIA*/
246 
Dialog for handling the properties of a mail folder.
Definition: kmfolderdia.h:199
KMail list that manages the contents of one directory that may contain folders and/or other directori...
Definition: kmfolderdir.h:16
Mail folder.
Definition: kmfolder.h:69
"General" tab in the folder dialog Internal class, only used by KMFolderDialog
Definition: kmfolderdia.h:112
virtual bool save()
Unlike ConfigModuleTab, we return a bool from save.
This is the base class for tabs in the folder dialog.
Definition: kmfolderdia.h:70
virtual AccepStatus accept()
Called when clicking OK.
Definition: kmfolderdia.h:90
virtual bool save()=0
Unlike ConfigModuleTab, we return a bool from save.
void changed(bool)
Called when this module was changed [not really used yet].
void readyForAccept()
Emit this to tell the dialog that you're done with the async jobs, and that the dialog can be closed.
void cancelAccept()
Emit this, i.e.
"Templates" tab in the folder dialog Internal class, only used by KMFolderDialog
Definition: kmfolderdia.h:164
virtual bool save()
Unlike ConfigModuleTab, we return a bool from save.
folderdiaquotatab.h
Definition: aboutdata.cpp:40