35 \class HbInputModeProperties |
35 \class HbInputModeProperties |
36 \brief Binds together all the properties that define an input mode. |
36 \brief Binds together all the properties that define an input mode. |
37 |
37 |
38 This class is needed when the framework resolves input state handler. An input method |
38 This class is needed when the framework resolves input state handler. An input method |
39 plugin reports a set of implemented input modes as an array of HbInputModeProperties |
39 plugin reports a set of implemented input modes as an array of HbInputModeProperties |
40 coverted to strings. |
40 converted to strings. |
41 |
41 |
42 This class is not needed in application code. |
42 This class is not needed in application code. |
43 |
43 |
44 \sa HbInputState |
44 \sa HbInputState |
45 \sa HbInputMethod |
45 \sa HbInputMethod |
46 */ |
46 */ |
47 class HbInputModeProperties |
47 class HbInputModeProperties |
48 { |
48 { |
49 public: |
49 public: |
50 HbInputModeProperties() |
50 HbInputModeProperties() { |
51 { |
|
52 } |
51 } |
53 |
52 |
54 HbInputModeProperties(HbInputModeType mode, const HbInputLanguage &language, HbKeyboardType keyboard) |
53 HbInputModeProperties(HbInputModeType mode, const HbInputLanguage &language, HbKeyboardType keyboard) |
55 : iMode(mode), iLanguage(language), iKeyboard(keyboard) |
54 : mMode(mode), mLanguage(language), mKeyboard(keyboard) { |
56 { |
|
57 } |
55 } |
58 |
56 |
59 HbInputModeProperties& operator=(const HbInputModeProperties& other) { |
57 HbInputModeProperties &operator=(const HbInputModeProperties &other) { |
60 iMode = other.iMode; |
58 mMode = other.mMode; |
61 iLanguage = other.iLanguage; |
59 mLanguage = other.mLanguage; |
62 iKeyboard = other.iKeyboard; |
60 mKeyboard = other.mKeyboard; |
63 return *this; |
61 return *this; |
64 } |
62 } |
65 |
63 |
66 bool operator==(const HbInputModeProperties& other) const { |
64 bool operator==(const HbInputModeProperties &other) const { |
67 if (iMode == other.iMode |
65 if (mMode == other.mMode |
68 && iLanguage == other.iLanguage |
66 && mLanguage == other.mLanguage |
69 && iKeyboard == other.iKeyboard) { |
67 && mKeyboard == other.mKeyboard) { |
70 return true; |
68 return true; |
71 } |
69 } |
72 return false; |
70 return false; |
73 } |
71 } |
74 |
72 |
75 bool operator!=(const HbInputModeProperties& other) const { |
73 bool operator!=(const HbInputModeProperties &other) const { |
76 if (iMode != other.iMode |
74 if (mMode != other.mMode |
77 || iLanguage != other.iLanguage |
75 || mLanguage != other.mLanguage |
78 || iKeyboard != other.iKeyboard) { |
76 || mKeyboard != other.mKeyboard) { |
79 return true; |
77 return true; |
80 } |
78 } |
81 return false; |
79 return false; |
82 } |
80 } |
83 |
81 |
84 /*! |
82 /*! |
85 Returns input mode. |
83 Returns input mode. |
86 */ |
84 */ |
87 HbInputModeType inputMode() const { return iMode; } |
85 HbInputModeType inputMode() const { |
|
86 return mMode; |
|
87 } |
88 |
88 |
89 /*! |
89 /*! |
90 Sets input mode. |
90 Sets input mode. |
91 */ |
91 */ |
92 void setInputMode(HbInputModeType newInputMode) { iMode = newInputMode; } |
92 void setInputMode(HbInputModeType newInputMode) { |
|
93 mMode = newInputMode; |
|
94 } |
93 |
95 |
94 /*! |
96 /*! |
95 Return language. |
97 Return language. |
96 */ |
98 */ |
97 HbInputLanguage language() const { return HbInputLanguage(iLanguage); } |
99 HbInputLanguage language() const { |
|
100 return HbInputLanguage(mLanguage); |
|
101 } |
98 |
102 |
99 /*! |
103 /*! |
100 Sets language. |
104 Sets language. |
101 */ |
105 */ |
102 void setLanguage(const HbInputLanguage &newLanguage) { iLanguage = newLanguage; } |
106 void setLanguage(const HbInputLanguage &newLanguage) { |
|
107 mLanguage = newLanguage; |
|
108 } |
103 |
109 |
104 /*! |
110 /*! |
105 Returns keyboard type. |
111 Returns keyboard type. |
106 */ |
112 */ |
107 HbKeyboardType keyboard() const { return iKeyboard; } |
113 HbKeyboardType keyboard() const { |
|
114 return mKeyboard; |
|
115 } |
108 |
116 |
109 /*! |
117 /*! |
110 Sets keyboard type. |
118 Sets keyboard type. |
111 */ |
119 */ |
112 void setKeyboard(HbKeyboardType newKeyboard) { iKeyboard = newKeyboard; } |
120 void setKeyboard(HbKeyboardType newKeyboard) { |
|
121 mKeyboard = newKeyboard; |
|
122 } |
113 |
123 |
114 /*! |
124 /*! |
115 Returns mode properties in string format. This is used for input method resolving and |
125 Returns mode properties in string format. This is used for input method resolving and |
116 only needed by input method developers. |
126 only needed by input method developers. |
117 */ |
127 */ |
118 QString asString() const { |
128 QString asString() const { |
119 return iLanguage.asString() + QString(" ") + QString::number(iMode) + QString(" ") + QString::number(iKeyboard); |
129 return mLanguage.asString() + QString(" ") + QString::number(mMode) + QString(" ") + QString::number(mKeyboard); |
120 } |
130 } |
121 |
131 |
122 private: |
132 private: |
123 HbInputModeType iMode; |
133 HbInputModeType mMode; |
124 HbInputLanguage iLanguage; |
134 HbInputLanguage mLanguage; |
125 HbKeyboardType iKeyboard; |
135 HbKeyboardType mKeyboard; |
126 }; |
136 }; |
127 |
137 |
128 #endif // HB_INPUT_MODE_PROPERTIES_H |
138 #endif // HB_INPUT_MODE_PROPERTIES_H |
129 |
139 |
130 // End of file |
140 // End of file |