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

« back to all changes in this revision

Viewing changes to calendarviews/eventviews/agenda/alternatelabel.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:
 
1
/*
 
2
  Copyright (c) 2000,2001,2003 Cornelius Schumacher <schumacher@kde.org>
 
3
  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU General Public License as published by
 
7
  the Free Software Foundation; either version 2 of the License, or
 
8
  (at your option) any later version.
 
9
 
 
10
  This program is distributed in the hope that it will be useful,
 
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
13
  GNU General Public License for more details.
 
14
 
 
15
  You should have received a copy of the GNU General Public License along
 
16
  with this program; if not, write to the Free Software Foundation, Inc.,
 
17
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
18
 
 
19
  As a special exception, permission is given to link this program
 
20
  with any edition of Qt, and distribute the resulting executable,
 
21
  without including the source code for Qt in the source distribution.
 
22
*/
 
23
#ifndef EVENTVIEWS_ALTERNATELABEL_H
 
24
#define EVENTVIEWS_ALTERNATELABEL_H
 
25
 
 
26
#include "eventviews_export.h"
 
27
 
 
28
#include <QLabel>
 
29
 
 
30
namespace EventViews {
 
31
 
 
32
class EVENTVIEWS_EXPORT AlternateLabel : public QLabel
 
33
{
 
34
  Q_OBJECT
 
35
  public:
 
36
    AlternateLabel( const QString &shortlabel, const QString &longlabel,
 
37
                    const QString &extensivelabel = QString(), QWidget *parent = 0 );
 
38
    ~AlternateLabel();
 
39
 
 
40
    virtual QSize minimumSizeHint() const;
 
41
 
 
42
    enum TextType {
 
43
      Short = 0,
 
44
      Long = 1,
 
45
      Extensive = 2
 
46
    };
 
47
 
 
48
    TextType largestFittingTextType() const;
 
49
    void setFixedType( TextType type );
 
50
 
 
51
  public slots:
 
52
    void useShortText();
 
53
    void useLongText();
 
54
    void useExtensiveText();
 
55
    void useDefaultText();
 
56
 
 
57
  protected:
 
58
    virtual void resizeEvent( QResizeEvent * );
 
59
    virtual void squeezeTextToLabel();
 
60
    bool mTextTypeFixed;
 
61
    QString mShortText, mLongText, mExtensiveText;
 
62
};
 
63
 
 
64
}
 
65
 
 
66
#endif