5d983f2f3b32e410efce9b6bc7fcac6c09640c5d
[platform/core/location/maps-plugin-here.git] / inc / engine / finder / SearchItem.h
1 /*
2  * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3  * This software, including documentation, is protected by copyright controlled by
4  * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5  * storing, adapting or translating, any or all of this material requires the prior
6  * written consent of HERE Global B.V. You may use this
7  * Software in accordance with the terms and conditions defined in the
8  * HERE Location Platform Services Terms and Conditions, available at
9  * http://developer.here.com/terms-conditions-base
10  *
11  * As an additional permission to the above, you may distribute Software,
12  * in object code format as part of an Application, according to, and subject to, terms and
13  * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14  * You may distribute such object code format Application under terms of your choice,
15  * provided that the header and source files of the Software have not been modified.
16  */
17
18 #ifndef SEARCH_ITEM_H_
19 #define SEARCH_ITEM_H_
20
21 #include <vector>
22 #include "common/HereMaps_global.h"
23 #ifndef TIZEN_MIGRATION
24 #include <FBase.h>
25 #endif
26
27 HERE_MAPS_BEGIN_NAMESPACE
28
29 class LinkObject;
30
31 class SearchItem;
32 /** 
33  * This typedef defines a list of search items as a type.
34  */
35 typedef std::vector< SearchItem > SearchItemList;
36
37 /**
38  * This class encapsulates a search item returned by the server as part of a
39  * response to a discovery query. 
40  *
41  * \ingroup finder
42  */
43 class SearchItem
44 {
45 public:
46
47     /**
48      * This method is the default constructor.
49      */
50     SearchItem();
51
52     /**
53      * This method is the copy constructor.
54      *
55      * @param rRhs An object whose contents are to be copied to the instance
56      *        being created.
57      */
58     SearchItem(const SearchItem& rRhs);
59
60     /**
61      * This method is the destructor.
62      */
63     ~SearchItem();
64
65     /**
66      * This is the assignment operator.
67      *
68      * @param rRhs An object whose contents are to be copied to the given
69      *        instance.
70      *
71      * @return A reference to the given instance of the class after its contents
72      *       have been updated.
73      */
74     SearchItem& operator=(const SearchItem& rRhs);
75
76     /**
77      * This method retrieves the link object from the given search item. The
78      * link points to another resource.
79      * 
80      * @return An object containing a link to another resource.
81      */
82     LinkObject GetLinkObject() const;
83
84     /**
85      * This method retrieves the URI to the detailed information about the place
86      * to which the given search item refers.
87      * 
88      * @return The URI of the detailed information about the
89      *        place to which the given search item refers.
90      */
91     String GetPlacesPath() const;
92
93     /**
94      * This method retrieves a value representing the weighting of the given
95      * search item.
96      * 
97      * @return A value that represents the weighting of the given
98      *        search item. 
99      */
100     double GetWeight() const;
101
102     /**
103      * This method sets the link object from the given search item. The
104      * link points to another resource.
105      * 
106      * @param uLink A constant reference to an object containing a link to
107      *        another resource.
108      */
109     void SetLinkObject(const LinkObject& uLink);
110
111     /**
112      * This method sets the URI to the detailed information about the place
113      * to which the given search item refers.
114      * 
115      * @param uPlacesPath A constant reference to an object containing the URI
116      *        of the detailed information about the place to which the given
117      *        search item refers.
118      */
119     void SetPlacesPath(const String& uPlacesPath);
120
121     /**
122      * This method sets a value representing the weighting of the given
123      * search item.
124      * 
125      * @param dWeight A value that represents the weighting of the given search
126      *        item.
127      */
128     void SetWeight(double dWeight);
129
130 private:
131
132     class SearchItemImpl;
133     SearchItemImpl* m_pImpl;
134
135     friend class JsonParser;
136 };
137
138 HERE_MAPS_END_NAMESPACE
139
140 #endif // SEARCH_ITEM_H_