summaryrefslogtreecommitdiff
path: root/tizen/src/ui/xmllayoutparser.h
blob: 6e01a0231f792cec65a293440d8227c588bacd48 (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
/*
 * Qt UI
 *
 * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Contact:
 * GiWoong Kim <giwoong.kim@samsung.com>
 * Sangho Park <sangho1206.park@samsung.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 *
 * Contributors:
 * - S-Core Co., Ltd
 *
 */

#ifndef XMLLAYOUTPARSER_H
#define XMLLAYOUTPARSER_H

#include <QXmlStreamReader>

#include "uiinformation.h"
#include "layout/keycodetype.h"
#include "layout/mainform.h"
#include "layout/controllerform.h"
#include "menu/menuitem.h"
#include "menu/advancedmenuitem.h"
#include "menu/scalemenuitem.h"


class XmlLayoutParser
{
public:
    XmlLayoutParser(QString path, UIInformation *uiInfo /* out */);

    QString parseEmulatorUI(QXmlStreamReader &xml);
    QString parseControllerUI(QXmlStreamReader &xml);

private:
    QColor parseColor(QXmlStreamReader &xml);
    HoverType *parseHover(QXmlStreamReader &xml);
    QRect parseRegion(QXmlStreamReader &xml);
    DisplayType *parseDisplay(QXmlStreamReader &xml);
    KeycodeType *parseKeycode(QXmlStreamReader &xml);
    HardwareKey *parseKey(QXmlStreamReader &xml);
    int parseKeyList(QXmlStreamReader &xml, QList<HardwareKey *> &list);
    MainForm *parseMainForm(QXmlStreamReader &xml);
    int parseMainFormList(QXmlStreamReader &xml, QList<MainForm *> &list);

    int parseFactorList(QXmlStreamReader &xml, QMap<int, QString> &map, int *defaultFactor);
    int parseShortcut(QXmlStreamReader &xml, QMap<QString, QString> &map);
    AdvancedMenuItem *parseAdvancedMenuItem(QXmlStreamReader &xml);
    ScaleMenuItem *parseScaleMenuItem(QXmlStreamReader &xml);
    MenuItem *parseGeneralMenuItem(QXmlStreamReader &xml, int menuType);
    int parseMenuList(QXmlStreamReader &xml, QList<MenuItem *> &list);

    ControllerForm *parseControllerForm(QXmlStreamReader &xml);

    QString xmlPath;
    UIInformation *uiInfo;
};

#endif // XMLLAYOUTPARSER_H