kaddressbook

#include <kaddressbookview.h>

Inheritance diagram for KAddressBookView:
KAddressBookCardView KAddressBookIconView KAddressBookTableView

List of all members.

Public Types

enum  DefaultFilterType { None = 0, Active = 1, Specific = 2 }

Public Slots

virtual void refresh (const TQString &uid=TQString())=0
virtual void setSelected (const TQString &uid=TQString(), bool selected=true)=0
virtual void setFirstSelected (bool selected=true)=0
void popup (const TQPoint &point)

Signals

void modified ()
void selected (const TQString &uid)
void executed (const TQString &uid)
void startDrag ()
void dropped (TQDropEvent *)
void sortFieldChanged ()
void viewFieldsChanged ()

Public Member Functions

 KAddressBookView (KAB::Core *core, TQWidget *parent, const char *name)
virtual TQStringList selectedUids ()=0
virtual void readConfig (TDEConfig *config)
virtual void writeConfig (TDEConfig *)
virtual TQString selectedEmails ()
virtual TQString type () const =0
TDEABC::Field::List fields () const
void setFilter (const Filter &)
DefaultFilterType defaultFilterType () const
const TQString & defaultFilterName () const
KAB::Core * core () const
virtual TDEABC::Field * sortField () const =0
virtual void scrollUp ()=0
virtual void scrollDown ()=0

Protected Member Functions

TDEABC::Addressee::List addressees ()
TQWidget * viewWidget ()

Detailed Description

Base class for all views in kaddressbook.

This class implements all the common methods needed to provide a view to the user.

To implement a specific view (table, card, etc), just inherit from this class and implement all the pure virtuals.

Author:
Mike Pilone <mpilone@slac.com>

Definition at line 56 of file kaddressbookview.h.


Member Function Documentation

TDEABC::Addressee::List KAddressBookView::addressees ( ) [protected]

Returns a list of the addressees that should be displayed.

This method should always be used by the subclass to get a list of addressees. This method internally takes many factors into account, including the current filter.

Definition at line 104 of file kaddressbookview.cpp.

KAB::Core * KAddressBookView::core ( ) const
Returns:
The Core object.

Definition at line 152 of file kaddressbookview.cpp.

const TQString & KAddressBookView::defaultFilterName ( ) const
Returns:
The name of the default filter. This string is only valid if defaultFilterType() is returning SpecificFilter.

Definition at line 147 of file kaddressbookview.cpp.

KAddressBookView::DefaultFilterType KAddressBookView::defaultFilterType ( ) const
Returns:
The default filter type selection. If the selection is SpecificFilter, the name of the filter can be retrieved with defaultFilterName()

Definition at line 142 of file kaddressbookview.cpp.

void KAddressBookView::dropped ( TQDropEvent *  ) [signal]

This signal is emitted whenever the user drops something on the view.

The individual view should handle checking if the item is droppable (ie: if it is a vcard).

void KAddressBookView::executed ( const TQString &  uid) [signal]

This signal should be emitted by a subclass whenever an addressee is executed.

This is defined by the KDE system wide config, but it either means single or doubleclicked.

Parameters:
uidThe uid of the selected addressee
See also:
TDEListView
TDEABC::Field::List KAddressBookView::fields ( ) const

Returns a list of the fields that should be displayed.

The list is composed of the fields proper names (ie: Home Address), so the view may need to translate them in order to get the value from the addressee.

This list is generated from the config file, so it is advisable to call this method whenever a readConfig() is called in order to get the newest list of fields.

Definition at line 132 of file kaddressbookview.cpp.

void KAddressBookView::modified ( ) [signal]

This signal should be emitted by a subclass whenever an addressee is modified.

void KAddressBookView::popup ( const TQPoint &  point) [slot]

Call this slot to popup a rmb menu.

Parameters:
pointThe position where the menu shall appear.

Definition at line 157 of file kaddressbookview.cpp.

void KAddressBookView::readConfig ( TDEConfig *  config) [virtual]

Called whenever this view should read the config.

