Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Filter / AttributeFilter.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
17 /**
18  * @file       AttributeFilter.h
19  * @author     Kisub Song (kisubs.song@samsung.com)
20  * @version    0.1
21  * @brief
22  */
23
24 #ifndef _API_ATTRIBUTE_FILTER_H_
25 #define _API_ATTRIBUTE_FILTER_H_
26
27 #include <string>
28 #include <dpl/shared_ptr.h>
29 #include "AnyType.h"
30 #include "IFilter.h"
31 #include "FilterTypes.h"
32
33 namespace TizenApis {
34 namespace Api {
35 namespace Tizen {
36
37 class AttributeFilter : public IFilter
38 {
39 private: // fields
40
41         /**
42          * attribute name object
43          */
44         std::string  m_attributeName;
45
46         /**
47          * match value object.
48          */
49         MatchFlag  m_matchFlag;
50
51         /**
52          * match value object.
53          */
54         AnyArrayPtr  m_matchValues;
55
56 protected:
57
58 public: // methods
59
60         /**
61          * constructor of abstraction filter
62          */
63         explicit AttributeFilter(const std::string attributeName,
64                 const MatchFlag& matchFlag,
65                         const AnyArrayPtr& matchValues);
66
67         virtual ~AttributeFilter();
68
69         /**
70          * method used to identify filter type
71          */
72         virtual FilterType getFilterType() const
73         {
74                 return ATTRIBUTE_FILTER;
75         }
76
77         virtual bool setFilterType(const FilterType& filterType) { return false; };
78
79         virtual bool validate(FilterValidatorPtr& validator, int depth = 0);
80
81         virtual void travel(IFilterVisitorPtr& traversal, int depth = 0);
82
83         std::string getAttributeName() const;
84         void setAttributeName(const std::string &value);
85
86         AnyArrayPtr getMatchValues() const;
87         void setMatchValues(const AnyArrayPtr &value);
88
89         MatchFlag getMatchFlag() const;
90         void setMatchFlag(const MatchFlag& value);
91 };
92
93 typedef DPL::SharedPtr<AttributeFilter> AttributeFilterPtr;
94
95 } // Tizen
96 } // Api
97 } // TizenApis
98
99 #endif // _API_ATTRIBUTE_FILTER_H_