~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to korganizer/views/listview/kolistview.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#define KOLISTVIEW_H
28
28
 
29
29
#include "koeventview.h"
30
 
#include "customlistviewitem.h"
31
 
 
32
 
#include <KCal/Incidence>
 
30
 
 
31
#include <KCalCore/Incidence>
 
32
 
 
33
#include <calendarviews/eventviews/list/listview.h>
33
34
 
34
35
#include <QHash>
35
36
#include <QList>
36
37
 
37
 
using namespace KCal;
38
 
 
39
 
typedef CustomListViewItem<Incidence *> KOListViewItem;
 
38
using namespace KCalCore;
 
39
 
 
40
namespace CalendarSupport {
 
41
  class Calendar;
 
42
}
 
43
 
40
44
 
41
45
class KOListView;
42
 
 
43
 
#if 0
44
 
class KOListViewToolTip : public QToolTip
45
 
{
46
 
  public:
47
 
    KOListViewToolTip ( QWidget *parent, K3ListView *lv );
48
 
 
49
 
  protected:
50
 
    void maybeTip( const QPoint &pos );
51
 
 
52
 
  private:
53
 
    K3ListView *eventlist;
54
 
};
55
 
#endif
56
 
 
57
 
/**
58
 
  This class provides a multi-column list view of events.  It can
59
 
  display events from one particular day or several days, it doesn't
60
 
  matter.  To use a view that only handles one day at a time, use
61
 
  KODayListView.
62
 
 
63
 
  @short multi-column list view of various events.
64
 
  @author Preston Brown <pbrown@kde.org>
65
 
  @see KOBaseView, KODayListView
66
 
*/
 
46
class KOEventPopupMenu;
 
47
 
 
48
namespace EventViews {
 
49
  class ListView;
 
50
}
 
51
 
67
52
class KOListView : public KOEventView
68
53
{
69
54
  Q_OBJECT
70
55
  public:
71
 
    explicit KOListView( Calendar *calendar, QWidget *parent = 0 );
 
56
  explicit KOListView( CalendarSupport::Calendar *calendar,
 
57
                       QWidget *parent = 0,  bool nonInteractive = false );
72
58
    ~KOListView();
73
59
 
74
 
    virtual int maxDatesHint();
75
 
    virtual int currentDateCount();
76
 
    virtual Incidence::List selectedIncidences();
 
60
    virtual int maxDatesHint() const;
 
61
    virtual int currentDateCount() const;
 
62
    virtual Akonadi::Item::List selectedIncidences();
77
63
    virtual DateList selectedIncidenceDates();
78
64
 
79
65
    void showDates( bool show );
80
66
 
 
67
    // Shows all incidences of the calendar
 
68
    void showAll();
 
69
 
81
70
    void readSettings( KConfig *config );
82
71
    void writeSettings( KConfig *config );
83
72
 
84
73
    void clear();
85
 
    virtual KOrg::CalPrinterBase::PrintType printType();
 
74
    QSize sizeHint() const;
 
75
 
 
76
    void setCalendar( CalendarSupport::Calendar *cal );
 
77
    void setIncidenceChanger( CalendarSupport::IncidenceChanger *changer );
 
78
 
 
79
    virtual KOrg::CalPrinterBase::PrintType printType() const;
86
80
 
87
81
  public slots:
88
82
    virtual void updateView();
89
 
    virtual void showDates( const QDate &start, const QDate &end );
90
 
    virtual void showIncidences( const Incidence::List &incidenceList, const QDate &date );
 
83
    virtual void showDates( const QDate &start, const QDate &end, const QDate &preferredMonth = QDate() );
 
84
    virtual void showIncidences( const Akonadi::Item::List &incidenceList, const QDate &date );
91
85
 
92
86
    void clearSelection();
93
87
 
94
88
    void showDates();
95
89
    void hideDates();
96
90
 
97
 
    void changeIncidenceDisplay( Incidence *, int );
98
 
 
99
 
    void defaultItemAction( Q3ListViewItem *item );
100
 
    void popupMenu( Q3ListViewItem *item, const QPoint &, int );
101
 
 
102
 
  protected slots:
103
 
    void processSelectionChange();
104
 
 
105
 
  protected:
106
 
    void addIncidences( const Incidence::List &incidenceList, const QDate & );
107
 
    void addIncidence( Incidence *incidence, const QDate &date );
108
 
    KOListViewItem *getItemForIncidence( Incidence *incidence );
 
91
    void changeIncidenceDisplay( const Akonadi::Item &, int );
 
92
 
 
93
    void defaultItemAction( const QModelIndex & );
 
94
    void defaultItemAction( const Akonadi::Item::Id id );
 
95
 
 
96
    void popupMenu( const QPoint & );
109
97
 
110
98
  private:
111
 
    class ListItemVisitor;
112
 
    K3ListView *mListView;
113
99
    KOEventPopupMenu *mPopupMenu;
114
 
    KOListViewItem *mActiveItem;
115
 
    QList<QString> mUidList;
116
 
    QHash<QString, QDate> mDateList;
117
 
    QDate mStartDate;
118
 
    QDate mEndDate;
119
 
    DateList mSelectedDates;
 
100
    EventViews::ListView *mListView;
 
101
 
120
102
};
121
103
 
122
104
#endif