19066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/*
29066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Copyright (C) 2007 The Android Open Source Project
39066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
49066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License");
59066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * you may not use this file except in compliance with the License.
69066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * You may obtain a copy of the License at
79066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
89066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *      http://www.apache.org/licenses/LICENSE-2.0
99066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Unless required by applicable law or agreed to in writing, software
119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS,
129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * See the License for the specific language governing permissions and
149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * limitations under the License.
159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage com.android.internal.telephony.gsm.stk;
189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.graphics.Bitmap;
209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcel;
219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcelable;
229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/**
242563a3ac05dd3cf8a07203ae682c243f2e793137Wink Saville * Container class for STK GET INPUT, GET IN KEY commands parameters.
259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project *
269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpublic class Input implements Parcelable {
289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String text;
299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String defaultText;
302563a3ac05dd3cf8a07203ae682c243f2e793137Wink Saville    public Bitmap icon;
319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int minLen;
329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int maxLen;
339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public boolean ucs2;
349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public boolean packed;
359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public boolean digitOnly;
369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public boolean echo;
379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public boolean yesNo;
389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public boolean helpAvailable;
399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    Input() {
419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        text = "";
429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        defaultText = null;
439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        icon = null;
449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        minLen = 0;
459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        maxLen = 1;
469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        ucs2 = false;
479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        packed = false;
489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        digitOnly = false;
499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        echo = false;
509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        yesNo = false;
519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        helpAvailable = false;
529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    private Input(Parcel in) {
559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        text = in.readString();
569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        defaultText = in.readString();
579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        icon = in.readParcelable(null);
589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        minLen = in.readInt();
599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        maxLen = in.readInt();
609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        ucs2 = in.readInt() == 1 ? true : false;
619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        packed = in.readInt() == 1 ? true : false;
629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        digitOnly = in.readInt() == 1 ? true : false;
639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        echo = in.readInt() == 1 ? true : false;
649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        yesNo = in.readInt() == 1 ? true : false;
659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        helpAvailable = in.readInt() == 1 ? true : false;
669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int describeContents() {
699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        return 0;
709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public void writeToParcel(Parcel dest, int flags) {
739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(text);
749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(defaultText);
759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeParcelable(icon, 0);
769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(minLen);
779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(maxLen);
789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(ucs2 ? 1 : 0);
799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(packed ? 1 : 0);
809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(digitOnly ? 1 : 0);
819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(echo ? 1 : 0);
829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(yesNo ? 1 : 0);
839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(helpAvailable ? 1 : 0);
849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final Parcelable.Creator<Input> CREATOR = new Parcelable.Creator<Input>() {
879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public Input createFromParcel(Parcel in) {
889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return new Input(in);
899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public Input[] newArray(int size) {
929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return new Input[size];
939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    };
959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    boolean setIcon(Bitmap Icon) { return true; }
979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project}