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