gdiplus: Stub GdipStringFormatGetGenericDefault.
[wine] / dlls / gdiplus / stringformat.c
1 /*
2  *
3  * Copyright (C) 2007 Google (Evan Stade)
4  *
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.
9  *
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.
14  *
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
18  */
19
20 #include <stdarg.h>
21
22 #include "windef.h"
23 #include "winbase.h"
24 #include "wingdi.h"
25 #include "winnls.h"
26
27 #include "objbase.h"
28
29 #include "gdiplus.h"
30 #include "gdiplus_private.h"
31 #include "wine/debug.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
34
35 GpStatus WINGDIPAPI GdipCreateStringFormat(INT attr, LANGID lang,
36     GpStringFormat **format)
37 {
38     if(!format)
39         return InvalidParameter;
40
41     *format = GdipAlloc(sizeof(GpStringFormat));
42     if(!*format)   return OutOfMemory;
43
44     (*format)->attr = attr;
45     (*format)->lang = lang;
46     (*format)->trimming = StringTrimmingCharacter;
47
48     return Ok;
49 }
50
51 GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat *format)
52 {
53     if(!format)
54         return InvalidParameter;
55
56     GdipFree(format);
57
58     return Ok;
59 }
60
61 GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault(GpStringFormat **format)
62 {
63     if (!format)
64         return InvalidParameter;
65
66     FIXME("stub: %p\n", format);
67
68     return NotImplemented;
69 }
70
71 GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat *format,
72     StringAlignment *align)
73 {
74     if(!format || !align)
75         return InvalidParameter;
76
77     *align = format->align;
78
79     return Ok;
80 }
81
82 GpStatus WINGDIPAPI GdipGetStringFormatHotkeyPrefix(GDIPCONST GpStringFormat
83     *format, INT *hkpx)
84 {
85     if(!format || !hkpx)
86         return InvalidParameter;
87
88     *hkpx = (INT)format->hkprefix;
89
90     return Ok;
91 }
92
93 GpStatus WINGDIPAPI GdipGetStringFormatLineAlign(GpStringFormat *format,
94     StringAlignment *align)
95 {
96     if(!format || !align)
97         return InvalidParameter;
98
99     *align = format->vertalign;
100
101     return Ok;
102 }
103
104 GpStatus WINGDIPAPI GdipGetStringFormatTrimming(GpStringFormat *format,
105     StringTrimming *trimming)
106 {
107     if(!format || !trimming)
108         return InvalidParameter;
109
110     *trimming = format->trimming;
111
112     return Ok;
113 }
114
115 GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat *format,
116     StringAlignment align)
117 {
118     if(!format)
119         return InvalidParameter;
120
121     format->align = align;
122
123     return Ok;
124 }
125
126 GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix(GpStringFormat *format,
127     INT hkpx)
128 {
129     if(!format || hkpx < 0 || hkpx > 2)
130         return InvalidParameter;
131
132     format->hkprefix = (HotkeyPrefix) hkpx;
133
134     return Ok;
135 }
136
137 GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat *format,
138     StringAlignment align)
139 {
140     if(!format)
141         return InvalidParameter;
142
143     format->vertalign = align;
144
145     return Ok;
146 }
147
148 GpStatus WINGDIPAPI GdipSetStringFormatTrimming(GpStringFormat *format,
149     StringTrimming trimming)
150 {
151     if(!format)
152         return InvalidParameter;
153
154     format->trimming = trimming;
155
156     return Ok;
157 }
158
159 GpStatus WINGDIPAPI GdipSetStringFormatFlags(GDIPCONST GpStringFormat *format, INT flags)
160 {
161     FIXME("format (%p) flags (%d)\n", format, flags);
162
163     return Ok;
164 }
165
166 GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpStringFormat **newFormat)
167 {
168     if(!format || !newFormat)
169         return InvalidParameter;
170
171     *newFormat = GdipAlloc(sizeof(GpStringFormat));
172     if(!*newFormat)    return OutOfMemory;
173
174     **newFormat = *format;
175
176     TRACE("%p %p\n",format,newFormat);
177
178     return Ok;
179 }