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

ucaret.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/ucaret.hpp 00008 begin : Thu Sep 6 2001 00009 $Id: ucaret.hpp,v 1.10 2005/05/21 15:17:23 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 UCARET_HPP 00029 #define UCARET_HPP 00030 00031 #include "../uobject.hpp" 00032 #include "../signals/usignal.hpp" 00033 00034 namespace ufo { 00035 00036 class UWidget; 00037 class UTextEdit; 00038 class UDocument; 00039 00049 class UFO_EXPORT UCaret : public UObject { 00050 UFO_DECLARE_ABSTRACT_CLASS(UCaret) 00051 public:/* 00052 UCaret(); 00053 virtual ~UCaret(); 00054 */ 00057 virtual void setPosition(unsigned int posA) = 0; 00058 virtual unsigned int getPosition() const = 0; 00059 00064 virtual void setMark(unsigned int mark) = 0; 00067 virtual unsigned int getMark() const = 0; 00068 00069 00073 virtual void movePosition(unsigned int newPosition) = 0; 00074 00075 virtual UDocument * getDocument() const = 0; 00076 00077 public: // Public signals 00078 typedef USignal3<UCaret*, unsigned int, unsigned int> CaretSignal; 00080 CaretSignal & sigPositionChanged(); 00081 00082 private: // Private attributes 00083 CaretSignal m_sigPositionChanged; 00084 }; 00085 00086 // 00087 // inline implementation 00088 // 00089 00090 inline UCaret::CaretSignal & 00091 UCaret::sigPositionChanged() { 00092 return m_sigPositionChanged; 00093 } 00094 /* 00095 // Paints the caret 00096 virtual void paint(); 00097 00098 // Sets the default blink rate of the cursor. Currently not supported. 00099 virtual void setBlinkRate(int blinkRateA); 00100 virtual int getBlinkRate() const; 00101 00102 // @return the text widget which this caret is dedicated to. 00103 00104 virtual const UTextEdit * getWidget() const; 00105 00106 virtual void setVisible(bool v); 00107 virtual bool isVisible() const; 00108 00109 protected: // Protected slots 00110 void textInserted(UDocument * doc, unsigned int offset, unsigned int length); 00111 void textRemoved(UDocument * doc, unsigned int offset, unsigned int length); 00112 00113 protected: 00114 int m_position; 00115 int m_mark; 00116 00117 int m_blinkRate; 00118 00119 UTextEdit * m_textWidget; 00120 00121 bool m_isVisible; 00122 }; 00123 */ 00124 } // namespace ufo 00125 00126 #endif // UCARET_HPP

The libUFO Project - written by Johannes Schmidt