00001 00007 /* 00008 This library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Lesser General Public 00010 License as published by the Free Software Foundation; either 00011 version 2.1 of the License, or (at your option) any later version. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with this library; if not, write to the Free Software 00020 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 #ifndef OMGUI_TEXTWIDGET_H 00024 #define OMGUI_TEXTWIDGET_H 00025 00026 #include <omgui/widget.h> 00027 #include <omgui/initializer/textwidget.h> 00028 00029 namespace omgui { 00030 00043 class OMGUI_API TextWidget : public Widget 00044 { 00045 public: 00046 typedef omgui::api::TextWidget api_type; 00047 typedef omgui::event_traits<TextWidget> event_traits; 00048 00052 void set_text(const string &s); 00053 00057 string get_text() const; 00058 00062 string get_text(const TextRange &range) const; 00063 00083 TextRange get_selection_range() const; 00084 00099 void set_selection_range(const TextRange &range); 00100 00118 bool get_selection_bounds(TextRange &range) const; 00119 00130 void set_selection_bounds(const TextRange &range); 00131 00135 text_range_t get_insertion_point() const; 00136 00145 void set_insertion_point(text_range_t pos); 00146 00150 void delete_range(const TextRange &range); 00151 00156 text_range_t insert_text(const string &str, text_range_t pos); 00157 00162 text_range_t insert_text(const string &str); 00163 00167 text_range_t get_length() const; 00168 00173 void set_max_length(text_range_t len); 00174 00179 void set_read_only(bool b); 00180 00184 bool is_read_only() const; 00185 00186 protected: 00187 TextWidget(object_id id, api_type *impl); 00188 00189 private: 00190 api_type *m_impl; 00191 00192 public: 00193 api_type *get_impl() const; 00194 }; 00195 00196 } // omgui 00197 00198 #endif