1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FM_IMMS_PROJECT_KEYBOARDTYPE_H 17 #define FM_IMMS_PROJECT_KEYBOARDTYPE_H 18 19 #include <vector> 20 #include <string> 21 #include "parcel.h" 22 23 namespace OHOS { 24 namespace MiscServices { 25 class KeyboardType : public Parcelable { 26 public: 27 KeyboardType(); 28 KeyboardType(const KeyboardType& type); 29 ~KeyboardType(); 30 KeyboardType& operator =(const KeyboardType& type); 31 virtual bool Marshalling(Parcel &parcel) const override; 32 static KeyboardType *Unmarshalling(Parcel &parcel); 33 void setId(int32_t typeId); 34 void setLabelId(int32_t labelId); 35 void setIconId(int32_t iconId); 36 void setAsciiCapability(bool isAsciiCapable); 37 void setLanguage(std::u16string language); 38 void setInputSource(std::u16string inputSource); 39 void setCustomizedValue(std::u16string customizedValue); 40 int32_t getId() const; 41 int32_t getLabelId() const; 42 int32_t getIconId() const; 43 int32_t getHashCode() const; 44 std::u16string getLanguage() const; 45 std::u16string getInputSource() const; 46 std::u16string getCustomizedValue() const; 47 bool supportsAscii(); 48 49 private: 50 int32_t mId; 51 int32_t mHashCode; 52 int32_t mLabelId; 53 int32_t mIconId; 54 bool mIsAsciiCapable; 55 std::u16string mLanguage; 56 std::u16string mInputSource; 57 std::u16string mCustomizedValue; 58 59 const int32_t ID_NONE = 0; 60 }; 61 } 62 } 63 #endif // FM_IMMS_PROJECT_KEYBOARDTYPE_H 64