21 #ifndef TEMPLATELISTVIEW_H
22 #define TEMPLATELISTVIEW_H
27 #include <tdelistview.h>
29 #include "eventlistviewbase.h"
31 class TemplateListView;
34 class TemplateListViewItem :
public EventListViewItemBase
37 TemplateListViewItem(TemplateListView* parent,
const KAEvent&);
38 TemplateListView* templateListView()
const {
return (TemplateListView*)listView(); }
40 TemplateListViewItem* nextSibling()
const {
return (TemplateListViewItem*)TQListViewItem::nextSibling(); }
41 virtual TQString key(
int column,
bool ascending)
const;
43 virtual TQString lastColumnText()
const;
49 class TemplateListView :
public EventListViewBase
54 explicit TemplateListView(
bool includeCmdAlarms,
const TQString& whatsThisText, TQWidget* parent = 0,
const char* name = 0);
56 int iconColumn()
const {
return mIconColumn; }
57 int nameColumn()
const {
return mNameColumn; }
59 static void addEvent(
const KAEvent& e, EventListViewBase* v)
60 { EventListViewBase::addEvent(e, mInstanceList, v); }
61 static void modifyEvent(
const KAEvent& e, EventListViewBase* v)
62 { EventListViewBase::modifyEvent(e.id(), e, mInstanceList, v); }
63 static void modifyEvent(
const TQString& oldEventID,
const KAEvent& newEvent, EventListViewBase* v)
64 { EventListViewBase::modifyEvent(oldEventID, newEvent, mInstanceList, v); }
65 static void deleteEvent(
const TQString& eventID)
66 { EventListViewBase::deleteEvent(eventID, mInstanceList); }
67 TemplateListViewItem* getEntry(
const TQString& eventID) {
return (TemplateListViewItem*)EventListViewBase::getEntry(eventID); }
68 TemplateListViewItem* selectedItem()
const {
return (TemplateListViewItem*)EventListViewBase::selectedItem(); }
69 TemplateListViewItem* currentItem()
const {
return (TemplateListViewItem*)EventListViewBase::currentItem(); }
70 TemplateListViewItem* firstChild()
const {
return (TemplateListViewItem*)EventListViewBase::firstChild(); }
71 virtual void setSelected(TQListViewItem* item,
bool selected) { EventListViewBase::setSelected(item, selected); }
72 virtual void setSelected(TemplateListViewItem* item,
bool selected) { EventListViewBase::setSelected(item, selected); }
73 virtual TQValueList<EventListViewBase*> instances() {
return mInstanceList; }
76 virtual void populate();
77 EventListViewItemBase* createItem(
const KAEvent&);
78 virtual TQString whatsThisText(
int column)
const;
81 static TQValueList<EventListViewBase*> mInstanceList;
82 TQString mWhatsThisText;
85 bool mExcludeCmdAlarms;
KAEvent corresponds to a KCal::Event instance.