4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * Provide a set of typedefs for commonly used things like sizes and
8 * indices wile trying to stay compatible with types used
9 * by the standard containers.
11 * \author André Pönitz
13 * Full author contact details are available in file CREDITS.
19 #include "docstring.h"
21 #include <boost/cstdint.hpp>
28 // The type used to hold characters in paragraphs
29 typedef boost::uint32_t char_type; // Possibly the ucs-4 type we will use
30 //typedef wchar_t char_type; // The wide char type CJK-LyX uses
31 //typedef char char_type; // Current narrow char type in use
33 //typedef std::wstring docstring;
35 /// a type for positions used in paragraphs
36 // needs to be signed for a while to hold the special value -1 that is
38 typedef ptrdiff_t pos_type;
40 /// a type for paragraph offsets
41 // FIXME: should be unsigned as well.
42 // however, simply changing it breaks a downward loop somewhere...
43 typedef ptrdiff_t pit_type;
45 /// a type for the nesting depth of a paragraph
46 typedef size_t depth_type;
48 // set this to '0' if you want to have really safe types
52 typedef size_t size_type;
54 /// a type used for numbering text classes
55 typedef size_t textclass_type;
59 // These structs wrap simple things to make them distinguishible
61 // It's a shame that different typedefs are not "really" different
65 typedef size_t base_type;
67 size_type(base_type t) { data_ = t; }
69 operator base_type() const { return data_; }
75 struct textclass_type {
77 typedef size_t base_type;
79 textclass_type(base_type t) { data_ = t; }
81 operator base_type() const { return data_; }
92 // the word around the cursor, only if the cursor is
95 // the word around the cursor
97 /// the word begining from the cursor position
99 /// the word around the cursor or before the cursor
101 /// the next word (not yet used)
107 #endif // LYX_TYPES_H