kmail

folderdiaacltab.h
1 
31 #ifndef FOLDERDIAACL_H
32 #define FOLDERDIAACL_H
33 
34 #include "kmfolderdia.h"
35 #include "acljobs.h"
36 #include "kmfoldertype.h"
37 
38 class KMFolderImap;
39 class KPushButton;
40 class TQWidgetStack;
41 class TQHBox;
42 class TQVButtonGroup;
43 class TDEListView;
44 namespace TDEIO { class Job; }
45 
46 namespace KMail {
47 
48 enum IMAPUserIdFormat { FullEmail, UserName };
49 
50 struct ACLListEntry;
51 typedef TQValueVector<KMail::ACLListEntry> ACLList;
52 
53 class ImapAccountBase;
54 
59 class ACLEntryDialog :public KDialogBase {
60  TQ_OBJECT
61 
62 
63 public:
64  ACLEntryDialog( IMAPUserIdFormat userIdFormat, const TQString& caption, TQWidget* parent, const char* name = 0 );
65 
66  void setValues( const TQString& userId, unsigned int permissions );
67 
68  TQString userId() const;
69  TQStringList userIds() const;
70  unsigned int permissions() const;
71 
72 private slots:
73  void slotSelectAddresses();
74  void slotChanged();
75 
76 private:
77  TQVButtonGroup* mButtonGroup;
78  KLineEdit* mUserIdLineEdit;
79  IMAPUserIdFormat mUserIdFormat;
80 };
81 
87 {
88  TQ_OBJECT
89 
90 
91 public:
92  FolderDiaACLTab( KMFolderDialog* dlg, TQWidget* parent, const char* name = 0 );
93 
94  virtual void load();
95  virtual bool save();
96  virtual AccepStatus accept();
97 
98  static bool supports( KMFolder* refFolder );
99 
100 private slots:
101  // Network (TDEIO) slots
102  void slotConnectionResult( int, const TQString& );
103  void slotReceivedACL( KMFolder*, TDEIO::Job*, const KMail::ACLList& );
104  void slotMultiSetACLResult(TDEIO::Job *);
105  void slotACLChanged( const TQString&, int );
106  void slotReceivedUserRights( KMFolder* folder );
107  void slotDirectoryListingFinished(KMFolderImap*);
108 
109  // User (TDEListView) slots
110  void slotEditACL(TQListViewItem*);
111  void slotSelectionChanged(TQListViewItem*);
112 
113  // User (pushbuttons) slots
114  void slotAddACL();
115  void slotEditACL();
116  void slotRemoveACL();
117 
118  void slotChanged( bool b );
119 
120 private:
121  KURL imapURL() const;
122  void initializeWithValuesFromFolder( KMFolder* folder );
123  void startListing();
124  void loadListView( const KMail::ACLList& aclList );
125  void loadFinished( const KMail::ACLList& aclList );
126  void addACLs( const TQStringList& userIds, unsigned int permissions );
127 
128 private:
129  // The widget containing the ACL widgets (listview and buttons)
130  TQHBox* mACLWidget;
131  //class ListView;
132  class ListViewItem;
133  TDEListView* mListView;
134  KPushButton* mAddACL;
135  KPushButton* mEditACL;
136  KPushButton* mRemoveACL;
137 
138  TQStringList mRemovedACLs;
139  TQString mImapPath;
140  ImapAccountBase* mImapAccount;
141  int mUserRights;
142  KMail::ACLJobs::ACLFetchState mUserRightsState;
143  KMFolderType mFolderType;
144  ACLList mInitialACLList;
145  ACLList mACLList; // to be set
146  IMAPUserIdFormat mUserIdFormat;
147 
148  TQLabel* mLabel;
149  TQWidgetStack* mStack;
150  KMFolderDialog* mDlg;
151 
152  bool mChanged;
153  bool mAccepting; // i.e. close when done
154  bool mSaving;
155 };
156 
157 } // end of namespace KMail
158 
159 #endif /* FOLDERDIAACL_H */
160 
Dialog for handling the properties of a mail folder.
Definition: kmfolderdia.h:199
Mail folder.
Definition: kmfolder.h:69
"New Access Control Entry" dialog.
"Access Control" tab in the folder dialog Internal class, only used by KMFolderDialog
virtual bool save()
Unlike ConfigModuleTab, we return a bool from save.
virtual AccepStatus accept()
Called when clicking OK.
This is the base class for tabs in the folder dialog.
Definition: kmfolderdia.h:70
folderdiaquotatab.h
Definition: aboutdata.cpp:40