vfs: check userland buffers before reading them.
[haiku.git] / src / apps / haikudepot / textview / TextSelection.h
blob8fa98e0381495dab28009207e52bcf53cd36e3bd
1 /*
2 * Copyright 2014, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef TEXT_SELECTION_H
6 #define TEXT_SELECTION_H
9 #include <SupportDefs.h>
12 class TextSelection {
13 public:
14 TextSelection();
15 TextSelection(int32 anchor, int32 caret);
16 TextSelection(const TextSelection& other);
18 TextSelection& operator=(const TextSelection& other);
19 bool operator==(const TextSelection& other) const;
20 bool operator!=(const TextSelection& other) const;
22 void SetAnchor(int32 anchor);
23 inline int32 Anchor() const
24 { return fAnchor; }
26 void SetCaret(int32 caret);
27 inline int32 Caret() const
28 { return fCaret; }
30 private:
31 int32 fAnchor;
32 int32 fCaret;
36 #endif // TEXT_SELECTION_H