summaryrefslogtreecommitdiff
path: root/SDL_Core/src/components/JSONHandler/include/JSONHandler/SDLRPCObjects/V2/Result.h
blob: 2f2f2e8b90a4c521d82bd0b143fc17f61467f0e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
//
// Copyright (c) 2013, Ford Motor Company
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following
// disclaimer in the documentation and/or other materials provided with the
// distribution.
//
// Neither the name of the Ford Motor Company nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef NSSMARTDEVICELINKKRPCV2_RESULT_INCLUDE
#define NSSMARTDEVICELINKKRPCV2_RESULT_INCLUDE

namespace NsSmartDeviceLinkRPC
{
    class Result;
}

/*
  interface Ford Sync RAPI
  version   2.0O
  date      2012-11-02
  generated at  Thu Jan 24 06:36:23 2013
  source stamp  Thu Jan 24 06:35:41 2013
  author    RC
*/

namespace NsSmartDeviceLinkRPCV2
{

    class Result
    {
    public:
        enum ResultInternal
        {
            INVALID_ENUM = -1,

            ///  The request succeeded
            SUCCESS = 0,

            /**
                 The data sent is invalid. For example
                 Invalid Json syntax
                 Parameters out of bounds (number or enum range)
                 Mandatory parameters not provided
                 Parameter provided with wrong type
                 Invalid characters
                 Empty string
            */
            INVALID_DATA = 1,

            ///  The request is not supported by Sync
            UNSUPPORTED_REQUEST = 2,

            ///  The system could not process the request because the necessary memory couldn't be allocated
            OUT_OF_MEMORY = 3,

            ///  There are too many requests pending (means, that the response has not been delivered, yet).
            TOO_MANY_PENDING_REQUESTS = 4,

            /**
                 One of the provided IDs is not valid. For example
                 This applies to CorrelationID, SubscriptionID [@TODO if SubscriptionID is used], CommandID, MenuID, [@TODO: missed one?]
            */
            INVALID_ID = 5,

            ///  There was a conflict with an registered name (application or menu item) or vr command
            DUPLICATE_NAME = 6,

            ///  There are already too many registered applications
            TOO_MANY_APPLICATIONS = 7,

            ///  RegisterApplication has been called again, after a RegisterApplication was successful before.
            APPLICATION_REGISTERED_ALREADY = 8,

            ///  Sync doesn't support the protocol that is requested by the mobile application
            UNSUPPORTED_VERSION = 9,

            /**
                 The requested language is currently not supported.
                 Might be because of a mismatch of the currently active language on Sync and the requested language
            */
            WRONG_LANGUAGE = 10,

            ///  An command can not be executed because no application has been registered with RegisterApplication.
            APPLICATION_NOT_REGISTERED = 11,

            /**
                 The data may not be changed, because it is currently in use.
                 For example when trying to delete a command set that is currently involved in an interaction.
            */
            IN_USE = 12,

            ///  The item to subscribe to is already subscribed to.
            SUBSCRIBED_ALREADY = 13,

            /**
                 The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
                 Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
            */
            REJECTED = 14,

            /**
                 A command was aborted, for example due to user interaction (e.g. user pressed button).
                 Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
            */
            ABORTED = 15,

            /**
                 A command was ignored, because the intended result is already in effect.
                 For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
                 NOTE: potentially replaces SUBSCRIBED_ALREADY
            */
            IGNORED = 16,

            /**
                 A button that was requested for subscription is not supported under the current system.
                 NOTE: could become a more generic UNSUPPORTED_RESOURCE by merging with VEHIVLE_DATA_NOT_AVAILABLE.
            */
            UNSUPPORTED_BUTTON = 17,

            ///  A specified file could not be found on Sync.
            FILE_NOT_FOUND = 18,

            ///  Provided data is valid but something went wrong in the lower layers.
            GENERIC_ERROR = 19,

            ///  The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.
            VEHICLE_DATA_NOT_ALLOWED = 20,

            ///  The requested vehicle data is not available on this vehicle or is not published.
            VEHICLE_DATA_NOT_AVAILABLE = 21,

            ///  RPC is not authorized in local policy table.
            DISALLOWED = 22,

            ///  RPC is included in a functional group explicitly blocked by the user.
            USER_DISALLOWED = 23,

            ///  Overlay reached the maximum timeout and closed.
            TIMED_OUT = 24,

            ///  User selected to Cancel Route.
            CANCEL_ROUTE = 25,

            ///  User chose a Close command for the overlay.
            CLOSED = 26,

            /**
                 The data is being returned through an OnEncodedSYNCPData notification.
                 The data is intended to be passed by the proxy to the designated server URL.
            */
            ENCRYPTED = 27,

            ///  The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.
            WARNINGS = 28,

            RETRY = 29 // PerformAudioPassThru
        };

        Result();
        Result(ResultInternal e);
        Result(const Result& r);

        ResultInternal get(void) const;
        void set(ResultInternal e);

        // TODO(AK): remove this after new code generation
        operator NsSmartDeviceLinkRPC::Result();
        Result& operator= (const Result& result);

    private:
        ResultInternal mInternal;
        friend class ResultMarshaller;
    };

}

#endif