btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / aboutsystem / HyperTextView.h
blobb9d6c2abf76adae0de3a2b15a3f7419ce9dd5a31
1 /*
2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT license.
4 */
5 #ifndef HYPER_TEXT_VIEW_H
6 #define HYPER_TEXT_VIEW_H
8 #include <TextView.h>
11 // TODO: The current implementation works correctly only for insertions at the
12 // end of the text. It doesn't keep track of any other insertions or deletions.
15 class HyperTextView;
18 class HyperTextAction {
19 public:
20 HyperTextAction();
21 virtual ~HyperTextAction();
23 virtual void MouseOver(HyperTextView* view, BPoint where,
24 BMessage* message);
25 virtual void Clicked(HyperTextView* view, BPoint where,
26 BMessage* message);
30 class HyperTextView : public BTextView {
31 public:
32 HyperTextView(const char* name,
33 uint32 flags = B_WILL_DRAW
34 | B_PULSE_NEEDED);
35 HyperTextView(BRect frame, const char* name,
36 BRect textRect, uint32 resizeMask,
37 uint32 flags = B_WILL_DRAW
38 | B_PULSE_NEEDED);
39 virtual ~HyperTextView();
41 virtual void MouseDown(BPoint where);
42 virtual void MouseUp(BPoint where);
43 virtual void MouseMoved(BPoint where, uint32 transit,
44 const BMessage* dragMessage);
46 void AddHyperTextAction(int32 startOffset,
47 int32 endOffset, HyperTextAction* action);
49 void InsertHyperText(const char* inText,
50 HyperTextAction* action,
51 const text_run_array* inRuns = NULL);
52 void InsertHyperText(const char* inText,
53 int32 inLength, HyperTextAction* action,
54 const text_run_array* inRuns = NULL);
55 private:
56 HyperTextAction* _ActionAt(const BPoint& where) const;
58 struct ActionInfo;
59 class ActionInfoList;
61 ActionInfoList* fActionInfos;
65 #endif // HYPER_TEXT_VIEW_H