File: NullTextModel.cpp

package info (click to toggle)
subcommander 2.0.0~b5p2-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 15,344 kB
  • sloc: cpp: 63,594; sh: 4,050; xml: 1,992; makefile: 1,134; ansic: 786; ruby: 251; lisp: 24
file content (157 lines) | stat: -rw-r--r-- 2,465 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/* ====================================================================
 * Copyright (c) 2003-2007, Martin Hauner
 *                          http://subcommander.tigris.org
 *
 * Subcommander is licensed as described in the file doc/COPYING, which
 * you should have received as part of this distribution.
 * ====================================================================
 */

#include "NullTextModel.h"
#include "Line.h"
#include "Cursor.h"

static const sc::String string( "null" );
static const sc::String empty;
static const Cursor     cursor;

NullTextModel NullTextModel::_instance;


NullTextModel* NullTextModel::getInstance()
{
  return &_instance;
}

NullTextModel::~NullTextModel()
{
}

const Line& NullTextModel::getLine( sc::Size /*svn::Offset*/ )
{
  return Line::getEmpty();
}

BlockInfo NullTextModel::getBlockInfo( int block )
{
  return BlockInfo();
}

size_t NullTextModel::getLineCnt()
{
  // minimum value that doesn't make the Splitter widget crazy.
  return 3;
}

size_t NullTextModel::getColumnCnt()
{
  // minimum value that doesn't make the Splitter widget crazy.
  return 3;
}

LineEnd NullTextModel::getLineEnd()
{
  return leNone;
}

unsigned int NullTextModel::getTabWidth()
{
  return 0;
}

const sc::String& NullTextModel::getSourceName()
{
  return string;
}

int NullTextModel::replaceBlock( int /*block*/, TextModel* /*src*/ )
{
  return 0;
}

const Cursor& NullTextModel::getCursor()
{
  return cursor;
}

const Cursor& NullTextModel::getCursor2()
{
  return cursor;
}

void NullTextModel::setCursor( const Cursor& )
{
}

void NullTextModel::setCursor2( const Cursor& )
{
}

Cursor NullTextModel::moveCursorRight( bool moveC2 )
{
  return cursor;
}

Cursor NullTextModel::moveCursorLeft( bool moveC2 )
{
  return cursor;
}

Cursor NullTextModel::moveCursorDown( bool moveC2 )
{
  return cursor;
}

Cursor NullTextModel::moveCursorUp( bool moveC2 )
{
  return cursor;
}

int NullTextModel::getLastColumn()
{
  return 0;
}

void NullTextModel::setLastColumn( int /*col*/ )
{
}

Cursor NullTextModel::calcNearestCursorPos( const Cursor& /*c*/ )
{
  return cursor;
}

void NullTextModel::addText( const sc::String& )
{
}

void NullTextModel::removeTextLeft()
{
}

void NullTextModel::removeTextRight()
{
}

sc::String NullTextModel::getHighlightedText()
{
  return empty;
}

void NullTextModel::undo()
{
}

void NullTextModel::redo()
{
}

bool NullTextModel::hasUndo()
{
  return false;
}

void NullTextModel::clearUndo()
{
}