00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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
00095
00096
00097
public:
00098
typedef USignal4<UDocument*,
unsigned int,
00099
unsigned int,
unsigned int> DocumentSignal;
00100
00105 DocumentSignal & sigTextReplaced();
00106
00107
private:
00108 DocumentSignal m_sigTextReplaced;
00109 };
00110
00111
00112
00113
00114
00115
inline UDocument::DocumentSignal &
00116 UDocument::sigTextReplaced() {
00117
return m_sigTextReplaced;
00118 }
00119
00120 }
00121
00122
#endif // UDOCUMENT_HPP