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