• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef PASTEBOARD_ERROR_H
16 #define PASTEBOARD_ERROR_H
17 
18 #include "errors.h"
19 #include "pasteboard_hilog.h"
20 
21 namespace OHOS {
22 namespace MiscServices {
23 enum PasteboardModule {
24     PASTEBOARD_MODULE_SERVICE_ID = 0x06,
25 };
26 
27 // Pasteboard error offset, used only in this file.
28 constexpr ErrCode PASTEBOARD_ERR_OFFSET = ErrCodeOffset(SUBSYS_SMALLSERVICES, PASTEBOARD_MODULE_SERVICE_ID);
29 
30 enum class PasteboardError : int32_t {
31     E_OK = PASTEBOARD_ERR_OFFSET,
32     E_INVALID_VALUE,
33     E_INVALID_OPTION,
34     E_WRITE_PARCEL_ERROR,
35     E_READ_PARCEL_ERROR,
36     E_SA_DIED,
37     E_ERROR,
38     E_OUT_OF_RANGE,
39     E_NO_PERMISSION,
40     E_INVALID_PARAMETERS,
41     E_TIMEOUT,
42     E_CANCELED,
43     E_EXCEEDS_LIMIT,
44     E_IS_BEGING_PROCESSED,
45     E_COPY_FORBIDDEN,
46     E_UNKNOWN,
47     E_BUTT,
48     E_REMOTE,
49 };
50 
51 const std::map<PasteboardError, const char *> PasteboardErrorMap = {
52     {PasteboardError::E_OK, "E_OK"},
53     {PasteboardError::E_INVALID_VALUE, "E_INVALID_VALUE"},
54     {PasteboardError::E_INVALID_OPTION, "E_INVALID_OPTION"},
55     {PasteboardError::E_WRITE_PARCEL_ERROR, "E_WRITE_PARCEL_ERROR"},
56     {PasteboardError::E_READ_PARCEL_ERROR, "E_READ_PARCEL_ERROR"},
57     {PasteboardError::E_SA_DIED, "E_SA_DIED"},
58     {PasteboardError::E_ERROR, "E_ERROR"},
59     {PasteboardError::E_OUT_OF_RANGE, "E_OUT_OF_RANGE"},
60     {PasteboardError::E_NO_PERMISSION, "E_NO_PERMISSION"},
61     {PasteboardError::E_INVALID_PARAMETERS, "E_INVALID_PARAMETERS"},
62     {PasteboardError::E_TIMEOUT, "E_TIMEOUT"},
63     {PasteboardError::E_CANCELED, "E_CANCELED"},
64     {PasteboardError::E_EXCEEDS_LIMIT, "E_EXCEEDS_LIMIT"},
65     {PasteboardError::E_IS_BEGING_PROCESSED, "E_IS_BEGING_PROCESSED"},
66     {PasteboardError::E_COPY_FORBIDDEN, "E_COPY_FORBIDDEN"},
67     {PasteboardError::E_UNKNOWN, "E_UNKNOWN"},
68     {PasteboardError::E_BUTT, "E_BUTT"},
69     {PasteboardError::E_REMOTE, "E_REMOTE"},
70 };
71 
72 } // namespace MiscServices
73 } // namespace OHOS
74 #endif // PASTEBOARD_ERROR_H