1 /* 2 * Copyright 2001-2015, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold, bonefish@users.sf.net 7 */ 8 #ifndef REGISTRAR_DEFS_H 9 #define REGISTRAR_DEFS_H 10 11 12 //! API classes - registrar interface. 13 14 15 #include <Errors.h> 16 #include <Roster.h> 17 18 19 namespace BPrivate { 20 21 22 // names 23 extern const char* kRAppLooperPortName; 24 25 26 #define B_REGISTRAR_SIGNATURE "application/x-vnd.haiku-registrar" 27 #define B_REGISTRAR_AUTHENTICATION_PORT_NAME "auth" 28 29 30 // message constants 31 enum { 32 // replies 33 B_REG_SUCCESS = 'rgsu', 34 B_REG_ERROR = 'rger', 35 B_REG_RESULT = 'rgrz', 36 37 // general requests 38 B_REG_GET_MIME_MESSENGER = 'rgmm', 39 B_REG_GET_CLIPBOARD_MESSENGER = 'rgcm', 40 B_REG_GET_DISK_DEVICE_MESSENGER = 'rgdm', 41 B_REG_SHUT_DOWN = 'rgsh', 42 43 // roster requests 44 B_REG_ADD_APP = 'rgaa', 45 B_REG_COMPLETE_REGISTRATION = 'rgcr', 46 B_REG_IS_APP_REGISTERED = 'rgip', 47 B_REG_REMOVE_PRE_REGISTERED_APP = 'rgrp', 48 B_REG_REMOVE_APP = 'rgra', 49 B_REG_SET_THREAD_AND_TEAM = 'rgtt', 50 B_REG_SET_SIGNATURE = 'rgss', 51 B_REG_GET_APP_INFO = 'rgai', 52 B_REG_GET_APP_LIST = 'rgal', 53 B_REG_UPDATE_ACTIVE_APP = 'rgua', 54 B_REG_BROADCAST = 'rgbc', 55 B_REG_START_WATCHING = 'rgwa', 56 B_REG_STOP_WATCHING = 'rgsw', 57 B_REG_GET_RECENT_DOCUMENTS = 'rggd', 58 B_REG_GET_RECENT_FOLDERS = 'rggf', 59 B_REG_GET_RECENT_APPS = 'rgga', 60 B_REG_ADD_TO_RECENT_DOCUMENTS = 'rg2d', 61 B_REG_ADD_TO_RECENT_FOLDERS = 'rg2f', 62 B_REG_ADD_TO_RECENT_APPS = 'rg2a', 63 B_REG_CLEAR_RECENT_DOCUMENTS = 'rgxd', 64 B_REG_CLEAR_RECENT_FOLDERS = 'rgxf', 65 B_REG_CLEAR_RECENT_APPS = 'rgxa', 66 B_REG_LOAD_RECENT_LISTS = 'rglr', 67 B_REG_SAVE_RECENT_LISTS = 'rgsr', 68 69 // MIME requests 70 B_REG_MIME_SET_PARAM = 'rgsp', 71 B_REG_MIME_DELETE_PARAM = 'rgdp', 72 B_REG_MIME_START_WATCHING = 'rgwb', 73 B_REG_MIME_STOP_WATCHING = 'rgwe', 74 B_REG_MIME_INSTALL = 'rgin', 75 B_REG_MIME_DELETE = 'rgdl', 76 B_REG_MIME_GET_INSTALLED_TYPES = 'rgit', 77 B_REG_MIME_GET_INSTALLED_SUPERTYPES = 'rgis', 78 B_REG_MIME_GET_SUPPORTING_APPS = 'rgsa', 79 B_REG_MIME_GET_ASSOCIATED_TYPES = 'rgat', 80 B_REG_MIME_SNIFF = 'rgsn', 81 B_REG_MIME_UPDATE_MIME_INFO = 'rgup', 82 B_REG_MIME_CREATE_APP_META_MIME = 'rgca', 83 B_REG_MIME_UPDATE_THREAD_FINISHED = 'rgtf', 84 85 // message runner requests 86 B_REG_REGISTER_MESSAGE_RUNNER = 'rgrr', 87 B_REG_UNREGISTER_MESSAGE_RUNNER = 'rgru', 88 B_REG_SET_MESSAGE_RUNNER_PARAMS = 'rgrx', 89 B_REG_GET_MESSAGE_RUNNER_INFO = 'rgri', 90 91 // internal registrar messages 92 B_REG_ROSTER_SANITY_EVENT = 'rgir', 93 B_REG_SHUTDOWN_FINISHED = 'rgsf', 94 B_REG_ROSTER_DEVICE_RESCAN = 'rgrs', 95 96 // clipboard handler requests 97 B_REG_ADD_CLIPBOARD = 'rgCa', 98 B_REG_GET_CLIPBOARD_COUNT = 'rgCc', 99 B_REG_CLIPBOARD_START_WATCHING = 'rgCw', 100 B_REG_CLIPBOARD_STOP_WATCHING = 'rgCx', 101 B_REG_DOWNLOAD_CLIPBOARD = 'rgCd', 102 B_REG_UPLOAD_CLIPBOARD = 'rgCu', 103 104 // disk device request 105 B_REG_NEXT_DISK_DEVICE = 'rgnx', 106 B_REG_GET_DISK_DEVICE = 'rgdd', 107 B_REG_UPDATE_DISK_DEVICE = 'rgud', 108 B_REG_DEVICE_START_WATCHING = 'rgwd', 109 B_REG_DEVICE_STOP_WATCHING = 'rgsd', 110 111 // debug_server notifications 112 B_REG_TEAM_DEBUGGER_ALERT = 'rtda', 113 114 // authentication requests 115 B_REG_GET_PASSWD_DB = 'rpdb', 116 B_REG_GET_GROUP_DB = 'rgdb', 117 B_REG_GET_SHADOW_PASSWD_DB = 'rsdb', 118 B_REG_GET_USER = 'rgus', 119 B_REG_GET_GROUP = 'rggr', 120 B_REG_GET_USER_GROUPS = 'rgug', 121 B_REG_UPDATE_USER = 'ruus', 122 B_REG_DELETE_USER = 'rdus', 123 B_REG_UPDATE_GROUP = 'rugr', 124 B_REG_DELETE_GROUP = 'rdgr', 125 126 // package watching requests 127 B_REG_PACKAGE_START_WATCHING = 'rgPw', 128 B_REG_PACKAGE_STOP_WATCHING = 'rgPx', 129 }; 130 131 // B_REG_MIME_SET_PARAM "which" constants 132 enum { 133 B_REG_MIME_APP_HINT = 'rgmh', 134 B_REG_MIME_ATTR_INFO = 'rgma', 135 B_REG_MIME_DESCRIPTION = 'rgmd', 136 B_REG_MIME_FILE_EXTENSIONS = 'rgmf', 137 B_REG_MIME_ICON = 'rgmi', 138 B_REG_MIME_ICON_FOR_TYPE = 'rgm4', 139 B_REG_MIME_PREFERRED_APP = 'rgmp', 140 B_REG_MIME_SNIFFER_RULE = 'rgmr', 141 B_REG_MIME_SUPPORTED_TYPES = 'rgms', 142 }; 143 144 // B_REG_UPDATE_DISK_DEVICE "update_policy" constants 145 enum { 146 B_REG_DEVICE_UPDATE_CHECK, 147 B_REG_DEVICE_UPDATE_CHANGED, 148 B_REG_DEVICE_UPDATE_DEVICE_CHANGED, 149 }; 150 151 // type constants 152 enum { 153 B_REG_APP_INFO_TYPE = 'rgai', // app_info 154 }; 155 156 // error constants 157 #define B_REGISTRAR_ERROR_BASE (B_ERRORS_END + 1) 158 159 enum { 160 B_REG_ALREADY_REGISTERED = B_REGISTRAR_ERROR_BASE, 161 // A team tries to register a second time. 162 B_REG_APP_NOT_REGISTERED, 163 B_REG_APP_NOT_PRE_REGISTERED, 164 }; 165 166 // misc constants 167 enum { 168 B_REG_DEFAULT_APP_FLAGS = B_MULTIPLE_LAUNCH, 169 B_REG_APP_LOOPER_PORT_CAPACITY = 100, 170 }; 171 172 // structs 173 174 // a flat app_info -- to be found in B_REG_APP_INFO_TYPE message fields 175 struct flat_app_info { 176 app_info info; 177 char ref_name[B_FILE_NAME_LENGTH + 1]; 178 }; 179 180 181 } // namespace BPrivate 182 183 184 #endif // REGISTRAR_DEFS_H 185 186