- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

udocument.hpp

00001 /*************************************************************************** 00002 LibUFO - UI For OpenGL 00003 copyright : (C) 2001-2005 by Johannes Schmidt 00004 email : schmidtjf at users.sourceforge.net 00005 ------------------- 00006 00007 file : include/ufo/text/udocument.hpp 00008 begin : Fri Aug 31 2001 00009 $Id: udocument.hpp,v 1.12 2005/05/21 16:18:09 schmidtjf Exp $ 00010 ***************************************************************************/ 00011 00012 /*************************************************************************** 00013 * This library is free software; you can redistribute it and/or * 00014 * modify it under the terms of the GNU Lesser General Public * 00015 * License as published by the Free Software Foundation; either * 00016 * version 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00021 * Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 00026 ***************************************************************************/ 00027 00028 #ifndef UDOCUMENT_HPP 00029 #define UDOCUMENT_HPP 00030 00031 #include "../uobject.hpp" 00032 00033 #include "../signals/usignal.hpp" 00034 00035 namespace ufo { 00036 00037 class UCaret; 00038 00049 class UFO_EXPORT UDocument : public UObject { 00050 UFO_DECLARE_ABSTRACT_CLASS(UDocument) 00051 public: 00056 virtual const char * getText() const = 0; 00057 00059 virtual unsigned int getLength() const = 0; 00060 00062 virtual void clear() = 0; 00064 virtual void append(const char * chars, unsigned int nChars) = 0; 00065 00070 virtual void replaceSelection(const char * chars, unsigned int nChars) = 0; 00071 00075 virtual void insertString(unsigned int offset, 00076 const char * chars, unsigned int nChars) = 0; 00077 00080 virtual void remove(unsigned int offset, unsigned int length) = 0; 00081 00085 virtual void replace(unsigned int offset, unsigned int length, 00086 const char * chars, unsigned int nChars) = 0; 00087 00092 virtual UCaret * getCaret() const = 0; 00093 00094 //virtual void setCaret(UCaret * caret) = 0; 00095 00096 00097 public: // Public signals 00098 typedef USignal4<UDocument*, unsigned int, 00099 unsigned int, unsigned int> DocumentSignal; 00100 00105 DocumentSignal & sigTextReplaced(); 00106 00107 private: // Private attributes 00108 DocumentSignal m_sigTextReplaced; 00109 }; 00110 00111 // 00112 // inline implementation 00113 // 00114 00115 inline UDocument::DocumentSignal & 00116 UDocument::sigTextReplaced() { 00117 return m_sigTextReplaced; 00118 } 00119 00120 } // namespace ufo 00121 00122 #endif // UDOCUMENT_HPP

The libUFO Project - written by Johannes Schmidt