1 //------------------------------------------------------------------------------ 2 // Copyright (c) 2001-2002, OpenBeOS 3 // 4 // Permission is hereby granted, free of charge, to any person obtaining a 5 // copy of this software and associated documentation files (the "Software"), 6 // to deal in the Software without restriction, including without limitation 7 // the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 // and/or sell copies of the Software, and to permit persons to whom the 9 // Software is furnished to do so, subject to the following conditions: 10 // 11 // The above copyright notice and this permission notice shall be included in 12 // all copies or substantial portions of the Software. 13 // 14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 // DEALINGS IN THE SOFTWARE. 21 // 22 // File Name: RegistrarDefs.h 23 // Author(s): Ingo Weinhold (bonefish@users.sf.net) 24 // Description: API classes - registrar interface. 25 //------------------------------------------------------------------------------ 26 27 #ifndef REGISTRAR_DEFS_H 28 #define REGISTRAR_DEFS_H 29 30 #include <Errors.h> 31 #include <Roster.h> 32 33 namespace BPrivate { 34 35 // names 36 extern const char *kRegistrarSignature; 37 extern const char *kRosterThreadName; 38 extern const char *kRAppLooperPortName; 39 40 extern const char *get_roster_port_name(); 41 42 // message constants 43 enum { 44 // replies 45 B_REG_SUCCESS = 'rgsu', 46 B_REG_ERROR = 'rger', 47 B_REG_RESULT = 'rgrz', 48 49 // general requests 50 B_REG_GET_MIME_MESSENGER = 'rgmm', 51 B_REG_GET_CLIPBOARD_MESSENGER = 'rgcm', 52 B_REG_GET_DISK_DEVICE_MESSENGER = 'rgdm', 53 B_REG_SHUT_DOWN = 'rgsh', 54 55 // roster requests 56 B_REG_ADD_APP = 'rgaa', 57 B_REG_COMPLETE_REGISTRATION = 'rgcr', 58 B_REG_IS_APP_PRE_REGISTERED = 'rgip', 59 B_REG_REMOVE_PRE_REGISTERED_APP = 'rgrp', 60 B_REG_REMOVE_APP = 'rgra', 61 B_REG_SET_THREAD_AND_TEAM = 'rgtt', 62 B_REG_SET_SIGNATURE = 'rgss', 63 B_REG_GET_APP_INFO = 'rgai', 64 B_REG_GET_APP_LIST = 'rgal', 65 B_REG_ACTIVATE_APP = 'rgac', 66 B_REG_BROADCAST = 'rgbc', 67 B_REG_START_WATCHING = 'rgwa', 68 B_REG_STOP_WATCHING = 'rgsw', 69 B_REG_GET_RECENT_DOCUMENTS = 'rggd', 70 B_REG_GET_RECENT_FOLDERS = 'rggf', 71 B_REG_GET_RECENT_APPS = 'rgga', 72 B_REG_ADD_TO_RECENT_DOCUMENTS = 'rg2d', 73 B_REG_ADD_TO_RECENT_FOLDERS = 'rg2f', 74 B_REG_ADD_TO_RECENT_APPS = 'rg2a', 75 B_REG_CLEAR_RECENT_DOCUMENTS = 'rgxd', 76 B_REG_CLEAR_RECENT_FOLDERS = 'rgxf', 77 B_REG_CLEAR_RECENT_APPS = 'rgxa', 78 B_REG_LOAD_RECENT_LISTS = 'rglr', 79 B_REG_SAVE_RECENT_LISTS = 'rgsr', 80 81 // MIME requests 82 B_REG_MIME_SET_PARAM = 'rgsp', 83 B_REG_MIME_DELETE_PARAM = 'rgdp', 84 B_REG_MIME_START_WATCHING = 'rgwb', 85 B_REG_MIME_STOP_WATCHING = 'rgwe', 86 B_REG_MIME_INSTALL = 'rgin', 87 B_REG_MIME_DELETE = 'rgdl', 88 B_REG_MIME_GET_INSTALLED_TYPES = 'rgit', 89 B_REG_MIME_GET_INSTALLED_SUPERTYPES = 'rgis', 90 B_REG_MIME_GET_SUPPORTING_APPS = 'rgsa', 91 B_REG_MIME_GET_ASSOCIATED_TYPES = 'rgat', 92 B_REG_MIME_SNIFF = 'rgsn', 93 B_REG_MIME_UPDATE_MIME_INFO = 'rgup', 94 B_REG_MIME_CREATE_APP_META_MIME = 'rgca', 95 B_REG_MIME_UPDATE_THREAD_FINISHED = 'rgtf', 96 97 // message runner requests 98 B_REG_REGISTER_MESSAGE_RUNNER = 'rgrr', 99 B_REG_UNREGISTER_MESSAGE_RUNNER = 'rgru', 100 B_REG_SET_MESSAGE_RUNNER_PARAMS = 'rgrx', 101 B_REG_GET_MESSAGE_RUNNER_INFO = 'rgri', 102 103 // internal registrar messages 104 B_REG_ROSTER_SANITY_EVENT = 'rgir', 105 B_REG_SHUTDOWN_FINISHED = 'rgsf', 106 B_REG_ROSTER_DEVICE_RESCAN = 'rgrs', 107 108 // clipboard handler requests 109 B_REG_ADD_CLIPBOARD = 'rgCa', 110 B_REG_GET_CLIPBOARD_COUNT = 'rgCc', 111 B_REG_CLIPBOARD_START_WATCHING = 'rgCw', 112 B_REG_CLIPBOARD_STOP_WATCHING = 'rgCx', 113 B_REG_DOWNLOAD_CLIPBOARD = 'rgCd', 114 B_REG_UPLOAD_CLIPBOARD = 'rgCu', 115 116 // disk device request 117 B_REG_NEXT_DISK_DEVICE = 'rgnx', 118 B_REG_GET_DISK_DEVICE = 'rgdd', 119 B_REG_UPDATE_DISK_DEVICE = 'rgud', 120 B_REG_DEVICE_START_WATCHING = 'rgwd', 121 B_REG_DEVICE_STOP_WATCHING = 'rgsd', 122 }; 123 124 // B_REG_MIME_SET_PARAM "which" constants 125 enum { 126 B_REG_MIME_APP_HINT = 'rgmh', 127 B_REG_MIME_ATTR_INFO = 'rgma', 128 B_REG_MIME_DESCRIPTION = 'rgmd', 129 B_REG_MIME_FILE_EXTENSIONS = 'rgmf', 130 B_REG_MIME_ICON = 'rgmi', 131 B_REG_MIME_ICON_FOR_TYPE = 'rgm4', 132 B_REG_MIME_PREFERRED_APP = 'rgmp', 133 B_REG_MIME_SNIFFER_RULE = 'rgmr', 134 B_REG_MIME_SUPPORTED_TYPES = 'rgms', 135 }; 136 137 // B_REG_UPDATE_DISK_DEVICE "update_policy" constants 138 enum { 139 B_REG_DEVICE_UPDATE_CHECK, 140 B_REG_DEVICE_UPDATE_CHANGED, 141 B_REG_DEVICE_UPDATE_DEVICE_CHANGED, 142 }; 143 144 // type constants 145 enum { 146 B_REG_APP_INFO_TYPE = 'rgai', // app_info 147 }; 148 149 // error constants 150 #define B_REGISTRAR_ERROR_BASE (B_ERRORS_END + 1) 151 152 enum { 153 B_REG_ALREADY_REGISTERED = B_REGISTRAR_ERROR_BASE, 154 // A team tries to register a second time. 155 B_REG_APP_NOT_REGISTERED, 156 B_REG_APP_NOT_PRE_REGISTERED, 157 }; 158 159 // misc constants 160 enum { 161 B_REG_DEFAULT_APP_FLAGS = B_MULTIPLE_LAUNCH | B_ARGV_ONLY 162 | _B_APP_INFO_RESERVED1_, 163 B_REG_APP_LOOPER_PORT_CAPACITY = 100, 164 }; 165 166 // structs 167 168 // a flat app_info -- to be found in B_REG_APP_INFO_TYPE message fields 169 struct flat_app_info { 170 app_info info; 171 char ref_name[B_FILE_NAME_LENGTH + 1]; 172 }; 173 174 } // namespace BPrivate 175 176 #endif // REGISTRAR_DEFS_H 177 178