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