KAddressBookView Class Reference
Base class for all views in kaddressbook. More...
#include <kaddressbookview.h>
Inheritance diagram for KAddressBookView:

Public Types | |
enum | DefaultFilterType { None = 0, Active = 1, Specific = 2 } |
Public Slots | |
virtual void | refresh (QString uid=QString::null)=0 |
Must be overloaded in subclasses to refresh the view. | |
virtual void | setSelected (QString uid=QString::null, bool selected=true)=0 |
This method must be overloaded in subclasses. | |
Signals | |
void | modified () |
This signal should be emitted by a subclass whenever an addressee is modified. | |
void | selected (const QString &uid) |
This signal should be emitted by a subclass whenever an addressee is selected. | |
void | executed (const QString &uid) |
This signal should be emitted by a subclass whenever an addressee is executed. | |
void | startDrag () |
This signal is emitted whenever a user attempts to start a drag in the view. | |
void | dropped (QDropEvent *e) |
This signal is emitted whenever the user drops something on the view. | |
Public Member Functions | |
KAddressBookView (KABC::AddressBook *doc, QWidget *parent, const char *name) | |
virtual QStringList | selectedUids ()=0 |
Must be overloaded in subclasses. | |
virtual void | readConfig (KConfig *config) |
Called whenever this view should read the config. | |
virtual void | writeConfig (KConfig *config) |
Called whenever this view should write the config. | |
virtual QString | selectedEmails () |
Returns a QString with all the selected email addresses contactenated together with a ',' seperator. | |
virtual QString | type () const =0 |
Return the type of the view: Icon, Table, etc. | |
virtual void | incrementalSearch (const QString &value, KABC::Field *field) |
This method can be overloaded in the subclass to implement incremental searching. | |
KABC::Field::List | fields () const |
Returns a list of the fields that should be displayed. | |
void | setFilter (const Filter &f) |
Sets the active filter. | |
DefaultFilterType | defaultFilterType () const |
const QString & | defaultFilterName () const |
KABC::AddressBook * | addressBook () const |
Protected Member Functions | |
KABC::Addressee::List | addressees () |
Returns a list of the addressees that should be displayed. | |
QWidget * | viewWidget () |
This method returns the widget that should be used as the parent for all view components. |
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 47 of file kaddressbookview.h.
Member Function Documentation
|
Must be overloaded in subclasses. Should return a list of all the uids of selected contacts. Implemented in KAddressBookCardView, KAddressBookIconView, and KAddressBookTableView. Referenced by ViewManager::copy(), ViewManager::cut(), ViewManager::deleteAddressee(), and selectedEmails(). |
|
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.
Reimplemented in KAddressBookCardView, KAddressBookIconView, and KAddressBookTableView. Definition at line 52 of file kaddressbookview.cpp. Referenced by ViewManager::modifyView(), KAddressBookTableView::readConfig(), KAddressBookIconView::readConfig(), KAddressBookCardView::readConfig(), and ViewManager::setActiveView(). |
|
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. Definition at line 65 of file kaddressbookview.cpp. Referenced by KAddressBookTableView::writeConfig(). |
|
Returns a QString with all the selected email addresses contactenated together with a ',' seperator.
Definition at line 70 of file kaddressbookview.cpp. References selectedUids(). Referenced by ViewManager::sendMail(). |
|
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 KAddressBookCardView, KAddressBookIconView, and KAddressBookTableView. Referenced by ViewManager::modifyView(). |
|
This method can be overloaded in the subclass to implement incremental searching. Incremental searching is where the user types in characters and after each character the selection is updated to select the item (addressee) that matches the search. For example, if this method is called with value being 'p', the selection should be moved to the first item with the field matching 'p'. If the user then typed 'r', making the value 'pr', the selection should be updated to the first item with the field matching 'pr'. If there is no item matching 'pr', the selection should remain on the last valid match. If the value is empty, select the first item.
Reimplemented in KAddressBookCardView, KAddressBookIconView, and KAddressBookTableView. Definition at line 131 of file kaddressbookview.cpp. Referenced by ViewManager::incSearch(), and ViewManager::jumpToLetter(). |
|
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 128 of file kaddressbookview.h. Referenced by KAddressBookTableView::incrementalSearch(), KAddressBookTableView::refresh(), KAddressBookIconView::refresh(), and KAddressBookCardView::refresh(). |
|
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. Referenced by ViewManager::filterActivated(). |
|
Definition at line 141 of file kaddressbookview.h. Referenced by ViewManager::modifyView(). |
|
Definition at line 146 of file kaddressbookview.h. Referenced by ViewManager::modifyView(). |
|
Definition at line 150 of file kaddressbookview.h. Referenced by KAddressBookTableView::refresh(), KAddressBookIconView::refresh(), and KAddressBookCardView::refresh(). |
|
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 KAddressBookCardView, KAddressBookIconView, and KAddressBookTableView. Referenced by ViewManager::addresseeModified(), ViewManager::cut(), ViewManager::deleteAddressee(), ViewManager::dropped(), ViewManager::filterActivated(), ViewManager::modifyView(), ViewManager::paste(), ViewManager::refresh(), and ViewManager::setActiveView(). |
|
This method must be overloaded in subclasses. Select (highlight) the addressee matching uid. If uid is equal to QString::null, then all addressees should be selected. Implemented in KAddressBookCardView, KAddressBookIconView, and KAddressBookTableView. Referenced by ViewManager::setSelected(). |
|
This signal should be emitted by a subclass whenever an addressee is modified.
|
|
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.
Referenced by KAddressBookTableView::addresseeSelected(), and KAddressBookCardView::refresh(). |
|
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.
Referenced by KAddressBookTableView::addresseeExecuted(), KAddressBookIconView::readConfig(), and KAddressBookCardView::readConfig(). |
|
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 QDragObject. |
|
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). |
|
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 106 of file kaddressbookview.cpp. References Filter::filterAddressee(). Referenced by KAddressBookTableView::refresh(), KAddressBookIconView::refresh(), and KAddressBookCardView::refresh(). |
|
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 221 of file kaddressbookview.h. |
The documentation for this class was generated from the following files: