vfs: check userland buffers before reading them.
[haiku.git] / src / apps / debugger / user_interface / gui / value / TableCellValueEditor.cpp
blob4fe05728573973b67a573c687628a38cc1df9c93
1 /*
2 * Copyright 2015, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
6 #include "TableCellValueEditor.h"
8 #include "Value.h"
11 TableCellValueEditor::TableCellValueEditor()
13 BReferenceable(),
14 fInitialValue(NULL)
19 TableCellValueEditor::~TableCellValueEditor()
21 if (fInitialValue != NULL)
22 fInitialValue->ReleaseReference();
26 void
27 TableCellValueEditor::AddListener(Listener* listener)
29 fListeners.Add(listener);
33 void
34 TableCellValueEditor::RemoveListener(Listener* listener)
36 fListeners.Remove(listener);
40 void
41 TableCellValueEditor::SetInitialValue(Value* value)
43 if (fInitialValue != NULL)
44 fInitialValue->ReleaseReference();
46 fInitialValue = value;
47 if (fInitialValue != NULL)
48 fInitialValue->AcquireReference();
52 void
53 TableCellValueEditor::NotifyEditBeginning()
55 for (ListenerList::Iterator it = fListeners.GetIterator();
56 Listener* listener = it.Next();) {
57 listener->TableCellEditBeginning();
62 void
63 TableCellValueEditor::NotifyEditCancelled()
65 for (ListenerList::Iterator it = fListeners.GetIterator();
66 Listener* listener = it.Next();) {
67 listener->TableCellEditCancelled();
72 void
73 TableCellValueEditor::NotifyEditCompleted(Value* newValue)
75 for (ListenerList::Iterator it = fListeners.GetIterator();
76 Listener* listener = it.Next();) {
77 listener->TableCellEditEnded(newValue);
82 // #pragma mark - TableCellValueEditor::Listener
85 TableCellValueEditor::Listener::~Listener()
90 void
91 TableCellValueEditor::Listener::TableCellEditBeginning()
96 void
97 TableCellValueEditor::Listener::TableCellEditCancelled()
102 void
103 TableCellValueEditor::Listener::TableCellEditEnded(Value* newValue)