UB.h 5.66 KB
Newer Older
Claudio Valerio's avatar
Claudio Valerio committed
1
/*
Craig Watson's avatar
Craig Watson committed
2 3
 * Copyright (C) 2015-2016 Département de l'Instruction Publique (DIP-SEM)
 *
Claudio Valerio's avatar
Claudio Valerio committed
4
 * Copyright (C) 2013 Open Education Foundation
Claudio Valerio's avatar
Claudio Valerio committed
5
 *
Claudio Valerio's avatar
Claudio Valerio committed
6 7
 * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour
 * l'Education Numérique en Afrique (GIP ENA)
8
 *
Claudio Valerio's avatar
Claudio Valerio committed
9 10 11
 * This file is part of OpenBoard.
 *
 * OpenBoard is free software: you can redistribute it and/or modify
Claudio Valerio's avatar
Claudio Valerio committed
12 13
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License,
14 15 16 17
 * with a specific linking exception for the OpenSSL project's
 * "OpenSSL" library (or with modified versions of it that use the
 * same license as the "OpenSSL" library).
 *
Claudio Valerio's avatar
Claudio Valerio committed
18
 * OpenBoard is distributed in the hope that it will be useful,
Claudio Valerio's avatar
Claudio Valerio committed
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Claudio Valerio's avatar
Claudio Valerio committed
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Claudio Valerio's avatar
Claudio Valerio committed
21
 * GNU General Public License for more details.
Claudio Valerio's avatar
Claudio Valerio committed
22
 *
Claudio Valerio's avatar
Claudio Valerio committed
23
 * You should have received a copy of the GNU General Public License
Claudio Valerio's avatar
Claudio Valerio committed
24
 * along with OpenBoard. If not, see <http://www.gnu.org/licenses/>.
Claudio Valerio's avatar
Claudio Valerio committed
25 26
 */

27

Claudio Valerio's avatar
Claudio Valerio committed
28

Claudio Valerio's avatar
Claudio Valerio committed
29

Claudio Valerio's avatar
Claudio Valerio committed
30 31 32
#ifndef UB_H_
#define UB_H_

33 34
#include <QtWidgets>

Claudio Valerio's avatar
Claudio Valerio committed
35

36
#define UB_MAX_ZOOM 9
Claudio Valerio's avatar
Claudio Valerio committed
37

38 39 40 41 42 43 44 45 46 47 48 49
struct UBMimeType
{
    enum Enum
    {
        RasterImage = 0,
        VectorImage,
        AppleWidget,
        W3CWidget,
        Video,
        Audio,
        Flash,
        PDF,
50
        OpenboardTool,
51
        Group,
52 53 54 55
        UNKNOWN
    };
};

Claudio Valerio's avatar
Claudio Valerio committed
56 57 58 59
struct UBStylusTool
{
    enum Enum
    {
60 61 62 63
        Pen = 0,
        Eraser,
        Marker,
        Selector,
64
        Play,
65 66 67 68 69 70
        Hand,
        ZoomIn,
        ZoomOut,
        Pointer,
        Line,
        Text,
Claudio Valerio's avatar
Claudio Valerio committed
71
        Capture
Claudio Valerio's avatar
Claudio Valerio committed
72 73 74 75 76 77 78 79 80 81 82
    };
};

struct UBWidth
{
    enum Enum
    {
        Fine = 0, Medium, Strong
    };
};

83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
struct UBZoom
{
    enum Enum
    {
        Small = 0, Medium, Large
    };
};

struct UBSize
{
    enum Enum
    {
        Small = 0, Medium, Large
    };
};

shibakaneki's avatar
shibakaneki committed
99
// Deprecated. Keep it for backward campability with old versions
Claudio Valerio's avatar
Claudio Valerio committed
100 101 102 103 104 105 106 107
struct UBItemLayerType
{
    enum Enum
    {
        FixedBackground = -2000, Object = -1000, Graphic = 0, Tool = 1000, Control = 2000
    };
};

shibakaneki's avatar
shibakaneki committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121
struct itemLayerType
{
    enum Enum {
        NoLayer = 0
        , BackgroundItem
        , ObjectItem
        , DrawingItem
        , ToolItem
        , CppTool
        , Eraiser
        , Curtain
        , Pointer
        , Cache
        , SelectedItem
122
        , SelectionFrame
shibakaneki's avatar
shibakaneki committed
123 124 125 126
    };
};


Claudio Valerio's avatar
Claudio Valerio committed
127 128 129 130
struct UBGraphicsItemData
{
    enum Enum
    {
shibakaneki's avatar
shibakaneki committed
131
        ItemLayerType //Deprecated. Keep it for backward campability with old versions. Use itemLayerType instead
132 133
        , ItemLocked
        , ItemEditable//for text only
134
        , ItemOwnZValue
shibakaneki's avatar
shibakaneki committed
135
        , itemLayerType //use instead of deprecated ItemLayerType
Ivan Ilyin's avatar
Ivan Ilyin committed
136
        , ItemUuid //storing uuid in QGraphicsItem for fast finding operations
137 138 139
        //Duplicating delegate's functions to make possible working with pure QGraphicsItem
        , ItemFlippable // (bool)
        , ItemRotatable // (bool)
Claudio Valerio's avatar
Claudio Valerio committed
140 141 142
    };
};

