calendardecoration.h
1 /*
2  This file is part of the KOrganizer interfaces.
3 
4  Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 #ifndef KORG_CALENDARDECORATION_H
22 #define KORG_CALENDARDECORATION_H
23 
24 #include <tqstring.h>
25 #include <tqdatetime.h>
26 #include <tqpixmap.h>
27 
28 #include <klibloader.h>
29 
30 #include "plugin.h"
31 
32 namespace KOrg {
33 
40 class CalendarDecoration : public Plugin
41 {
42  public:
43  static int interfaceVersion() { return 2; }
44  static TQString serviceType() { return "Calendar/Decoration"; }
45 
46  typedef TQPtrList<CalendarDecoration> List;
47 
49  virtual ~CalendarDecoration() {}
50 
54  virtual TQString shortText( const TQDate & ) { return TQString(); }
59  virtual TQString longText( const TQDate & ) { return TQString(); }
60 
64  virtual TQPixmap smallPixmap( const TQDate &) { return TQPixmap(); }
68  virtual TQPixmap largePixmap( const TQDate &) { return TQPixmap(); }
69 
73  virtual TQWidget *smallWidget( TQWidget *, const TQDate & ) { return 0; }
74 };
75 
76 class CalendarDecorationFactory : public PluginFactory
77 {
78  public:
79  virtual CalendarDecoration *create() = 0;
80 };
81 
82 }
83 
84 #endif
This class provides the interface for a date dependent decoration.
virtual TQString longText(const TQDate &)
Return along text for a given date.
virtual TQString shortText(const TQDate &)
Return a short text for a given date, ususally only a few words.
virtual TQPixmap largePixmap(const TQDate &)
Return a large pixmap.
virtual TQWidget * smallWidget(TQWidget *, const TQDate &)
Return a small widget.
virtual TQPixmap smallPixmap(const TQDate &)
Return a small pixmap.