1
/*********************************************************
2
* Copyright (C) 2008 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
20
* ghiGetBinaryHandlers.x --
22
* Definition of the data structures used in the GuestRpc commands to
23
* provide information about the types of files a given binary supports.
28
* Enumerates the different versions of the messages.
30
enum GHIBinaryHandlersVersion {
31
GHI_BINARY_HANDLERS_V1 = 1
34
const GHI_HANDLERS_SUFFIX_MAX_LEN = 32;
35
const GHI_HANDLERS_MIMETYPE_MAX_LEN = 256;
36
const GHI_HANDLERS_UTI_MAX_LEN = 256;
37
const GHI_HANDLERS_FRIENDLY_NAME_MAX_LEN = 256;
38
const GHI_HANDLERS_MAX_NUM_ICONS = 8;
39
const GHI_HANDLERS_VERB_MAX_LEN = 64;
40
const GHI_MAX_NUM_ACTION_URI_PAIRS = 16;
43
* The Windows MAX_PATH define specifies that paths may be up to 260 character
44
* units in length. To allow for expansion when going to UTF8 we multiply that
47
const GHI_HANDLERS_ACTIONURI_MAX_PATH = 1040;
50
* Maximum number of filetypes that may be encoded in a single
53
const GHI_MAX_NUM_BINARY_HANDLERS = 32;
55
struct GHIBinaryHandlersIconDetails {
57
* The icon dimensions in pixels
63
* A string identifier for this icon that can be used to retrieve
64
* the specific pixel data using GHI_GET_ICON_DATA
66
string identifier<GHI_HANDLERS_ACTIONURI_MAX_PATH>;
69
struct GHIBinaryHandlersActionURIPair {
71
* The verb for the action URI (typically something like run or print).
73
string verb<GHI_HANDLERS_VERB_MAX_LEN>;
76
* The executable path to use when launching the binary with this particular
77
* filetype and verb. Some filetypes may require additional or different command line
78
* arguments for a given verb that can be encoded here.
80
string actionURI<GHI_HANDLERS_ACTIONURI_MAX_PATH>;
83
struct GHIBinaryHandlersDetails {
85
* The file suffix (including leading period character).
87
string suffix<GHI_HANDLERS_SUFFIX_MAX_LEN>;
90
* A mimetype - if available.
92
string mimetype<GHI_HANDLERS_MIMETYPE_MAX_LEN>;
95
* A UTI (universal type identifier) - if available.
97
string UTI<GHI_HANDLERS_UTI_MAX_LEN>;
100
* A list of the verbs (run, print etc.) and their matching
103
struct GHIBinaryHandlersActionURIPair actionURIs<GHI_MAX_NUM_ACTION_URI_PAIRS>;
106
* A friendly name displayed for this document/filetype.
108
string friendlyName<GHI_HANDLERS_FRIENDLY_NAME_MAX_LEN>;
111
* A list of the different sized icons for this filetype.
113
struct GHIBinaryHandlersIconDetails icons<GHI_HANDLERS_MAX_NUM_ICONS>;
116
struct GHIBinaryHandlersList {
117
struct GHIBinaryHandlersDetails handlers<GHI_MAX_NUM_BINARY_HANDLERS>;
121
* This defines the protocol for a 'get.binary.handlers' message. The union allows
122
* us to create new versions of the protocol later by creating new values
123
* in the GHIBinaryHandlersVersion enumeration, without having to change much of
124
* the code calling the (de)serialization functions.
126
* Since the union doesn't have a default case, de-serialization will fail
127
* if an unknown version is provided on the wire.
129
union GHIBinaryHandlers switch (GHIBinaryHandlersVersion ver) {
130
case GHI_BINARY_HANDLERS_V1:
131
struct GHIBinaryHandlersList *handlersV1;