mpr: Move MAX_INTERFACE_NAME_LEN to mprapi.h and add related constants.
[wine] / include / indexsrv.idl
1 /*
2  * Copyright 2006 Mike McCormack
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 import "unknwn.idl";
20
21 /*
22  * widl doesn't like the declaration of PFNFILLTEXTBUFFER, so work around it...
23  * Not sure that function pointers are even legal in idl.
24  */
25 cpp_quote("struct tagTEXT_SOURCE;")
26 cpp_quote("typedef HRESULT (WINAPI *PFNFILLTEXTBUFFER)(struct tagTEXT_SOURCE *pTextSource);")
27 cpp_quote("#if 0")
28 typedef void* PFNFILLTEXTBUFFER;
29 cpp_quote("#endif")
30
31 typedef struct tagTEXT_SOURCE
32 {
33     PFNFILLTEXTBUFFER pfnFillTextBuffer;
34     const WCHAR *awcBuffer;
35     ULONG iEnd;
36     ULONG iCur;
37 } TEXT_SOURCE;
38
39 typedef enum tagWORDREP_BREAK_TYPE
40 {
41     WORDREP_BREAK_EOW = 0,
42     WORDREP_BREAK_EOS = 1,
43     WORDREP_BREAK_EOP = 2,
44     WORDREP_BREAK_EOC = 3
45 } WORDREP_BREAK_TYPE;
46
47
48 /*****************************************************************************
49  *    IWordSink interface
50  */
51 [
52     unique,
53     uuid(cc907054-c058-101a-b554-08002b33b0e6),
54     object,
55     local
56 ]
57 interface IWordSink : IUnknown
58 {
59     HRESULT PutWord(
60               [in] ULONG cwc,
61               [size_is(cwcSrcLen)][in] const WCHAR *pwcInBuf,
62               [in] ULONG cwcSrcLen,
63               [in] ULONG cwcSrcPos);
64     HRESULT PutAltWord(
65               [in] ULONG cwc,
66               [size_is(cwcSrcLen)][in] const WCHAR *pwcInBuf,
67               [in] ULONG cwcSrcLen,
68               [in] ULONG cwcSrcPos);
69     HRESULT StartAltPhrase(void);
70     HRESULT EndAltPhrase(void);
71     HRESULT PutBreak(
72               [in] WORDREP_BREAK_TYPE breakType);
73 }
74
75 /*****************************************************************************
76  *    IPhraseSink interface
77  */
78 [
79     unique,
80     uuid(cc906ff0-c058-101a-b554-08002b33b0e6),
81     object,
82     local
83 ]
84 interface IPhraseSink: IUnknown
85 {
86     HRESULT PutSmallPhrase(
87               [size_is(cwcNoun)][in] const WCHAR *pwcNoun,
88               [in] ULONG cwcNoun,
89               [size_is(cwcModifier)][in] const WCHAR *pwcModifier,
90               [in] ULONG cwcModifier,
91               [in] ULONG ulAttachmentType);
92     HRESULT PutPhrase(
93               [size_is(cwcPhrase)][in] const WCHAR *pwcPhrase,
94               [in] ULONG cwcPhrase);
95 }
96
97 /*****************************************************************************
98  *    IWordBreaker interface
99  */
100 [
101     unique,
102     uuid(d53552c8-77e3-101a-b552-08002b33b0e6),
103     object,
104     local
105 ]
106 interface IWordBreaker: IUnknown
107 {
108     HRESULT Init(
109               [in] BOOL fQuery,
110               [in] ULONG ulMaxTokenSize,
111               [out] BOOL *pfLicense);
112     HRESULT BreakText(
113               [in] TEXT_SOURCE *pTextSource,
114               [in] IWordSink *pWordSink,
115               [in] IPhraseSink *pPhraseSink);
116     HRESULT ComposePhrase(
117               [size_is(cwcNoun)][in] const WCHAR *pwcNoun,
118               [in] ULONG cwcNoun,
119               [size_is(cwcModifier)][in] const WCHAR *pwcModifier,
120               [in] ULONG cwcModifier,
121               [in] ULONG ulAttachmentType,
122               [size_is(*pcwcPhrase)][out] WCHAR *pwcPhrase,
123               [out][in] ULONG *pcwcPhrase);
124     HRESULT GetLicenseToUse(
125               [string][out] const WCHAR **ppwcsLicense);
126 }