21 #ifndef RECIPIENTSPICKER_H
22 #define RECIPIENTSPICKER_H
26 #include "recipientseditor.h"
28 #include <tdelistview.h>
29 #include <tdelistviewsearchline.h>
30 #include <tdeabc/addressee.h>
31 #include <tdeabc/stdaddressbook.h>
35 #include <tqtooltip.h>
39 #ifdef TDEPIM_NEW_DISTRLISTS
40 #include <libtdepim/distributionlist.h>
43 class DistributionList;
44 class DistributionListManager;
49 class LDAPSearchDialog;
55 typedef TQValueList<RecipientItem *> List;
57 #ifdef TDEPIM_NEW_DISTRLISTS
58 RecipientItem( TDEABC::AddressBook *ab );
59 void setDistributionList( KPIM::DistributionList& );
60 KPIM::DistributionList& distributionList();
63 void setDistributionList( TDEABC::DistributionList * );
64 TDEABC::DistributionList * distributionList();
66 void setAddressee(
const TDEABC::Addressee &,
const TQString &email );
68 void setRecipientType(
const TQString &type );
69 TQString recipientType()
const;
71 TQString recipient()
const;
73 TQPixmap icon()
const;
74 TQString name()
const;
75 TQString email()
const;
77 TQString key()
const {
return mKey; }
79 TQString tooltip()
const;
82 #ifdef TDEPIM_NEW_DISTRLISTS
83 TQString createTooltip( KPIM::DistributionList & )
const;
85 TQString createTooltip( TDEABC::DistributionList * )
const;
88 TDEABC::Addressee mAddressee;
92 #ifdef TDEPIM_NEW_DISTRLISTS
93 KPIM::DistributionList mDistributionList;
94 TDEABC::AddressBook *mAddressBook;
96 TDEABC::DistributionList *mDistributionList;
106 class RecipientViewItem :
public TDEListViewItem
109 RecipientViewItem( RecipientItem *, TDEListView * );
111 RecipientItem *recipientItem()
const;
114 RecipientItem *mRecipientItem;
117 class RecipientsListToolTip :
public TQToolTip
120 RecipientsListToolTip( TQWidget *parent, TDEListView * );
123 void maybeTip(
const TQPoint &pos );
126 TDEListView *mListView;
129 class RecipientsCollection
132 RecipientsCollection(
const TQString & );
133 ~RecipientsCollection();
135 void setReferenceContainer(
bool );
136 bool isReferenceContainer()
const;
138 void setTitle(
const TQString & );
139 TQString title()
const;
141 void addItem( RecipientItem * );
143 RecipientItem::List items()
const;
145 bool hasEquivalentItem( RecipientItem * )
const;
146 RecipientItem * getEquivalentItem( RecipientItem *)
const;
157 bool mIsReferenceContainer;
160 TQMap<TQString, RecipientItem *> mKeyMap;
163 class SearchLine :
public TDEListViewSearchLine
168 SearchLine( TQWidget *parent, TDEListView *listView );
174 void keyPressEvent( TQKeyEvent * );
177 using namespace TDEABC;
179 class RecipientsPicker :
public TQDialog
184 RecipientsPicker( TQWidget *parent );
187 void setRecipients(
const Recipient::List & );
188 void updateRecipient(
const Recipient & );
190 void setDefaultType( Recipient::Type );
193 void pickedRecipient(
const Recipient & );
196 void initCollections();
197 void insertDistributionLists();
198 void insertRecentAddresses();
199 void insertCollection( RecipientsCollection *coll );
201 void keyPressEvent( TQKeyEvent *ev );
206 void pick( Recipient::Type );
208 void setDefaultButton( TQPushButton *button );
210 void rebuildAllRecipientsList();
214 void slotToClicked();
215 void slotCcClicked();
216 void slotBccClicked();
217 void slotPicked( TQListViewItem * );
221 void insertAddressBook( AddressBook * );
222 void slotSearchLDAP();
223 void ldapSearchResult();
225 TDEABC::StdAddressBook *mAddressBook;
227 TQComboBox *mCollectionCombo;
228 TDEListView *mRecipientList;
229 TDEListViewSearchLine *mSearchLine;
231 TQPushButton *mToButton;
232 TQPushButton *mCcButton;
233 TQPushButton *mBccButton;
235 TQPushButton *mSearchLDAPButton;
236 KPIM::LDAPSearchDialog *mLdapSearchDialog;
238 TQMap<int,RecipientsCollection *> mCollectionMap;
239 RecipientsCollection *mAllRecipients;
240 RecipientsCollection *mDistributionLists;
241 RecipientsCollection *mSelectedRecipients;
243 #ifndef TDEPIM_NEW_DISTRLISTS
244 TDEABC::DistributionListManager *mDistributionListManager;
247 Recipient::Type mDefaultType;