krop's commit fixes my problem in a better way, reverting
[kdepim.git] / korganizer / kodecorationlabel.h
bloba120f2666f88763f88babc54af0937d9f3641c43
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 2000,2001,2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 Copyright (C) 2007 Loïc Corbasson <loic.corbasson@gmail.com>
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.
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.
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 As a special exception, permission is given to link this program
23 with any edition of Qt, and distribute the resulting executable,
24 without including the source code for Qt in the source distribution.
26 #ifndef KODECORATIONLABEL_H
27 #define KODECORATIONLABEL_H
29 #include "calendar/calendardecoration.h"
31 #include <KUrl>
33 #include <QtGui/QLabel>
35 class KODecorationLabel : public QLabel
37 Q_OBJECT
39 public:
40 explicit KODecorationLabel( KOrg::CalendarDecoration::Element *e,
41 QWidget *parent = 0 );
42 explicit KODecorationLabel( const QString &shortText,
43 const QString &longText = QString(),
44 const QString &extensiveText = QString(),
45 const QPixmap &pixmap = QPixmap(),
46 const KUrl &url = KUrl(),
47 QWidget *parent = 0 );
48 ~KODecorationLabel();
50 public slots:
51 void setExtensiveText( const QString & );
52 void setLongText( const QString & );
53 void setPixmap( const QPixmap & );
54 void setShortText( const QString & );
55 void setText( const QString & );
56 void setUrl( const KUrl & );
57 void useShortText( bool allowAutomaticSqueeze = false );
58 void useLongText( bool allowAutomaticSqueeze = false );
59 void useExtensiveText( bool allowAutomaticSqueeze = false );
60 void usePixmap( bool allowAutomaticSqueeze = false );
61 void useDefaultText();
63 protected:
64 virtual void resizeEvent( QResizeEvent * );
65 virtual void mouseReleaseEvent( QMouseEvent * );
66 virtual void squeezeContentsToLabel();
67 bool mAutomaticSqueeze;
68 KOrg::CalendarDecoration::Element *mDecorationElement;
69 QString mShortText, mLongText, mExtensiveText;
70 QPixmap mPixmap;
71 KUrl mUrl;
74 #endif