This can be used as a sign that the config has changed, therefore the view should assume the worst and rebuild itself if necessary. For example, in a table view this method may be called when the user adds or removes columns from the view.

If overloaded in the subclass, do not forget to call super class's method.

Parameters:
configThe TDEConfig object to read from. The group will already be set, so do not change the group.

Reimplemented in KAddressBookTableView, KAddressBookCardView, and KAddressBookIconView.

Definition at line 56 of file kaddressbookview.cpp.

virtual void KAddressBookView::refresh ( const TQString &  uid = TQString()) [pure virtual, slot]

Must be overloaded in subclasses to refresh the view.

Refreshing includes updating the view to ensure that only items in the document are visible. If uid is valid, only the addressee with uid needs to be refreshed. This is an optimization only.

Implemented in KAddressBookTableView, KAddressBookCardView, and KAddressBookIconView.

void KAddressBookView::selected ( const TQString &  uid) [signal]

This signal should be emitted by a subclass whenever an addressee is selected.

Selected means that the addressee was given the focus. Some widgets may call this 'highlighted'. The view is responsible for emitting this signal multiple times if multiple items are selected, with the last item selected being the last emit.

Parameters:
uidThe uid of the selected addressee.
See also:
TDEListView
TQString KAddressBookView::selectedEmails ( ) [virtual]

Returns a TQString with all the selected email addresses concatenated together with a ',' seperator.

Definition at line 72 of file kaddressbookview.cpp.

virtual TQStringList KAddressBookView::selectedUids ( ) [pure virtual]

Must be overloaded in subclasses.

Should return a list of all the uids of selected contacts.

Implemented in KAddressBookTableView, KAddressBookCardView, and KAddressBookIconView.

void KAddressBookView::setFilter ( const Filter filter)

Sets the active filter.

This filter will be used for filtering the list of addressees to display. The view will not automatically refresh itself, so in most cases you will want to call KAddressBookView::refresh() after this method.

Definition at line 137 of file kaddressbookview.cpp.

virtual void KAddressBookView::setFirstSelected ( bool  selected = true) [pure virtual, slot]

Selects the first contact in the view.

Implemented in KAddressBookTableView, KAddressBookCardView, and KAddressBookIconView.

virtual void KAddressBookView::setSelected ( const TQString &  uid = TQString(),
bool  selected = true 
) [pure virtual, slot]

This method must be overloaded in subclasses.

Select (highlight) the addressee matching uid. If uid is equal to TQString(), then all addressees should be selected.

Implemented in KAddressBookTableView, KAddressBookCardView, and KAddressBookIconView.

virtual TDEABC::Field* KAddressBookView::sortField ( ) const [pure virtual]
Returns:
The current sort field.

Implemented in KAddressBookTableView, KAddressBookCardView, and KAddressBookIconView.

This signal is emitted whenever the sort field changed.

void KAddressBookView::startDrag ( ) [signal]

This signal is emitted whenever a user attempts to start a drag in the view.

The slot connected to this signal would usually want to create a TQDragObject.

virtual TQString KAddressBookView::type ( ) const [pure virtual]

Return the type of the view: Icon, Table, etc.

Please make sure that this is the same value that ViewWrapper::type() will return for your view.

Implemented in KAddressBookTableView, KAddressBookCardView, and KAddressBookIconView.

Emitted whenever the view fields changed.

TQWidget * KAddressBookView::viewWidget ( ) [protected]

This method returns the widget that should be used as the parent for all view components.

By using this widget as the parent and not 'this', the view subclass has the option of placing other widgets around the view (ie: search fields, etc). Do not delete this widget!

Definition at line 170 of file kaddressbookview.cpp.

void KAddressBookView::writeConfig ( TDEConfig *  ) [virtual]

Called whenever this view should write the config.

The view should not write out information handled by the application, such as which fields are visible. The view should only write out information specific to itself (i.e.: All information in the ViewConfigWidget)

If overloaded in the subclass, do not forget to call the super class's method.

Reimplemented in KAddressBookTableView, and KAddressBookCardView.

Definition at line 67 of file kaddressbookview.cpp.


The documentation for this class was generated from the following files: