2 * Copyright 2003-2009, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Stefano Ceccherini (stefano.ceccherini@gmail.com)
9 #include "InlineInput.h"
20 InlineInput::InlineInput(BMessenger messenger
)
22 fMessenger(messenger
),
32 InlineInput::~InlineInput()
39 InlineInput::Method() const
46 InlineInput::String() const
48 return fString
.String();
53 InlineInput::SetString(const char *string
)
60 InlineInput::IsActive() const
67 InlineInput::SetActive(bool active
)
74 InlineInput::SelectionLength() const
76 return fSelectionLength
;
81 InlineInput::SetSelectionLength(int32 length
)
83 fSelectionLength
= length
;
88 InlineInput::SelectionOffset() const
90 return fSelectionOffset
;
95 InlineInput::SetSelectionOffset(int32 offset
)
97 fSelectionOffset
= offset
;
102 InlineInput::AddClause(int32 start
, int32 end
)
104 void *newData
= realloc(fClauses
, (fNumClauses
+ 1) * sizeof(clause
));
108 fClauses
= (clause
*)newData
;
109 fClauses
[fNumClauses
].start
= start
;
110 fClauses
[fNumClauses
].end
= end
;
117 InlineInput::GetClause(int32 index
, int32
*start
, int32
*end
) const
120 if (index
>= 0 && index
< fNumClauses
) {
122 clause
*clause
= &fClauses
[index
];
124 *start
= clause
->start
;
134 InlineInput::CountClauses() const
141 InlineInput::ResetClauses()