kaddressbook

kaddressbookcardview.h
1 #ifndef KADDRESSBOOKCARDVIEW_H
2 #define KADDRESSBOOKCARDVIEW_H
3 
4 /*
5  This file is part of KAddressBook.
6  Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 
22  As a special exception, permission is given to link this program
23  with any edition of TQt, and distribute the resulting executable,
24  without including the source code for TQt in the source distribution.
25 */
26 
27 #include <tqstring.h>
28 #include <kiconview.h>
29 
30 #include "cardview.h"
31 #include "kaddressbookview.h"
32 
33 class TQDragEntryEvent;
34 class TQDropEvent;
35 class TDEConfig;
36 class AddresseeCardView;
37 
44 {
45  TQ_OBJECT
46 
47 
48  public:
49  KAddressBookCardView( KAB::Core *core, TQWidget *parent,
50  const char *name = 0 );
51  virtual ~KAddressBookCardView();
52 
53  virtual TQStringList selectedUids();
54  virtual TQString type() const { return "Card"; }
55  virtual TDEABC::Field *sortField() const;
56 
57  virtual void readConfig( TDEConfig *config );
58  virtual void writeConfig( TDEConfig *config );
59 
60  void scrollUp();
61  void scrollDown();
62 
63  public slots:
64  void refresh( const TQString &uid = TQString() );
65  void setSelected( const TQString &uid = TQString(), bool selected = true );
66  virtual void setFirstSelected( bool selected = true );
67 
68  protected slots:
69  void addresseeExecuted( CardViewItem* );
70  void addresseeSelected();
71  void rmbClicked( CardViewItem*, const TQPoint& );
72 
73  private:
74  AddresseeCardView *mCardView;
75  bool mShowEmptyFields;
76 };
77 
78 class AddresseeCardView : public CardView
79 {
80  TQ_OBJECT
81 
82  public:
83  AddresseeCardView( TQWidget *parent, const char *name = 0 );
84  ~AddresseeCardView();
85 
86  signals:
87  void startAddresseeDrag();
88  void addresseeDropped( TQDropEvent* );
89 
90  protected:
91  virtual void dragEnterEvent( TQDragEnterEvent* );
92  virtual void dropEvent( TQDropEvent* );
93  virtual void startDrag();
94 };
95 
96 #endif
Represents a single card (item) in the card view.
Definition: cardview.h:50
The CardView is a method of displaying data in cards.
Definition: cardview.h:195
virtual void startDrag()
Overload this method to be told when a drag should be started.
Definition: cardview.cpp:1451
This view uses the CardView class to create a card view.
virtual void readConfig(TDEConfig *config)
Called whenever this view should read the config.
virtual TQStringList selectedUids()
Must be overloaded in subclasses.
virtual TQString type() const
Return the type of the view: Icon, Table, etc.
virtual void writeConfig(TDEConfig *config)
Called whenever this view should write the config.
virtual TDEABC::Field * sortField() const
Base class for all views in kaddressbook.
KAB::Core * core() const
void selected(const TQString &uid)
This signal should be emitted by a subclass whenever an addressee is selected.