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