b9c8bf39a78e58a75581ff6c4880702491cebe02
[platform/core/location/maps-plugin-here.git] / inc / engine / finder / PlacesError.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 PLACES_ERROR_H_
19 #define PLACES_ERROR_H_
20
21 #include "common/HereMaps_global.h"
22 #include "common/ErrorBase.h"
23
24 HERE_MAPS_BEGIN_NAMESPACE
25
26 /**
27  * This class encapsulates an error condition that may arise when submitting
28  * places-related queries and retrieving results.
29  * 
30  * \ingroup finder
31  */
32 class PlacesError : public ErrorBase
33 {
34 public:
35     /** 
36      * This enumeration defines identifiers for both success and error
37      * conditions. 
38      */ 
39     enum ErrorCode
40     {
41         EC_NoError,                   ///< Indicates success.
42         EC_PlaceDoesNotExistError,    ///< Indicates that the play does not exist.
43         EC_CategoryDoesNotExistError, ///< Indicates that the category does not exist.
44         EC_ParseError,                ///< Indicates a parsing error.
45         EC_PermissionsError,          ///< Indicates that the required
46                                       ///  permissions are not in place.
47         EC_UnsupportedError,          ///< Indicates that a query/operation is
48                                       ///  not supported.
49         EC_BadArgumentError,          ///< Indicates that an argument supplied
50                                       ///  by the caller is bad or not recognized.
51         EC_CancelError,               ///< Indicates that an error occurred when
52                                       ///  attempting to cancel a request. 
53         EC_UnknownError               ///< Indicates an unspecified/unknown error.
54     };
55
56     /** 
57      * This is a constructor for the class.
58      *
59      * @param aErrorCode A value representing the error code with which to
60      *       initialize a new instance of the class.
61      */
62     PlacesError(ErrorCode aErrorCode);
63
64     /** 
65      * This method is the (virtual) destructor for the class.
66      */
67     virtual ~PlacesError();
68
69     /**
70      * This method retrieves a value representing the error code assigned to
71      * the given instance of the class.
72      * 
73      * @return A value representing the error code assigned to
74      *        the given instance of the class.
75      */
76     ErrorCode GetErrorCode() const;
77
78     /**
79      * This method retrieves a string representation of the given instance of
80      * the class.
81      * 
82      * @return A String representation of
83      *        the given instance of the class. The possible values are 
84      *        "No Error", "Place Doesn't exist", "Category doesn't exist",
85      *        "Parse error", "Permissions error", "Unsupported error",
86      *        "Bad argument", "Cancel error", "Unknown error",
87      *        or "No defined error".
88      */
89     virtual String ToString() const;
90
91 private:
92     HERE_MAPS_NO_COPY_NO_ASSIGN(PlacesError);
93
94     class PlacesErrorImpl;
95     PlacesErrorImpl* m_pImpl;
96 };
97
98 HERE_MAPS_END_NAMESPACE
99
100 #endif // PLACES_ERROR_H_