korganizer

kolistview.h
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 1999 Preston Brown <pbrown@kde.org>
5  Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
6  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.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 #ifndef _KOLISTVIEW_H
27 #define _KOLISTVIEW_H
28 
29 #include <tqdict.h>
30 #include <tqmap.h>
31 #include <tqtooltip.h>
32 
33 #include <libkcal/incidence.h>
34 
35 #include "koeventview.h"
36 #include "customlistviewitem.h"
37 
38 using namespace KCal;
39 
40 typedef CustomListViewItem<Incidence *> KOListViewItem;
41 
42 class KOListView;
43 
44 class KOListViewToolTip : public TQToolTip
45 {
46  public:
47  KOListViewToolTip ( TQWidget* parent, Calendar *calendar, TDEListView* lv );
48 
49  protected:
50  void maybeTip( const TQPoint &pos );
51 
52  private:
53  Calendar *mCalendar;
54  TDEListView* eventlist;
55 };
56 
57 
68 class KOListView : public KOEventView
69 {
70  TQ_OBJECT
71 
72  public:
73  explicit KOListView( Calendar *calendar,
74  TQWidget *parent = 0,
75  const char *name = 0,
76  bool nonInteractive = false );
77  ~KOListView();
78 
79  virtual int maxDatesHint();
80  virtual int currentDateCount();
81  virtual Incidence::List selectedIncidences();
82  virtual DateList selectedIncidenceDates();
83 
84  void showDates( bool show );
85 
86  // Shows all incidences of the calendar
87  void showAll();
88 
89  void readSettings(TDEConfig *config);
90  void writeSettings(TDEConfig *config);
91 
92  void clear();
93  TQSize sizeHint() const;
94 
95  public slots:
96  virtual void updateView();
97  virtual void showDates( const TQDate &start, const TQDate &end );
98  virtual void showIncidences( const Incidence::List &incidenceList, const TQDate &date );
99 
100  void clearSelection();
101 
102  void showDates();
103  void hideDates();
104 
105  void changeIncidenceDisplay(Incidence *, int);
106 
107  void defaultItemAction(TQListViewItem *item);
108  void popupMenu(TQListViewItem *item,const TQPoint &,int);
109 
110  protected slots:
111  void processSelectionChange();
112 
113  protected:
114  void addIncidences(const Incidence::List &, const TQDate &date);
115  void addIncidence(Incidence *, const TQDate &date);
116  KOListViewItem *getItemForIncidence(Incidence *incidence);
117 
118  private:
119  class ListItemVisitor;
120  TDEListView *mListView;
121  KOEventPopupMenu *mPopupMenu;
122  KOListViewItem *mActiveItem;
123  TQDict<Incidence> mUidDict;
124  TQMap<TQString, TQDate>mDateList;
125  DateList mSelectedDates;
126 
127  // if it's non interactive we disable context menu, and incidence editing
128  bool mIsNonInteractive;
129 };
130 
131 #endif
KOEventView is the abstract base class from which all other calendar views for event data are derived...
Definition: koeventview.h:56
This class provides a multi-column list view of events.
Definition: kolistview.h:69