+
+ /// The offset of the left-most cursor position on the row
+ int left_x() const;
+ /// The offset of the right-most cursor position on the row
+ int right_x() const;
+
+ // Return the number of separators in the row
+ int countSeparators() const;
+ // Set the extra spacing for every expanding character in STRING-type
+ // elements. \param w is the total amount of extra width for the row to be
+ // distributed among expanders. \return false if the justification fails.
+ bool setExtraWidth(int w);
+
+ ///
+ void add(pos_type pos, Inset const * ins, Dimension const & dim,
+ Font const & f, Change const & ch);
+ ///
+ void add(pos_type pos, char_type const c,
+ Font const & f, Change const & ch);
+ ///
+ void addVirtual(pos_type pos, docstring const & s,
+ Font const & f, Change const & ch);
+ ///
+ void addSpace(pos_type pos, int width, Font const & f, Change const & ch);
+
+ ///
+ typedef std::vector<Element> Elements;
+ ///
+ typedef Elements::iterator iterator;
+ ///
+ typedef Elements::const_iterator const_iterator;
+ ///
+ iterator begin() { return elements_.begin(); }
+ ///
+ iterator end() { return elements_.end(); }
+ ///
+ const_iterator begin() const { return elements_.begin(); }
+ ///
+ const_iterator end() const { return elements_.end(); }
+
+ ///
+ bool empty() const { return elements_.empty(); }
+ ///
+ Element & front() { return elements_.front(); }
+ ///
+ Element const & front() const { return elements_.front(); }
+ ///
+ Element & back() { return elements_.back(); }
+ ///
+ Element const & back() const { return elements_.back(); }
+ /// remove last element
+ void pop_back();
+ /**
+ * if row width is too large, remove all elements after last
+ * separator and update endpos if necessary. If all that
+ * remains is a large word, cut it to \param width.
+ * \param body_pos minimum amount of text to keep.
+ * \param width maximum width of the row.
+ * \param available width on next row.
+ * \return true if the row has been shortened.
+ */
+ bool shortenIfNeeded(pos_type const body_pos, int const width, int const next_width);
+
+ /**
+ * If last element of the row is a string, compute its width
+ * and mark it final.
+ */
+ void finalizeLast();
+
+ /**
+ * Find sequences of right-to-left elements and reverse them.
+ * This should be called once the row is completely built.
+ */
+ void reverseRTL(bool rtl_par);
+ ///
+ bool isRTL() const { return rtl_; }
+ ///
+ bool needsChangeBar() const { return changebar_; }
+ ///
+ void needsChangeBar(bool ncb) { changebar_ = ncb; }
+
+ /// Find row element that contains \c pos, and compute x offset.
+ const_iterator const findElement(pos_type pos, bool boundary, double & x) const;
+
+ friend std::ostream & operator<<(std::ostream & os, Row const & row);
+
+ /// additional width for separators in justified rows (i.e. space)
+ double separator;
+ /// width of hfills in the label
+ double label_hfill;
+ /// the left margin position of the row
+ int left_margin;
+ /// the right margin of the row
+ int right_margin;
+ ///
+ mutable pos_type sel_beg;
+ ///
+ mutable pos_type sel_end;
+ ///
+ mutable bool begin_margin_sel;
+ ///
+ mutable bool end_margin_sel;