kmail

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