aboutsummaryrefslogtreecommitdiff
path: root/src/views/mcontentitemview_p.h
blob: 97aeba7f29e04af54344e69b60778e9375cef895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of libmeegotouch.
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#ifndef MCONTENTITEM_P_H__
#define MCONTENTITEM_P_H__

#include "mcontentitemstyle.h"
#include "mcontentitem.h"
#include "private/mwidgetview_p.h"
#include "mcontentitemstyle.h"

class MLabel;
class MImageWidget;
class MScalableImage;
class QGraphicsGridLayout;

class MContentItemViewPrivate : public MWidgetViewPrivate
{
    Q_DECLARE_PUBLIC(MContentItemView)

public:
    MContentItemViewPrivate();
    virtual ~MContentItemViewPrivate();

    inline MLabel * title();
    inline MLabel * subtitle();
    inline MImageWidget * image();
    inline MImageWidget * optionalImage();

    inline void setTitle(const QString& string);
    inline void setSubtitle(const QString& string);
    inline void setPixmap(const QPixmap& pixmap);
    inline void setOptionalPixmap(const QPixmap& pixmap);
    inline void setImage(const QImage& image);
    inline void setImage(const QString& id, const QSize &s);
    inline void setOptionalImage(const QImage& image);
    inline void setOptionalImage(const QString& id, const QSize &s);

    void initLayout(MContentItem::ContentItemStyle style);
    void clearLayout();
    void initTwoIconsTwoWidgetsLayout();

    void applyStyle();
    void refreshStyleMode();

    typedef const MScalableImage*(MContentItemStyle::*backgroundFunc)() const;

    static void initBackgroundFunctions();
    static QVector<backgroundFunc> backgroundFunctions;
private:
    MContentItem *controller;
    MLabel *titleLabel;
    MLabel *subtitleLabel;
    MImageWidget *imageWidget;
    QGraphicsGridLayout *layout;
    int configuredStyle;
    bool down;
    MImageWidget * optionalImageWidget;
};

#endif