22 #ifndef KPIM_ADDRESSEESELECTOR_H
23 #define KPIM_ADDRESSEESELECTOR_H
25 #include <tdeabc/addressee.h>
26 #include <tdeabc/distributionlist.h>
27 #include <tdeabc/resource.h>
28 #include <kdialogbase.h>
29 #include <tdemacros.h>
31 #include <tqbitarray.h>
42 class AddresseeSelector;
44 class TDE_EXPORT Selection
46 friend class AddresseeSelector;
49 virtual ~Selection() {}
54 virtual uint fieldCount()
const = 0;
59 virtual TQString fieldTitle( uint index )
const = 0;
64 virtual uint itemCount(
const TDEABC::Addressee &addresse )
const = 0;
69 virtual TQString itemText(
const TDEABC::Addressee &addresse, uint index )
const = 0;
74 virtual TQPixmap itemIcon(
const TDEABC::Addressee &addresse, uint index )
const = 0;
79 virtual bool itemEnabled(
const TDEABC::Addressee &addresse, uint index )
const = 0;
84 virtual bool itemMatches(
const TDEABC::Addressee &addresse, uint index,
const TQString &pattern )
const = 0;
89 virtual bool itemEquals(
const TDEABC::Addressee &addresse, uint index,
const TQString &pattern )
const = 0;
94 virtual TQString distributionListText(
const TDEABC::DistributionList *distributionList )
const = 0;
99 virtual TQPixmap distributionListIcon(
const TDEABC::DistributionList *distributionList )
const = 0;
104 virtual bool distributionListEnabled(
const TDEABC::DistributionList *distributionList )
const = 0;
109 virtual bool distributionListMatches(
const TDEABC::DistributionList *distributionList,
110 const TQString &pattern )
const = 0;
115 virtual uint addressBookCount()
const = 0;
120 virtual TQString addressBookTitle( uint index )
const = 0;
125 virtual TDEABC::Addressee::List addressBookContent( uint index )
const = 0;
128 AddresseeSelector* selector() {
return mSelector; }
131 virtual void addSelectedAddressees( uint fieldIndex,
const TDEABC::Addressee&, uint itemIndex ) = 0;
132 virtual void addSelectedDistributionList( uint fieldIndex,
const TDEABC::DistributionList* ) = 0;
134 void setSelector( AddresseeSelector *selector ) { mSelector = selector; }
136 AddresseeSelector *mSelector;
145 typedef TQValueList<SelectionItem> List;
147 SelectionItem(
const TDEABC::Addressee &addressee, uint index );
151 void addToField(
int index );
152 void removeFromField(
int index );
153 bool isInField(
int index );
155 TDEABC::Addressee addressee()
const;
156 TDEABC::DistributionList* distributionList()
const;
160 TDEABC::Addressee mAddressee;
161 TDEABC::DistributionList *mDistributionList;
166 class TDE_EXPORT AddresseeSelector :
public TQWidget
172 AddresseeSelector( Selection *selection,
173 TQWidget *parent,
const char *name = 0 );
174 ~AddresseeSelector();
181 void setItemSelected( uint fieldIndex,
const TDEABC::Addressee&, uint itemIndex );
182 void setItemSelected( uint fieldIndex,
const TDEABC::Addressee&,
183 uint itemIndex,
const TQString& );
186 void move(
int index );
187 void remove(
int index );
189 void updateAddresseeView();
190 void reloadAddressBook();
196 void updateSelectionView(
int index );
197 void updateSelectionViews();
199 Selection *mSelection;
201 KComboBox *mAddressBookCombo;
202 KLineEdit *mAddresseeFilter;
203 TDEListView *mAddresseeView;
204 SelectionItem::List mSelectionItems;
206 TQValueList<TDEListView*> mSelectionViews;
207 TQSignalMapper *mMoveMapper;
208 TQSignalMapper *mRemoveMapper;
210 TDEABC::DistributionListManager *mManager;
212 class AddressBookManager;
213 AddressBookManager *mAddressBookManager;
216 class TDE_EXPORT AddresseeSelectorDialog :
public KDialogBase
222 AddresseeSelectorDialog( Selection *selection,
223 TQWidget *parent = 0,
const char *name = 0 );
229 AddresseeSelector *mSelector;
TDEPIM classes for drag and drop of mails.