a1cf8edb6a743173c05559ea28bdae1f6f3002d7
[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         AnyArrayPtr  m_matchValues;
50
51         /**
52          * match value object.
53          */
54         std::string  m_matchFlag;
55
56         /**
57          * match value object.
58          */
59         bool  m_caseSensitive;
60
61 protected:
62
63 public: // methods
64
65         /**
66          * constructor of abstraction filter
67          */
68         explicit AttributeFilter(const std::string attributeName,
69                         const AnyArrayPtr& matchValues,
70                 const std::string& matchFlag,
71                 const bool caseSensitive);
72
73         virtual ~AttributeFilter();
74
75         /**
76          * method used to identify filter type
77          */
78         virtual FilterType getFilterType() const
79         {
80                 return ATTRIBUTE_FILTER;
81         }
82
83         virtual bool setFilterType(const FilterType& filterType) { return false; };
84
85         virtual bool validate(FilterValidatorPtr& validator, int depth = 0);
86
87         virtual void travel(IFilterVisitorPtr& traversal, int depth = 0);
88
89         std::string getAttributeName() const;
90         void setAttributeName(const std::string &value);
91
92         AnyArrayPtr getMatchValues() const;
93         void setMatchValues(const AnyArrayPtr &value);
94
95         std::string getMatchFlag() const;
96         void setMatchFlag(const std::string& value);
97
98         bool getCaseSensitive() const;
99         void setCaseSensitive(const bool &value);
100 };
101
102 typedef DPL::SharedPtr<AttributeFilter> AttributeFilterPtr;
103
104 } // Tizen
105 } // Api
106 } // TizenApis
107
108 #endif // _API_ATTRIBUTE_FILTER_H_