ReactOS  0.4.15-dev-1207-g698a8e6
gdiplusstringformat.h
Go to the documentation of this file.
1 /*
2  * GdiPlusStringFormat.h
3  *
4  * Windows GDI+
5  *
6  * This file is part of the w32api package.
7  *
8  * THIS SOFTWARE IS NOT COPYRIGHTED
9  *
10  * This source code is offered for use in the public domain. You may
11  * use, modify or distribute it freely.
12  *
13  * This code is distributed in the hope that it will be useful but
14  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
15  * DISCLAIMED. This includes but is not limited to warranties of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17  */
18 
19 #ifndef _GDIPLUSSTRINGFORMAT_H
20 #define _GDIPLUSSTRINGFORMAT_H
21 
22 class StringFormat : public GdiplusBase
23 {
24  public:
25  StringFormat(INT formatFlags = 0, LANGID language = LANG_NEUTRAL) : nativeFormat(NULL)
26  {
28  }
29 
31  {
33  }
34 
35  StringFormat *
36  Clone() const
37  {
38  GpStringFormat *cloneFormat = NULL;
39 
41  if (lastStatus != Ok)
42  return NULL;
43 
44  StringFormat *newFormat = new StringFormat(cloneFormat, lastStatus);
45  if (!newFormat)
47  return newFormat;
48  }
49 
51  {
53  }
54 
55  static const StringFormat *
57  {
58  return NULL; // FIXME
59  }
60 
61  static const StringFormat *
63  {
64  return NULL; // FIXME
65  }
66 
68  GetAlignment() const
69  {
70  StringAlignment alignment;
72  return alignment;
73  }
74 
75  LANGID
77  {
78  LANGID language;
80  return language;
81  }
82 
85  {
86  StringDigitSubstitute substitute;
88  return substitute;
89  }
90 
91  INT
93  {
94  INT flags;
96  return flags;
97  }
98 
101  {
102  HotkeyPrefix hotkeyPrefix;
103  SetStatus(DllExports::GdipGetStringFormatHotkeyPrefix(nativeFormat, reinterpret_cast<INT *>(&hotkeyPrefix)));
104  return hotkeyPrefix;
105  }
106 
107  Status
109  {
110  return lastStatus;
111  }
112 
115  {
116  StringAlignment alignment;
118  return alignment;
119  }
120 
121  INT
123  {
124  INT count;
126  return count;
127  }
128 
129  INT
131  {
132  INT count;
134  return count;
135  }
136 
137  Status
138  GetTabStops(INT count, REAL *firstTabOffset, REAL *tabStops) const
139  {
140  return SetStatus(DllExports::GdipGetStringFormatTabStops(nativeFormat, count, firstTabOffset, tabStops));
141  }
142 
144  GetTrimming() const
145  {
146  StringTrimming trimming;
148  return trimming;
149  }
150 
151  Status
153  {
155  }
156 
157  Status
159  {
161  }
162 
163  Status
165  {
167  }
168 
169  Status
171  {
173  }
174 
175  Status
177  {
179  }
180 
181  Status
183  {
185  }
186 
187  Status
188  SetTabStops(REAL firstTabOffset, INT count, const REAL *tabStops)
189  {
190  return SetStatus(DllExports::GdipSetStringFormatTabStops(nativeFormat, firstTabOffset, count, tabStops));
191  }
192 
193  Status
195  {
197  }
198 
199  protected:
202 
204  {
205  }
206 
207  Status
209  {
210  if (status != Ok)
211  lastStatus = status;
212  return status;
213  }
214 
215  // get native
216  friend inline GpStringFormat *&
217  getNat(const StringFormat *sf)
218  {
219  return const_cast<StringFormat *>(sf)->nativeFormat;
220  }
221 };
222 
223 #endif /* _GDIPLUSSTRINGFORMAT_H */
GpStatus WINGDIPAPI GdipGetStringFormatFlags(GDIPCONST GpStringFormat *format, INT *flags)
Definition: stringformat.c:153
GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges(GpStringFormat *format, INT rangeCount, GDIPCONST CharacterRange *ranges)
Definition: stringformat.c:290
static const StringFormat * GenericTypographic()
Status SetDigitSubstitution(LANGID language, StringDigitSubstitute substitute)
GpStringFormat * nativeFormat
Status SetAlignment(StringAlignment align)
#define LANG_NEUTRAL
Definition: nls.h:22
GLuint GLuint GLsizei count
Definition: gl.h:1545
Status SetTrimming(StringTrimming trimming)
Status GetLastStatus() const
#define INT
Definition: polytest.cpp:20
GpStatus WINGDIPAPI GdipGetStringFormatTabStops(GDIPCONST GpStringFormat *format, INT count, REAL *firsttab, REAL *tabs)
Definition: stringformat.c:210
GpStatus WINGDIPAPI GdipGetStringFormatDigitSubstitution(GDIPCONST GpStringFormat *format, LANGID *language, StringDigitSubstitute *substitute)
Definition: stringformat.c:141
HotkeyPrefix
Definition: gdiplusenums.h:311
WORD LANGID
Definition: typedefs.h:81
int align(int length, int align)
Definition: dsound8.c:36
int32_t INT
Definition: typedefs.h:58
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
StringAlignment
Definition: gdiplusenums.h:263
GpStatus WINGDIPAPI GdipGetStringFormatTabStopCount(GDIPCONST GpStringFormat *format, INT *count)
Definition: stringformat.c:199
GpStatus WINGDIPAPI GdipGetStringFormatHotkeyPrefix(GDIPCONST GpStringFormat *format, INT *hkpx)
Definition: stringformat.c:164
StringFormat(const StringFormat *format)
Status GetTabStops(INT count, REAL *firstTabOffset, REAL *tabStops) const
INT GetTabStopCount() const
StringFormat(INT formatFlags=0, LANGID language=LANG_NEUTRAL)
HotkeyPrefix GetHotkeyPrefix() const
smooth NULL
Definition: ftsmooth.c:416
GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat *format, StringAlignment align)
Definition: stringformat.c:277
GpStatus WINGDIPAPI GdipGetStringFormatMeasurableCharacterRangeCount(GDIPCONST GpStringFormat *format, INT *count)
Definition: stringformat.c:186
GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat *format)
Definition: stringformat.c:105
GpStatus WINGDIPAPI GdipGetStringFormatTrimming(GpStringFormat *format, StringTrimming *trimming)
Definition: stringformat.c:225
GpStatus WINGDIPAPI GdipSetStringFormatTabStops(GpStringFormat *format, REAL firsttab, INT count, GDIPCONST REAL *tabs)
Definition: stringformat.c:312
GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat *format, StringAlignment *align)
Definition: stringformat.c:130
GpStatus WINGDIPAPI GdipSetStringFormatFlags(GpStringFormat *format, INT flags)
Definition: stringformat.c:357
StringTrimming
Definition: gdiplusenums.h:291
Status SetStatus(Status status) const
INT GetFormatFlags() const
Status SetTabStops(REAL firstTabOffset, INT count, const REAL *tabStops)
StringFormat * Clone() const
GLbitfield flags
Definition: glext.h:7161
Status
Definition: gdiplustypes.h:24
StringAlignment GetAlignment() const
StringFormat(GpStringFormat *format, Status status)
LANGID GetDigitSubstitutionLanguage() const
StringTrimming GetTrimming() const
friend GpStringFormat *& getNat(const StringFormat *sf)
INT GetMeasurableCharacterRangeCount() const
static const StringFormat * GenericDefault()
StringAlignment GetLineAlignment() const
GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix(GpStringFormat *format, INT hkpx)
Definition: stringformat.c:264
StringDigitSubstitute GetDigitSubstitutionMethod() const
GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat *format, StringAlignment align)
Definition: stringformat.c:236
GpStatus WINGDIPAPI GdipSetStringFormatTrimming(GpStringFormat *format, StringTrimming trimming)
Definition: stringformat.c:344
StringDigitSubstitute
Definition: gdiplusenums.h:270
GpStatus WINGDIPAPI GdipGetStringFormatLineAlign(GpStringFormat *format, StringAlignment *align)
Definition: stringformat.c:175
Status SetLineAlignment(StringAlignment align)
Status SetFormatFlags(INT flags)
Status SetMeasurableCharacterRanges(INT rangeCount, const CharacterRange *ranges)
Status SetHotkeyPrefix(HotkeyPrefix hotkeyPrefix)
float REAL
Definition: types.h:41
GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpStringFormat **newFormat)
Definition: stringformat.c:369
static SERVICE_STATUS status
Definition: service.c:31
GpStatus WINGDIPAPI GdipSetStringFormatDigitSubstitution(GpStringFormat *format, LANGID language, StringDigitSubstitute substitute)
Definition: stringformat.c:250
GpStatus WINGDIPAPI GdipCreateStringFormat(INT attr, LANGID lang, GpStringFormat **format)
Definition: stringformat.c:76
Definition: ps.c:97