dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

selection.hh
Go to the documentation of this file.
1 #ifndef __DW_SELECTION_H__
2 #define __DW_SELECTION_H__
3 
4 #ifndef __INCLUDED_FROM_DW_CORE_HH__
5 # error Do not include this file directly, use "core.hh" instead.
6 #endif
7 
8 namespace dw {
9 namespace core {
10 
179 {
180 public:
181  enum { END_OF_WORD = 1 << 30 };
182 
183 private:
185 
186  // selection
187  enum {
191  } selectionState;
192 
195 
196  // link handling
197  enum {
200  } linkState;
201 
205 
206  void resetSelection ();
207  void resetLink ();
208  void switchLinkToSelection (Iterator *it, int charPos);
209  void adjustSelection (Iterator *it, int charPos);
210  static int correctCharPos (DeepIterator *it, int charPos);
211 
212  void highlight (bool fl, int dir)
213  { highlight0 (fl, from, fromChar, to, toChar, dir); }
214 
215  void highlight0 (bool fl, DeepIterator *from, int fromChar,
216  DeepIterator *to, int toChar, int dir);
217  void copy ();
218 
219 public:
221 
222  SelectionState ();
223  ~SelectionState ();
224 
225  inline void setLayout (Layout *layout) { this->layout = layout; }
226  void reset ();
227  bool buttonPress (Iterator *it, int charPos, int linkNo,
228  EventButton *event);
229  bool buttonRelease (Iterator *it, int charPos, int linkNo,
230  EventButton *event);
231  bool buttonMotion (Iterator *it, int charPos, int linkNo,
232  EventMotion *event);
233 
234  bool handleEvent (EventType eventType, Iterator *it, int charPos,
235  int linkNo, MousePositionEvent *event);
236 };
237 
238 } // namespace core
239 } // namespace dw
240 
241 #endif // __DW_SELECTION_H__
dw::core::SelectionState::SELECTED
Definition: selection.hh:190
dw::core::SelectionState::buttonMotion
bool buttonMotion(Iterator *it, int charPos, int linkNo, EventMotion *event)
Definition: selection.cc:192
dw::core::SelectionState::resetLink
void resetLink()
Definition: selection.cc:85
dw::core::SelectionState::switchLinkToSelection
void switchLinkToSelection(Iterator *it, int charPos)
This method is called when the user decides not to activate a link, but instead select text.
Definition: selection.cc:242
dw::core::SelectionState::LINK_NONE
Definition: selection.hh:198
dw::core::SelectionState::setLayout
void setLayout(Layout *layout)
Definition: selection.hh:225
dw::core::SelectionState::BUTTON_MOTION
Definition: selection.hh:220
dw::core::SelectionState::EventType
EventType
Definition: selection.hh:220
dw::core::MousePositionEvent
Base class for all mouse events related to a specific position.
Definition: events.hh:48
dw::core::EventButton
Represents a button press or release event.
Definition: events.hh:57
dw::core::SelectionState::from
DeepIterator * from
Definition: selection.hh:193
dw::core::SelectionState::linkNumber
int linkNumber
Definition: selection.hh:204
dw::core::DeepIterator
A stack of iterators, to iterate recursively through a widget tree.
Definition: iterator.hh:145
dw::core::Iterator
Iterators are used to iterate through the contents of a widget.
Definition: iterator.hh:19
dw::core::SelectionState::END_OF_WORD
Definition: selection.hh:181
dw::core::SelectionState::to
DeepIterator * to
Definition: selection.hh:193
dw::core::SelectionState::linkButton
int linkButton
Definition: selection.hh:202
dw::core::SelectionState::NONE
Definition: selection.hh:188
dw::core::SelectionState::selectionState
enum dw::core::SelectionState::@10 selectionState
dw::core::SelectionState::SELECTING
Definition: selection.hh:189
dw::core::SelectionState::highlight0
void highlight0(bool fl, DeepIterator *from, int fromChar, DeepIterator *to, int toChar, int dir)
Definition: selection.cc:351
dw::core::SelectionState::correctCharPos
static int correctCharPos(DeepIterator *it, int charPos)
This method deals especially with the case that a widget passes dw::core::SelectionState::END_OF_WORD...
Definition: selection.cc:338
dw::core::SelectionState::buttonRelease
bool buttonRelease(Iterator *it, int charPos, int linkNo, EventButton *event)
Definition: selection.cc:150
dw::core::SelectionState::LINK_PRESSED
Definition: selection.hh:199
dw::core::SelectionState::linkState
enum dw::core::SelectionState::@11 linkState
dw::core::EventMotion
Represents a mouse motion event.
Definition: events.hh:67
dw::core::SelectionState::link
DeepIterator * link
Definition: selection.hh:203
dw::core::Layout
The central class for managing and drawing a widget tree.
Definition: layout.hh:16
dw::core::SelectionState::toChar
int toChar
Definition: selection.hh:194
dw::core::SelectionState::SelectionState
SelectionState()
Definition: selection.cc:47
dw::core::SelectionState::layout
Layout * layout
Definition: selection.hh:184
dw::core::SelectionState
This class handles selections, as well as activation of links, which is closely related.
Definition: selection.hh:178
dw::core::SelectionState::adjustSelection
void adjustSelection(Iterator *it, int charPos)
This method is used by core::dw::SelectionState::buttonMotion and core::dw::SelectionState::buttonRel...
Definition: selection.cc:275
dw::core::SelectionState::highlight
void highlight(bool fl, int dir)
Definition: selection.hh:212
dw::core::SelectionState::copy
void copy()
Definition: selection.cc:407
dw::core::SelectionState::BUTTON_PRESS
Definition: selection.hh:220
dw::core::SelectionState::fromChar
int fromChar
Definition: selection.hh:194
dw::core::SelectionState::BUTTON_RELEASE
Definition: selection.hh:220
dw::core::SelectionState::handleEvent
bool handleEvent(EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event)
General form of dw::core::SelectionState::buttonPress, dw::core::SelectionState::buttonRelease and dw...
Definition: selection.cc:215
dw::core::SelectionState::~SelectionState
~SelectionState()
Definition: selection.cc:61
dw::core::SelectionState::buttonPress
bool buttonPress(Iterator *it, int charPos, int linkNo, EventButton *event)
Definition: selection.cc:93
dw
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtextblock.cc:26
dw::core::SelectionState::reset
void reset()
Definition: selection.cc:67
dw::core::SelectionState::resetSelection
void resetSelection()
Definition: selection.cc:73
dw::core::SelectionState::linkChar
int linkChar
Definition: selection.hh:204