2 * Copyright (C) 2009 by Aiwota Programmer
3 * aiwotaprog@tetteke.tk
5 * This file is part of Dialektos.
7 * Dialektos is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * Dialektos is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Dialektos. If not, see <http://www.gnu.org/licenses/>.
24 #include <boost/ptr_container/ptr_vector.hpp>
35 namespace text_element {
40 typedef boost::ptr_vector<text_element::Plain> ElementListType;
42 explicit TextLine(int res_num, int left_margin);
43 explicit TextLine(const TextLine& rhs);
45 void add_element(text_element::Plain* element);
48 void layout(text_view::LayoutSet&);
49 void draw(text_view::DrawingSet&) const;
50 double get_height() const { return height_; }
51 /* return y position on the adjustment. */
52 double get_y() const { return y_; }
53 double get_btm_y() const { return y_ + height_; }
54 const text_element::Plain* get_text_element(double x, double y) const;
55 const text_element::Plain* get_nearest_text_element(
56 double& x, double& y) const;
57 int get_res_num() const { return res_num_; }
60 ElementListType element_list_;
62 double y_; // y on the adjustment.
69 } // namespace dialektos