1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.gallery3d.filtershow.state;
18
19import com.android.gallery3d.filtershow.filters.FilterRepresentation;
20
21public class State {
22    private String mText;
23    private int mType;
24    private FilterRepresentation mFilterRepresentation;
25
26    public State(State state) {
27        this(state.getText(), state.getType());
28    }
29
30    public State(String text) {
31       this(text, StateView.DEFAULT);
32    }
33
34    public State(String text, int type) {
35        mText = text;
36        mType = type;
37    }
38
39    public boolean equals(State state) {
40        if (mFilterRepresentation.getFilterClass()
41                != state.mFilterRepresentation.getFilterClass()) {
42            return false;
43        }
44        return true;
45    }
46
47    public boolean isDraggable() {
48        return mFilterRepresentation != null;
49    }
50
51    String getText() {
52        return mText;
53    }
54
55    void setText(String text) {
56        mText = text;
57    }
58
59    int getType() {
60        return mType;
61    }
62
63    void setType(int type) {
64        mType = type;
65    }
66
67    public FilterRepresentation getFilterRepresentation() {
68        return mFilterRepresentation;
69    }
70
71    public void setFilterRepresentation(FilterRepresentation filterRepresentation) {
72        mFilterRepresentation = filterRepresentation;
73    }
74}
75