SelectionSubtreeRoot.h [plain text]
#ifndef SelectionSubtreeRoot_h
#define SelectionSubtreeRoot_h
#include "RenderObject.h"
namespace WebCore {
class Document;
class SelectionSubtreeRoot {
public:
SelectionSubtreeRoot();
RenderObject* selectionStart() const { return m_selectionStart; }
int selectionStartPos() const { return m_selectionStartPos; }
RenderObject* selectionEnd() const { return m_selectionEnd; }
int selectionEndPos() const { return m_selectionEndPos; }
void selectionStartEndPositions(int& startPos, int& endPos) const
{
startPos = m_selectionStartPos;
endPos = m_selectionEndPos;
}
bool selectionClear() const
{
return !m_selectionStart
&& (m_selectionStartPos == -1)
&& !m_selectionEnd
&& (m_selectionEndPos == -1);
}
void setSelectionStart(RenderObject* selectionStart) { m_selectionStart = selectionStart; }
void setSelectionStartPos(int selectionStartPos) { m_selectionStartPos = selectionStartPos; }
void setSelectionEnd(RenderObject* selectionEnd) { m_selectionEnd = selectionEnd; }
void setSelectionEndPos(int selectionEndPos) { m_selectionEndPos = selectionEndPos; }
void adjustForVisibleSelection(Document&);
private:
RenderObject* m_selectionStart;
int m_selectionStartPos;
RenderObject* m_selectionEnd;
int m_selectionEndPos;
};
}
#endif // SelectionSubtreeRoot_h