9356fcbf7fcfd783c8e441904afb01a3c3aa65c2
[platform/core/location/maps-plugin-here.git] / inc / engine / finder / FinderError.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 FINDER_ERROR_H_
19 #define FINDER_ERROR_H_
20
21 #include "common/HereMaps_global.h"
22
23 #include "common/ErrorBase.h"
24
25 HERE_MAPS_BEGIN_NAMESPACE
26
27 /**
28  * This class encapsulates error information reflecting an error that
29  * may arise when a parsing a finder request.
30  * 
31  * \ingroup finder
32  */
33 class EXPORT_API FinderError : public ErrorBase
34 {
35 public:
36
37     /**
38      * This enumeration defines identifiers for the recognized error types.
39      */
40     enum ErrorType
41     {
42         ET_InvalidQueryArguments, ///< Indicates invalid query argument.
43         ET_ParserError,           ///< Indicates that an internal parser error occurred.
44         ET_InvalidCredentials,    ///< Indicates that credentials are not correct or empty
45         ET_UnknownError           ///< Indicate an unkown error
46     };
47
48     /**
49      * This method is a constructor.
50      *
51      * @param sStr A constant reference to a string containing an error message.
52      */
53     FinderError(ErrorType etype);
54
55     /**
56      * This method is a constructor.
57      *
58      * @param aType A value indicating the error type.
59      *
60      * @param sDescription A constant reference to a string containing the error
61      *        description.
62      */
63     FinderError(ErrorType eType, const String& sDescription);
64
65     /**
66      * This method is a (virtual) destructor. 
67      */
68     virtual ~FinderError();
69
70     /**
71      * This method retrieves a string representation of the given instance of
72      * the class. 
73      * 
74      * @return A string containing the error information held in the given
75      *        instance of the class. 
76      */
77     virtual String ToString() const;
78
79     /**
80      * This method sets the error description.
81      *
82      * @param sDsc A constant reference to a string containing the
83      *        description of the error.
84      */
85     void SetDescription(const String& sDsc);
86
87     /**
88      * This method retrieves the error description.
89      *
90      * @return A constant reference to a string containing the
91      *        description of the error.
92      */
93     String GetDescription() const;
94
95     /**
96      * This method retrieves the error type.
97      *
98      * @return A value indicating the error type.
99      */
100     ErrorType GetErrorType() const;
101
102     /**
103      * This method sets the error type.
104      *
105      * @param aType An error type.
106      */
107     void SetErrorType(ErrorType aType);
108
109 private:
110     HERE_MAPS_NO_COPY_NO_ASSIGN(FinderError);
111
112     class FinderErrorImpl;
113     FinderErrorImpl* m_pImpl;
114 };
115
116 HERE_MAPS_END_NAMESPACE
117
118 #endif // FINDER_ERROR_H_