1 /* 2 * Copyright 2001-2007, 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 //! API classes - registrar interface. 12 13 14 #include <Errors.h> 15 #include <Roster.h> 16 17 18 namespace BPrivate { 19 20 // names 21 extern const char *kRegistrarSignature; 22 extern const char *kRosterThreadName; 23 extern const char *kRAppLooperPortName; 24 25 extern const char *get_roster_port_name(); 26 27 #define REGISTRAR_AUTHENTICATION_PORT_NAME "registrar: auth manager" 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_UPDATE_GROUP = 'rugr', 123 }; 124 125 // B_REG_MIME_SET_PARAM "which" constants 126 enum { 127 B_REG_MIME_APP_HINT = 'rgmh', 128 B_REG_MIME_ATTR_INFO = 'rgma', 129 B_REG_MIME_DESCRIPTION = 'rgmd', 130 B_REG_MIME_FILE_EXTENSIONS = 'rgmf', 131 B_REG_MIME_ICON = 'rgmi', 132 B_REG_MIME_ICON_FOR_TYPE = 'rgm4', 133 B_REG_MIME_PREFERRED_APP = 'rgmp', 134 B_REG_MIME_SNIFFER_RULE = 'rgmr', 135 B_REG_MIME_SUPPORTED_TYPES = 'rgms', 136 }; 137 138 // B_REG_UPDATE_DISK_DEVICE "update_policy" constants 139 enum { 140 B_REG_DEVICE_UPDATE_CHECK, 141 B_REG_DEVICE_UPDATE_CHANGED, 142 B_REG_DEVICE_UPDATE_DEVICE_CHANGED, 143 }; 144 145 // type constants 146 enum { 147 B_REG_APP_INFO_TYPE = 'rgai', // app_info 148 }; 149 150 // error constants 151 #define B_REGISTRAR_ERROR_BASE (B_ERRORS_END + 1) 152 153 enum { 154 B_REG_ALREADY_REGISTERED = B_REGISTRAR_ERROR_BASE, 155 // A team tries to register a second time. 156 B_REG_APP_NOT_REGISTERED, 157 B_REG_APP_NOT_PRE_REGISTERED, 158 }; 159 160 // misc constants 161 enum { 162 B_REG_DEFAULT_APP_FLAGS = B_MULTIPLE_LAUNCH | B_ARGV_ONLY 163 | _B_APP_INFO_RESERVED1_, 164 B_REG_APP_LOOPER_PORT_CAPACITY = 100, 165 }; 166 167 // structs 168 169 // a flat app_info -- to be found in B_REG_APP_INFO_TYPE message fields 170 struct flat_app_info { 171 app_info info; 172 char ref_name[B_FILE_NAME_LENGTH + 1]; 173 }; 174 175 } // namespace BPrivate 176 177 #endif // REGISTRAR_DEFS_H 178 179