gdiplus: Stub GdipGetStringFormatMeasurableCharacterRangeCount.
[wine.git] / dlls / gdiplus / stringformat.c
blob26ce3ed206ef1b9bc736f32951bba6c83aaf1908
1 /*
3 * Copyright (C) 2007 Google (Evan Stade)
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <stdarg.h>
22 #include "windef.h"
23 #include "winbase.h"
24 #include "wingdi.h"
25 #include "winnls.h"
27 #include "objbase.h"
29 #include "gdiplus.h"
30 #include "gdiplus_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
35 GpStatus WINGDIPAPI GdipCreateStringFormat(INT attr, LANGID lang,
36 GpStringFormat **format)
38 if(!format)
39 return InvalidParameter;
41 *format = GdipAlloc(sizeof(GpStringFormat));
42 if(!*format) return OutOfMemory;
44 (*format)->attr = attr;
45 (*format)->lang = lang;
46 (*format)->trimming = StringTrimmingCharacter;
48 return Ok;
51 GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat *format)
53 if(!format)
54 return InvalidParameter;
56 GdipFree(format);
58 return Ok;
61 GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault(GpStringFormat **format)
63 if (!format)
64 return InvalidParameter;
66 FIXME("stub: %p\n", format);
68 return NotImplemented;
71 GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat *format,
72 StringAlignment *align)
74 if(!format || !align)
75 return InvalidParameter;
77 *align = format->align;
79 return Ok;
82 GpStatus WINGDIPAPI GdipGetStringFormatFlags(GDIPCONST GpStringFormat* format,
83 INT* flags)
85 if (!(format && flags))
86 return InvalidParameter;
88 *flags = format->attr;
90 return Ok;
93 GpStatus WINGDIPAPI GdipGetStringFormatHotkeyPrefix(GDIPCONST GpStringFormat
94 *format, INT *hkpx)
96 if(!format || !hkpx)
97 return InvalidParameter;
99 *hkpx = (INT)format->hkprefix;
101 return Ok;
104 GpStatus WINGDIPAPI GdipGetStringFormatLineAlign(GpStringFormat *format,
105 StringAlignment *align)
107 if(!format || !align)
108 return InvalidParameter;
110 *align = format->vertalign;
112 return Ok;
115 GpStatus WINGDIPAPI GdipGetStringFormatMeasurableCharacterRangeCount(
116 GDIPCONST GpStringFormat* format, INT* count)
118 if (!(format && count))
119 return InvalidParameter;
121 FIXME("stub: %p %p\n", format, count);
123 return NotImplemented;
126 GpStatus WINGDIPAPI GdipGetStringFormatTrimming(GpStringFormat *format,
127 StringTrimming *trimming)
129 if(!format || !trimming)
130 return InvalidParameter;
132 *trimming = format->trimming;
134 return Ok;
137 GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat *format,
138 StringAlignment align)
140 if(!format)
141 return InvalidParameter;
143 format->align = align;
145 return Ok;
148 GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix(GpStringFormat *format,
149 INT hkpx)
151 if(!format || hkpx < 0 || hkpx > 2)
152 return InvalidParameter;
154 format->hkprefix = (HotkeyPrefix) hkpx;
156 return Ok;
159 GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat *format,
160 StringAlignment align)
162 if(!format)
163 return InvalidParameter;
165 format->vertalign = align;
167 return Ok;
170 GpStatus WINGDIPAPI GdipSetStringFormatTrimming(GpStringFormat *format,
171 StringTrimming trimming)
173 if(!format)
174 return InvalidParameter;
176 format->trimming = trimming;
178 return Ok;
181 GpStatus WINGDIPAPI GdipSetStringFormatFlags(GDIPCONST GpStringFormat *format, INT flags)
183 FIXME("format (%p) flags (%d)\n", format, flags);
185 return Ok;
188 GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpStringFormat **newFormat)
190 if(!format || !newFormat)
191 return InvalidParameter;
193 *newFormat = GdipAlloc(sizeof(GpStringFormat));
194 if(!*newFormat) return OutOfMemory;
196 **newFormat = *format;
198 TRACE("%p %p\n",format,newFormat);
200 return Ok;