kmail
folderdiaacltab.hGo to the documentation of this file.00001
00032 #ifndef FOLDERDIAACL_H
00033 #define FOLDERDIAACL_H
00034
00035 #include "kmfolderdia.h"
00036 #include "kmfoldertype.h"
00037
00038 class KMFolderImap;
00039 class KPushButton;
00040 class QWidgetStack;
00041 class QHBox;
00042 class QVButtonGroup;
00043 class KListView;
00044 namespace KIO { class Job; }
00045
00046 namespace KMail {
00047
00048 enum IMAPUserIdFormat { FullEmail, UserName };
00049
00050 struct ACLListEntry;
00051 typedef QValueVector<KMail::ACLListEntry> ACLList;
00052
00053 class ImapAccountBase;
00054
00059 class ACLEntryDialog :public KDialogBase {
00060 Q_OBJECT
00061
00062 public:
00063 ACLEntryDialog( IMAPUserIdFormat userIdFormat, const QString& caption, QWidget* parent, const char* name = 0 );
00064
00065 void setValues( const QString& userId, unsigned int permissions );
00066
00067 QString userId() const;
00068 QStringList userIds() const;
00069 unsigned int permissions() const;
00070
00071 private slots:
00072 void slotSelectAddresses();
00073 void slotChanged();
00074
00075 private:
00076 QVButtonGroup* mButtonGroup;
00077 KLineEdit* mUserIdLineEdit;
00078 IMAPUserIdFormat mUserIdFormat;
00079 };
00080
00085 class FolderDiaACLTab : public FolderDiaTab
00086 {
00087 Q_OBJECT
00088
00089 public:
00090 FolderDiaACLTab( KMFolderDialog* dlg, QWidget* parent, const char* name = 0 );
00091
00092 virtual void load();
00093 virtual bool save();
00094 virtual AcceptStatus accept();
00095
00096 static bool supports( KMFolder* refFolder );
00097
00098 private slots:
00099
00100 void slotConnectionResult( int, const QString& );
00101 void slotReceivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& );
00102 void slotMultiSetACLResult(KIO::Job *);
00103 void slotACLChanged( const QString&, int );
00104 void slotReceivedUserRights( KMFolder* folder );
00105 void slotDirectoryListingFinished(KMFolderImap*);
00106
00107
00108 void slotEditACL(QListViewItem*);
00109 void slotSelectionChanged(QListViewItem*);
00110
00111
00112 void slotAddACL();
00113 void slotEditACL();
00114 void slotRemoveACL();
00115
00116 void slotChanged( bool b );
00117
00118 private:
00119 KURL imapURL() const;
00120 void initializeWithValuesFromFolder( KMFolder* folder );
00121 void startListing();
00122 void loadListView( const KMail::ACLList& aclList );
00123 void loadFinished( const KMail::ACLList& aclList );
00124 void addACLs( const QStringList& userIds, unsigned int permissions );
00125
00126 private:
00127
00128 QHBox* mACLWidget;
00129
00130 class ListViewItem;
00131 KListView* mListView;
00132 KPushButton* mAddACL;
00133 KPushButton* mEditACL;
00134 KPushButton* mRemoveACL;
00135
00136 QStringList mRemovedACLs;
00137 QString mImapPath;
00138 ImapAccountBase* mImapAccount;
00139 int mUserRights;
00140 KMFolderType mFolderType;
00141 ACLList mInitialACLList;
00142 ACLList mACLList;
00143 IMAPUserIdFormat mUserIdFormat;
00144
00145 QLabel* mLabel;
00146 QWidgetStack* mStack;
00147 KMFolderDialog* mDlg;
00148
00149 bool mChanged;
00150 bool mAccepting;
00151 bool mSaving;
00152 };
00153
00154 }
00155
00156 #endif
00157
|