25 #ifndef ADDRESSESDIALOG_H
26 #define ADDRESSESDIALOG_H
28 #include <tdeabc/addressee.h>
29 #include <kdialogbase.h>
30 #include <tdelistview.h>
31 #include <tqstringlist.h>
32 #include <tqptrlist.h>
33 #include <tqptrdict.h>
34 #include <tdemacros.h>
38 class AddresseeViewItem :
public TQObject,
public TDEListViewItem
53 AddresseeViewItem( AddresseeViewItem *parent,
const TDEABC::Addressee& addr,
int emailIndex = 0 );
54 AddresseeViewItem( TDEListView *lv,
const TQString& name, Category cat=Group );
55 AddresseeViewItem( AddresseeViewItem *parent,
const TQString& name,
const TDEABC::Addressee::List &lst );
56 AddresseeViewItem( AddresseeViewItem *parent,
const TQString& name );
59 TDEABC::Addressee addressee()
const;
60 TDEABC::Addressee::List addresses()
const;
61 Category category()
const;
63 TQString name()
const;
64 TQString email()
const;
66 bool matches(
const TQString& )
const;
68 virtual int compare( TQListViewItem * i,
int col,
bool ascending )
const;
69 virtual void setSelected(
bool );
72 void addressSelected( AddresseeViewItem*,
bool );
75 struct AddresseeViewItemPrivate;
76 AddresseeViewItemPrivate *d;
79 class TDE_EXPORT AddressesDialog :
public KDialogBase
84 AddressesDialog( TQWidget *widget=0,
const char *name=0 );
90 TQStringList to()
const;
94 TQStringList cc()
const;
98 TQStringList bcc()
const;
104 TDEABC::Addressee::List toAddresses()
const;
110 TDEABC::Addressee::List allToAddressesNoDuplicates()
const;
115 TDEABC::Addressee::List ccAddresses()
const;
120 TDEABC::Addressee::List bccAddresses()
const;
126 TQStringList toDistributionLists()
const;
131 TQStringList ccDistributionLists()
const;
136 TQStringList bccDistributionLists()
const;
143 void setShowCC(
bool b );
148 void setShowBCC(
bool b );
153 void setRecentAddresses(
const TDEABC::Addressee::List& addr );
157 void setSelectedTo(
const TQStringList& l );
161 void setSelectedCC(
const TQStringList& l );
165 void setSelectedBCC(
const TQStringList& l );
168 void addSelectedTo();
169 void addSelectedCC();
170 void addSelectedBCC();
175 void ldapSearchResult();
176 void launchAddressBook();
178 void filterChanged(
const TQString & );
180 void updateAvailableAddressees();
181 void availableSelectionChanged();
182 void selectedSelectionChanged();
183 void availableAddressSelected( AddresseeViewItem* item,
bool selected );
184 void selectedAddressSelected( AddresseeViewItem* item,
bool selected );
187 AddresseeViewItem* selectedToItem();
188 AddresseeViewItem* selectedCcItem();
189 AddresseeViewItem* selectedBccItem();
191 void initConnections();
192 void addDistributionLists();
193 void addAddresseeToAvailable(
const TDEABC::Addressee& addr,
194 AddresseeViewItem* defaultParent=0,
bool useCategory=
true );
195 void addAddresseeToSelected(
const TDEABC::Addressee& addr,
196 AddresseeViewItem* defaultParent=0 );
197 void addAddresseesToSelected( AddresseeViewItem *parent,
198 const TQPtrList<AddresseeViewItem>& addresses );
199 TQStringList entryToString(
const TDEABC::Addressee::List& l )
const;
200 TDEABC::Addressee::List allAddressee( AddresseeViewItem* parent )
const;
201 TDEABC::Addressee::List allAddressee( TDEListView* view,
bool onlySelected =
true )
const;
202 TQStringList allDistributionLists( AddresseeViewItem* parent )
const;
206 void checkForSingleAvailableGroup();
210 void unmapSelectedAddress(AddresseeViewItem* item);
211 void updateRecentAddresses();
213 struct AddressesDialogPrivate;
214 AddressesDialogPrivate *d;
216 TQPtrList<AddresseeViewItem> selectedAvailableAddresses;
217 TQPtrList<AddresseeViewItem> selectedSelectedAddresses;
218 TQPtrDict<AddresseeViewItem> selectedToAvailableMapping;
TDEPIM classes for drag and drop of mails.