shibakaneki's avatar
shibakaneki committed
143 144


Claudio Valerio's avatar
Claudio Valerio committed
145 146 147 148
struct UBGraphicsItemType
{
    enum Enum
    {
149
        PolygonItemType = QGraphicsItem::UserType + 1,
Claudio Valerio's avatar
Claudio Valerio committed
150
        PixmapItemType,
151
        SvgItemType,
152
        DelegateButtonType,
153
        MediaItemType,
154 155
        VideoItemType,
        AudioItemType,
156
        PDFItemType,
Claudio Valerio's avatar
Claudio Valerio committed
157 158
        TextItemType,
        CurtainItemType,
159
        RulerItemType,
160 161
        CompassItemType,
        ProtractorItemType,
Claudio Valerio's avatar
Claudio Valerio committed
162 163
        StrokeItemType,
        TriangleItemType,
164
        MagnifierItemType,
Ivan Ilyin's avatar
Ivan Ilyin committed
165
        cacheItemType,
166
        groupContainerType,
167
        ToolWidgetItemType,
168
        GraphicsWidgetItemType,
169
        UserTypesCount,
170
        SelectionFrameType// this line must be the last line in this enum because it is types counter.
Claudio Valerio's avatar
Claudio Valerio committed
171 172 173
    };
};

174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
// Might be fit in int value under most OS
enum UBGraphicsFlag {
    GF_NONE                          = 0x0000 //0000 0000 0000 0000
    ,GF_FLIPPABLE_X_AXIS             = 0x0001 //0000 0000 0000 0001
    ,GF_FLIPPABLE_Y_AXIS             = 0x0002 //0000 0000 0000 0010
    ,GF_FLIPPABLE_ALL_AXIS           = 0x0003 //0000 0000 0000 0011 GF_FLIPPABLE_X_AXIS | GF_FLIPPABLE_Y_AXIS
    ,GF_REVOLVABLE                   = 0x0004 //0000 0000 0000 0100
    ,GF_SCALABLE_X_AXIS              = 0x0008 //0000 0000 0000 1000
    ,GF_SCALABLE_Y_AXIS              = 0x0010 //0000 0000 0001 0000
    ,GF_SCALABLE_ALL_AXIS            = 0x0018 //0000 0000 0001 1000 GF_SCALABLE_X_AXIS | GF_SCALABLE_Y_AXIS
    ,GF_DUPLICATION_ENABLED          = 0x0020 //0000 0000 0010 0000
    ,GF_MENU_SPECIFIED               = 0x0040 //0000 0000 0100 0000
    ,GF_ZORDER_MANIPULATIONS_ALLOWED = 0x0080 //0000 0000 1000 0000
    ,GF_TOOLBAR_USED                 = 0x0100 //0000 0001 0000 0000
    ,GF_SHOW_CONTENT_SOURCE          = 0x0200 //0000 0010 0000 0000
    ,GF_RESPECT_RATIO                = 0x0418 //0000 0100 0001 1000
190
    ,GF_TITLE_BAR_USED               = 0x0800 //0000 1000 0000 0000
191 192 193 194 195 196 197 198 199
    ,GF_COMMON                       = 0x00F8 /*0000 0000 1111 1000   GF_SCALABLE_ALL_AXIS
                                                                     |GF_DUPLICATION_ENABLED
                                                                     |GF_MENU_SPECIFIED
                                                                     |GF_ZORDER_MANIPULATIONS_ALLOWED */
    ,GF_ALL                          = 0xFFFF //1111 1111 1111 1111
};
Q_DECLARE_FLAGS(UBGraphicsFlags, UBGraphicsFlag)
Q_DECLARE_OPERATORS_FOR_FLAGS(UBGraphicsFlags )

Claudio Valerio's avatar
Claudio Valerio committed
200 201 202 203 204 205 206 207
struct DocumentSizeRatio
{
    enum Enum
    {
        Ratio4_3 = 0, Ratio16_9, Custom
    };
};

208 209 210 211 212

struct UBUndoType
{
    enum Enum
    {
213
        undotype_UNKNOWN  = 0, undotype_DOCUMENT, undotype_GRAPHICITEMTRANSFORM, undotype_GRAPHICITEM, undotype_GRAPHICTEXTITEM, undotype_PAGESIZE, undotype_GRAPHICSGROUPITEM, undotype_GRAPHICITEMZVALUE
214 215 216
    };
};

Craig Watson's avatar
Craig Watson committed
217 218 219 220 221 222 223
enum UBPageBackground
{
    plain = 0,
    crossed,
    ruled
};

Claudio Valerio's avatar
Claudio Valerio committed
224
#endif /* UB_H_ */