summaryrefslogtreecommitdiff
path: root/meego/meego-im-defs.h
blob: 85443bc0d8b8c6dad2ab6decff9001838014c54f (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* * This file partially from the meego-im-framework *
 *
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * Contact: Nokia Corporation (directui@nokia.com)
 *
 * 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 MEEGO_IM_DEFS_H
#define MEEGO_IM_DEFS_H

#include <glib.h>

enum MeegoImOrientationAngle {
    MeegoImAngle0   =   0,
    MeegoImAngle90  =  90,
    MeegoImAngle180 = 180,
    MeegoImAngle270 = 270
};

/*!
 * This enum contains possible values for orientation of windows in the application.
 *
 * \sa OrientationAngle
 */
enum MeegoImOrientation {
    MeegoImPortrait, //!< equal to either M::Angle90 or M::Angle270 orientation angles
    MeegoImLandscape //!< equal to either M::Angle0 or M::Angle180 orientation angles
};

//! Content type for text entries. Used at least with MTextEdit
enum MeegoImTextContentType {
    //! all characters allowed
    MeegoImFreeTextContentType,

    //! only integer numbers allowed
    MeegoImNumberContentType,

    //! allows numbers and certain other characters used in phone numbers
    MeegoImPhoneNumberContentType,

    //! allows only characters permitted in email address
    MeegoImEmailContentType,

    //! allows only character permitted in URL address
    MeegoImUrlContentType,

    //! allows content with user defined format
    MeegoImCustomContentType
};

enum MeegoImInputMethodMode {
    //! Normal mode allows to use preedit and error correction
    MeegoImInputMethodModeNormal,

    //! Virtual keyboard sends QKeyEvent for every key press or release
    MeegoImInputMethodModeDirect,

    //! Used with proxy widget
    MeegoImInputMethodModeProxy
};

typedef enum _MeegoImPreeditFace {
    MeegoImPreeditDefault,
    MeegoImPreeditNoCandidates,
    MeegoImPreeditKeyPress           //! Used for displaying the hwkbd key just pressed
} MeegoImPreeditFace;

typedef struct _MeegoImPreeditFormat {
	int start;
	int length;
	MeegoImPreeditFace face;
} MeegoImPreeditFormat;

typedef struct _MeegoImKeyEvent
{
	gboolean release;
	unsigned int state;
	unsigned int keysym;
	char *text;
} MeegoImKeyEvent;

#endif