libtdepim

addresseeemailselection.h
1 /*
2  This file is part of libtdepim.
3 
4  Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KPIM_ADDRESSEE_EMAILSELECTION_H
23 #define KPIM_ADDRESSEE_EMAILSELECTION_H
24 
25 #include <addresseeselector.h>
26 
27 namespace KPIM {
28 
29 class TDE_EXPORT AddresseeEmailSelection : public Selection
30 {
31  public:
32  AddresseeEmailSelection();
33 
37  virtual uint fieldCount() const;
38 
42  virtual TQString fieldTitle( uint index ) const;
43 
47  virtual uint itemCount( const TDEABC::Addressee &addresse ) const;
48 
52  virtual TQString itemText( const TDEABC::Addressee &addresse, uint index ) const;
53 
57  virtual TQPixmap itemIcon( const TDEABC::Addressee &addresse, uint index ) const;
58 
62  virtual bool itemEnabled( const TDEABC::Addressee &addresse, uint index ) const;
63 
67  virtual bool itemMatches( const TDEABC::Addressee &addresse, uint index, const TQString &pattern ) const;
68 
72  virtual bool itemEquals( const TDEABC::Addressee &addresse, uint index, const TQString &pattern ) const;
73 
77  virtual TQString distributionListText( const TDEABC::DistributionList *distributionList ) const;
78 
82  virtual TQPixmap distributionListIcon( const TDEABC::DistributionList *distributionList ) const;
83 
87  virtual bool distributionListEnabled( const TDEABC::DistributionList *distributionList ) const;
88 
92  virtual bool distributionListMatches( const TDEABC::DistributionList *distributionList,
93  const TQString &pattern ) const;
94 
98  virtual uint addressBookCount() const;
99 
103  virtual TQString addressBookTitle( uint index ) const;
104 
108  virtual TDEABC::Addressee::List addressBookContent( uint index ) const;
109 
110  TQStringList to() const;
111  TQStringList cc() const;
112  TQStringList bcc() const;
113 
114  TDEABC::Addressee::List toAddresses() const;
115  TDEABC::Addressee::List ccAddresses() const;
116  TDEABC::Addressee::List bccAddresses() const;
117 
118  TQStringList toDistributionLists() const;
119  TQStringList ccDistributionLists() const;
120  TQStringList bccDistributionLists() const;
121 
122  void setSelectedTo( const TQStringList &emails );
123  void setSelectedCC( const TQStringList &emails );
124  void setSelectedBCC( const TQStringList &emails );
125 
126  private:
127  virtual void addSelectedAddressees( uint fieldIndex, const TDEABC::Addressee&, uint itemIndex );
128  virtual void addSelectedDistributionList( uint fieldIndex, const TDEABC::DistributionList* );
129 
130  TQString email( const TDEABC::Addressee&, uint ) const;
131  void setSelectedItem( uint fieldIndex, const TQStringList& );
132 
133  TDEABC::Addressee::List mToAddresseeList;
134  TDEABC::Addressee::List mCcAddresseeList;
135  TDEABC::Addressee::List mBccAddresseeList;
136 
137  TQStringList mToEmailList;
138  TQStringList mCcEmailList;
139  TQStringList mBccEmailList;
140 
141  TQStringList mToDistributionList;
142  TQStringList mCcDistributionList;
143  TQStringList mBccDistributionList;
144 };
145 
146 }
147 
148 #endif
TDEPIM classes for drag and drop of mails.