~zsombi/ubuntu-ui-toolkit/labelThemingFix

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/label_p.h

  • Committer: Zsombor Egri
  • Date: 2016-03-11 12:16:11 UTC
  • Revision ID: zsombor.egri@canonical.com-20160311121611-rtwu7u5lv6zyrcam
introduce Label's PIMPL

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2016 Canonical Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#ifndef LABEL_P
 
18
#define LABEL_P
 
19
 
 
20
#include "uclabel.h"
 
21
 
 
22
class UCLabelPrivate
 
23
{
 
24
    Q_DECLARE_PUBLIC(UCLabel)
 
25
public:
 
26
    explicit UCLabelPrivate(UCLabel *qq);
 
27
    UCLabelPrivate(UCLabel *qq, UCLabel::ColorProviderFunc func);
 
28
 
 
29
    static UCLabelPrivate *get(UCLabel *q)
 
30
    {
 
31
        return q->d_func();
 
32
    }
 
33
 
 
34
    void init();
 
35
 
 
36
    // slots
 
37
    void updateRenderType();
 
38
    void _q_updateFontFlag(const QFont &font);
 
39
    void _q_customColor();
 
40
 
 
41
    // methods
 
42
    void updatePixelSize();
 
43
 
 
44
    // members
 
45
    enum {
 
46
        TextSizeSet = 1,
 
47
        PixelSizeSet = 2,
 
48
        ColorSet = 4
 
49
    };
 
50
 
 
51
    UCLabel *q_ptr;
 
52
    QFont defaultFont;
 
53
    UCLabel::ColorProviderFunc defaultColor;
 
54
    UCLabel::TextSize textSize;
 
55
    quint8 flags;
 
56
 
 
57
protected:
 
58
    static QColor getDefaultColor(QQuickItem *item, UCTheme *theme);
 
59
};
 
60
 
 
61
#endif // LABEL_P
 
62