vfs: check userland buffers before reading them.
[haiku.git] / src / apps / people / AttributeTextControl.h
blobb1d55aade685c7ff7c2b889296c40007a331711a
1 /*
2 * Copyright 2005-2011, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Robert Polic
8 * Copyright 1999, Be Incorporated. All Rights Reserved.
9 * This file may be used under the terms of the Be Sample Code License.
11 #ifndef ATTRIBUTE_TEXT_CONTROL_H
12 #define ATTRIBUTE_TEXT_CONTROL_H
14 #include <String.h>
15 #include <TextControl.h>
18 class AttributeTextControl : public BTextControl {
19 public:
20 AttributeTextControl(const char* label,
21 const char* attribute);
22 virtual ~AttributeTextControl();
24 virtual void MouseDown(BPoint);
25 virtual void MouseMoved(BPoint, uint32, const BMessage*);
27 bool HasChanged();
28 void Revert();
29 void Update();
31 const BString& Attribute() const
32 { return fAttribute; }
34 private:
35 const BString& _MakeUniformUrl(BString &url) const;
36 const BString& _BuildMimeString(BString &mimeType,
37 const BString &url) const;
39 bool _ContainsUrl() const;
41 BRect _VisibleLabelBounds() const;
42 void _HandleLabelClicked(const char*);
44 private:
45 BString fAttribute;
46 BString fOriginalValue;
49 #endif // ATTRIBUTE_TEXT_CONTROL_H