• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

lokalize

  • sources
  • kde-4.12
  • kdesdk
  • lokalize
  • src
  • catalog
cmd.cpp
Go to the documentation of this file.
1 /* ****************************************************************************
2  This file is part of Lokalize
3 
4  Copyright (C) 2007-2011 by Nick Shaforostoff <shafff@ukr.net>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License as
8  published by the Free Software Foundation; either version 2 of
9  the License or (at your option) version 3 or any later version
10  accepted by the membership of KDE e.V. (or its successor approved
11  by the membership of KDE e.V.), which shall act as a proxy
12  defined in Section 14 of version 3 of the license.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 **************************************************************************** */
23 
24 #include "cmd.h"
25 
26 #include <QString>
27 
28 #include <klocale.h>
29 #include <kdebug.h>
30 
31 #include "catalog_private.h"
32 #include "catalogitem_private.h"
33 #include "catalog.h"
34 #include <project.h>
35 
36 
37 //BEGIN LokalizeUnitCmd
38 LokalizeUnitCmd::LokalizeUnitCmd(Catalog *catalog, const DocPosition& pos, const QString& name=QString())
39  : QUndoCommand(name)
40  , _catalog(catalog)
41  , _pos(pos)
42  , _firstModificationForThisEntry(false)
43 {}
44 
45 static QString setPhaseForPart(Catalog* catalog, const QString& phase, DocPosition phasePos, DocPosition::Part part)
46 {
47  phasePos.part=part;
48  return catalog->setPhase(phasePos,phase);
49 }
50 
51 void LokalizeUnitCmd::redo()
52 {
53  setJumpingPos();
54  doRedo();
55  _firstModificationForThisEntry=_catalog->setModified(DocPos(_pos),true);
56  _prevPhase=setPhaseForPart(_catalog,_catalog->activePhase(),_pos,DocPosition::UndefPart);
57 }
58 
59 void LokalizeUnitCmd::undo()
60 {
61  setJumpingPos();
62  doUndo();
63  if (_firstModificationForThisEntry)
64  _catalog->setModified(DocPos(_pos),false);
65  setPhaseForPart(_catalog,_prevPhase,_pos,DocPosition::UndefPart);
66 }
67 
68 void LokalizeUnitCmd::setJumpingPos()
69 {
70  _catalog->setLastModifiedPos(_pos);
71 }
72 //END LokalizeUnitCmd
73 
74 //BEGIN LokalizeTargetCmd
75 LokalizeTargetCmd::LokalizeTargetCmd(Catalog *catalog, const DocPosition& pos, const QString& name=QString())
76  : LokalizeUnitCmd(catalog,pos,name)
77 {}
78 
79 void LokalizeTargetCmd::redo()
80 {
81  LokalizeUnitCmd::redo();
82  _prevTargetPhase=setPhaseForPart(_catalog,_catalog->activePhase(),_pos,DocPosition::Target);
83 }
84 
85 void LokalizeTargetCmd::undo()
86 {
87  LokalizeUnitCmd::undo();
88  setPhaseForPart(_catalog,_prevTargetPhase,_pos,DocPosition::Target);
89 }
90 //END LokalizeTargetCmd
91 
92 //BEGIN InsTextCmd
93 InsTextCmd::InsTextCmd(Catalog *catalog, const DocPosition& pos, const QString& str)
94  : LokalizeTargetCmd(catalog,pos,i18nc("@item Undo action item","Insertion"))
95  , _str(str)
96 {}
97 
98 bool InsTextCmd::mergeWith(const QUndoCommand *other)
99 {
100  const DocPosition otherPos=static_cast<const LokalizeUnitCmd*>(other)->pos();
101  if ((other->id() != id())
102  || (otherPos.entry!=_pos.entry)
103  || (otherPos.form!=_pos.form)
104  || (otherPos.offset!=_pos.offset+_str.size())
105  )
106  return false;
107  const QString& otherStr = static_cast<const InsTextCmd*>(other)->_str;
108 
109  if (otherStr.isEmpty() || _str.isEmpty()) //just a precaution
110  return false;
111 
112  //be close to behaviour of LibreOffice
113  if (!_str.at(_str.size()-1).isSpace() && otherStr.at(0).isSpace())
114  return false;
115 
116  _str += otherStr;
117  return true;
118 }
119 
120 void InsTextCmd::doRedo()
121 {
122  Catalog& catalog=*_catalog;
123  DocPosition pos=_pos; pos.offset+=_str.size();
124  catalog.setLastModifiedPos(pos);
125  catalog.targetInsert(_pos,_str);
126 }
127 
128 void InsTextCmd::doUndo()
129 {
130  _catalog->targetDelete(_pos,_str.size());
131 }
132 //END InsTextCmd
133 
134 
135 //BEGIN DelTextCmd
136 DelTextCmd::DelTextCmd(Catalog *catalog,const DocPosition &pos,const QString &str)
137  : LokalizeTargetCmd(catalog,pos,i18nc("@item Undo action item","Deletion"))
138  , _str(str)
139 {}
140 
141 bool DelTextCmd::mergeWith(const QUndoCommand *other)
142 {
143  const DocPosition otherPos=static_cast<const LokalizeUnitCmd*>(other)->pos();
144  if (
145  (other->id() != id())
146  || (otherPos.entry!=_pos.entry)
147  || (otherPos.form!=_pos.form)
148  )
149  return false;
150 
151  //Delete
152  if (otherPos.offset==_pos.offset)
153  {
154  _str += static_cast<const DelTextCmd*>(other)->_str;
155  return true;
156  }
157 
158  //BackSpace
159  if (otherPos.offset==_pos.offset-static_cast<const DelTextCmd*>(other)->_str.size())
160  {
161  _str.prepend(static_cast<const DelTextCmd*>(other)->_str);
162  _pos.offset=otherPos.offset;
163  return true;
164  }
165 
166  return false;
167 }
168 void DelTextCmd::doRedo()
169 {
170  _catalog->targetDelete(_pos,_str.size());
171 }
172 void DelTextCmd::doUndo()
173 {
174  //DocPosition pos=_pos; //pos.offset+=_str.size();
175  //_catalog.setLastModifiedPos(pos);
176  _catalog->targetInsert(_pos,_str);
177 }
178 //END DelTextCmd
179 
180 
181 //BEGIN SetStateCmd
182 void SetStateCmd::push(Catalog *catalog, const DocPosition& pos, bool approved)
183 {
184  catalog->push(new SetStateCmd(catalog,pos,closestState(approved,catalog->activePhaseRole())));
185 }
186 void SetStateCmd::instantiateAndPush(Catalog *catalog, const DocPosition& pos, TargetState state)
187 {
188  catalog->push(new SetStateCmd(catalog,pos,state));
189 }
190 
191 SetStateCmd::SetStateCmd(Catalog *catalog, const DocPosition& pos, TargetState state)
192  : LokalizeUnitCmd(catalog,pos,i18nc("@item Undo action item","Approvement toggling"))
193  , _state(state)
194 {}
195 
196 void SetStateCmd::doRedo()
197 {
198  _prevState=_catalog->setState(_pos,_state);
199 }
200 
201 void SetStateCmd::doUndo()
202 {
203  _catalog->setState(_pos,_prevState);
204 }
205 //END SetStateCmd
206 
207 
208 //BEGIN InsTagCmd
209 InsTagCmd::InsTagCmd(Catalog *catalog, const DocPosition& pos, const InlineTag& tag)
210  : LokalizeTargetCmd(catalog,pos,i18nc("@item Undo action item","Markup Insertion"))
211  , _tag(tag)
212 {
213  _pos.offset=tag.start;
214 }
215 
216 void InsTagCmd::doRedo()
217 {
218  Catalog& catalog=*_catalog;
219  DocPosition pos=_pos; pos.offset++; //between paired tags or after single tag
220  catalog.setLastModifiedPos(pos);
221  catalog.targetInsertTag(_pos,_tag);
222 }
223 
224 void InsTagCmd::doUndo()
225 {
226  _catalog->targetDeleteTag(_pos);
227 }
228 //END InsTagCmd
229 
230 //BEGIN DelTagCmd
231 DelTagCmd::DelTagCmd(Catalog *catalog, const DocPosition& pos)
232  : LokalizeTargetCmd(catalog,pos,i18nc("@item Undo action item","Markup Deletion"))
233 {}
234 
235 void DelTagCmd::doRedo()
236 {
237  _tag=_catalog->targetDeleteTag(_pos);
238  kWarning()<<"tag properties:"<<_tag.start<<_tag.end;
239 }
240 
241 void DelTagCmd::doUndo()
242 {
243  Catalog& catalog=*_catalog;
244  DocPosition pos=_pos; pos.offset++; //between paired tags or after single tag
245  catalog.setLastModifiedPos(pos);
246  catalog.targetInsertTag(_pos,_tag);
247 }
248 //END DelTagCmd
249 
250 
251 //BEGIN SetNoteCmd
252 SetNoteCmd::SetNoteCmd(Catalog *catalog, const DocPosition& pos, const Note& note)
253  : LokalizeUnitCmd(catalog,pos,i18nc("@item Undo action item","Note setting"))
254  , _note(note)
255 {
256  _pos.part=DocPosition::Comment;
257 }
258 
259 static void setNote(Catalog& catalog, DocPosition& _pos, const Note& note, Note& resultNote)
260 {
261  resultNote=catalog.setNote(_pos,note);
262  int size=catalog.notes(_pos).size();
263  if (_pos.form==-1) _pos.form = size-1;
264  else if (_pos.form>=size) _pos.form = -1;
265 }
266 
267 void SetNoteCmd::doRedo()
268 {
269  setNote(*_catalog,_pos,_note,_prevNote);
270 }
271 
272 void SetNoteCmd::doUndo()
273 {
274  Note tmp; setNote(*_catalog,_pos,_prevNote,tmp);
275 }
276 
277 void SetNoteCmd::setJumpingPos()
278 {
279  DocPosition pos=_pos;
280  pos.form=0;
281  _catalog->setLastModifiedPos(pos);
282 }
283 //END SetNoteCmd
284 
285 //BEGIN UpdatePhaseCmd
286 UpdatePhaseCmd::UpdatePhaseCmd(Catalog *catalog, const Phase& phase)
287  : QUndoCommand(i18nc("@item Undo action item","Update/add workflow phase"))
288  , _catalog(catalog)
289  , _phase(phase)
290 {}
291 
292 void UpdatePhaseCmd::redo()
293 {
294  _prevPhase=_catalog->updatePhase(_phase);
295 }
296 
297 void UpdatePhaseCmd::undo()
298 {
299  _catalog->updatePhase(_prevPhase);
300 }
301 //END UpdatePhaseCmd
302 
303 
304 
305 
306 //BEGIN SetEquivTransCmd
307 SetEquivTransCmd::SetEquivTransCmd(Catalog *catalog, const DocPosition& pos, bool equivTrans)
308  : LokalizeTargetCmd(catalog,pos,i18nc("@item Undo action item","Translation Equivalence Setting"))
309  , _equivTrans(equivTrans)
310 {}
311 
312 void SetEquivTransCmd::doRedo()
313 {
314  _catalog->setEquivTrans(_pos,_equivTrans);
315 }
316 
317 void SetEquivTransCmd::doUndo()
318 {
319  _catalog->setEquivTrans(_pos,!_equivTrans);
320 }
321 //END SetEquivTransCmd
322 
323 
324 
325 
326 
327 
328 bool fillTagPlaces(QMap<int,int>& tagPlaces,
329  const CatalogString& catalogString,
330  int start,
331  int len
332  )
333 {
334  QString target=catalogString.string;
335  if (len==-1)
336  len=target.size();
337 
338  int t=start;
339  while ((t=target.indexOf(TAGRANGE_IMAGE_SYMBOL,t))!=-1 && t<(start+len))
340  tagPlaces[t++]=0;
341 
342 
343  int i=catalogString.tags.size();
344  while(--i>=0)
345  {
346  //qWarning()<<catalogString.ranges.at(i).getElementName();
347  const InlineTag& tag=catalogString.tags.at(i);
348  if (tagPlaces.contains(tag.start)
349  &&tagPlaces.contains(tag.end))
350  {
351  //qWarning()<<"start"<<catalogString.ranges.at(i).start<<"end"<<catalogString.ranges.at(i).end;
352  tagPlaces[tag.end]=2;
353  tagPlaces[tag.start]=1;
354  }
355  }
356 
357  QMap<int,int>::const_iterator it = tagPlaces.constBegin();
358  while (it != tagPlaces.constEnd() && it.value())
359  ++it;
360 
361  return it==tagPlaces.constEnd();
362 }
363 
364 bool removeTargetSubstring(Catalog* catalog, DocPosition pos, int delStart, int delLen)
365 {
366  CatalogString targetWithTags=catalog->targetWithTags(pos);
367  QString target=targetWithTags.string;
368  kWarning()<<"called with"<<delStart<<"delLen"<<delLen<<"target:"<<target;
369  if (delLen==-1)
370  delLen=target.length()-delStart;
371 
372  bool doTags=catalog->capabilities()&Tags;
373  QMap<int,int> tagPlaces;
374  if (target.isEmpty() || doTags && !fillTagPlaces(tagPlaces,targetWithTags,delStart,delLen))
375  {
376  kWarning()<<"error removing text"<<target;
377  return false;
378  }
379 
380  catalog->beginMacro(i18nc("@item Undo action item","Remove text with markup"));
381 
382  //all indexes are ok (or target is just plain text)
383  //modified=true;
384  //kWarning()<<"all indexes are ok";
385  QMapIterator<int,int> it(tagPlaces);
386  it.toBack();
387  while (it.hasPrevious())
388  {
389  it.previous();
390  if (it.value()!=1) continue;
391  pos.offset=it.key();
392  DelTagCmd* cmd=new DelTagCmd(catalog,pos);
393  catalog->push(cmd);
394  delLen-=1+cmd->tag().isPaired();
395  QString tmp=catalog->targetWithTags(pos).string;
396  tmp.replace(TAGRANGE_IMAGE_SYMBOL, "*");
397  kWarning()<<"\tdeleting at"<<it.key()<<"current string:"<<tmp<<"delLen"<<delLen;
398  }
399  //charsRemoved-=lenDecrement;
400  QString tmp=catalog->targetWithTags(pos).string;
401  tmp.replace(TAGRANGE_IMAGE_SYMBOL, "*");
402  kWarning()<<"offset"<<delStart<<delLen<<"current string:"<<tmp;
403  pos.offset=delStart;
404  if (delLen)
405  {
406  QString rText=catalog->targetWithTags(pos).string.mid(delStart,delLen);
407  rText.remove(TAGRANGE_IMAGE_SYMBOL);
408  kWarning()<<"rText"<<rText<<"delStart"<<delStart<<rText.size();
409  if (!rText.isEmpty())
410  catalog->push(new DelTextCmd(catalog,pos,rText));
411  }
412  tmp=catalog->targetWithTags(pos).string;
413  tmp.replace(TAGRANGE_IMAGE_SYMBOL, "*");
414  kWarning()<<"current string:"<<tmp;
415 
416  catalog->endMacro();
417  return true;
418 }
419 
420 
421 void insertCatalogString(Catalog* catalog, DocPosition pos, const CatalogString& catStr, int start)
422 {
423  QMap<int,int> posToTag;
424  int i=catStr.tags.size();
425  bool containsMarkup=i;
426  while(--i>=0)
427  {
428  //kWarning()<<"\t"<<catStr.tags.at(i).getElementName()<<catStr.tags.at(i).id<<catStr.tags.at(i).start<<catStr.tags.at(i).end;
429  kWarning()<<"\ttag"<<catStr.tags.at(i).start<<catStr.tags.at(i).end;
430  posToTag.insert(catStr.tags.at(i).start,i);
431  posToTag.insert(catStr.tags.at(i).end,i);
432  }
433 
434  if (containsMarkup) catalog->beginMacro(i18nc("@item Undo action item","Insert text with markup"));
435 
436  i=0;
437  int prev=0;
438  while ((i = catStr.string.indexOf(TAGRANGE_IMAGE_SYMBOL, i)) != -1)
439  {
440  kWarning()<<"TAGRANGE_IMAGE_SYMBOL"<<i;
441  //text that was before tag we found
442  if (i-prev)
443  {
444  pos.offset=start+prev;
445  catalog->push(new InsTextCmd(catalog,pos,catStr.string.mid(prev,i-prev)));
446  }
447 
448  //now dealing with tag
449  kWarning()<<"posToTag.value(i)"<<posToTag.value(i)<<catStr.tags.size();
450  if (posToTag.value(i)<catStr.tags.size())
451  {
452  InlineTag tag=catStr.tags.at(posToTag.value(i));
453  kWarning()<<i<<"testing for tag"<<tag.name()<<tag.start<<tag.start;
454  if (tag.start==i) //this is an opening tag (may be single tag)
455  {
456  pos.offset=start+i;
457  tag.start+=start;
458  tag.end+=start;
459  catalog->push(new InsTagCmd(catalog,pos,tag));
460  }
461  }
462  else
463  {
464  //HACK to keep positions in sync
465  pos.offset=start+i;
466  catalog->push(new InsTextCmd(catalog,pos," "));
467  }
468  prev=++i;
469  }
470  pos.offset=start+prev;
471  if (catStr.string.length()-prev>0)
472  catalog->push(new InsTextCmd(catalog,pos,catStr.string.mid(prev)));
473  if (containsMarkup) catalog->endMacro();
474 }
475 
476 
DelTagCmd
TagRange is filled from document.
Definition: cmd.h:149
LokalizeUnitCmd::redo
virtual void redo()
Definition: cmd.cpp:51
DocPosition::part
Part part
Definition: pos.h:49
project.h
Catalog::targetWithTags
CatalogString targetWithTags(const DocPosition &pos) const
Definition: catalog.cpp:211
LokalizeUnitCmd::_firstModificationForThisEntry
bool _firstModificationForThisEntry
Definition: cmd.h:64
InsTextCmd::doUndo
void doUndo()
Definition: cmd.cpp:128
SetEquivTransCmd::SetEquivTransCmd
SetEquivTransCmd(Catalog *catalog, const DocPosition &pos, bool equivTrans)
Definition: cmd.cpp:307
SetNoteCmd::doRedo
void doRedo()
Definition: cmd.cpp:267
InlineTag::isPaired
static bool isPaired(InlineElement type)
Definition: catalogstring.h:105
InsTextCmd
how undo system works: undo() and redo() functions call appropriate private method of Catalog to chan...
Definition: cmd.h:85
Catalog::setEquivTrans
void setEquivTrans(const DocPosition &, bool equivTrans)
Definition: catalog.cpp:907
LokalizeUnitCmd::_pos
DocPosition _pos
Definition: cmd.h:63
SetStateCmd::push
static void push(Catalog *catalog, const DocPosition &pos, bool approved)
Definition: cmd.cpp:182
DocPosition::Target
Definition: pos.h:44
TAGRANGE_IMAGE_SYMBOL
#define TAGRANGE_IMAGE_SYMBOL
Definition: catalogstring.h:33
DocPosition::Part
Part
Definition: pos.h:40
Catalog::setState
TargetState setState(const DocPosition &pos, TargetState state)
Definition: catalog.cpp:869
LokalizeTargetCmd::LokalizeTargetCmd
LokalizeTargetCmd(Catalog *catalog, const DocPosition &pos, const QString &name)
Definition: cmd.cpp:75
LokalizeUnitCmd::LokalizeUnitCmd
LokalizeUnitCmd(Catalog *catalog, const DocPosition &pos, const QString &name)
Definition: cmd.cpp:38
catalogitem_private.h
DelTagCmd::DelTagCmd
DelTagCmd(Catalog *catalog, const DocPosition &pos)
Definition: cmd.cpp:231
DelTagCmd::tag
InlineTag tag() const
Definition: cmd.h:157
Catalog::activePhaseRole
ProjectLocal::PersonRole activePhaseRole() const
Definition: catalog.h:120
Note
Definition: note.h:29
setNote
static void setNote(Catalog &catalog, DocPosition &_pos, const Note &note, Note &resultNote)
Definition: cmd.cpp:259
LokalizeUnitCmd::doUndo
virtual void doUndo()=0
Catalog::push
void push(QUndoCommand *cmd)
Definition: catalog.cpp:155
CatalogString::string
QString string
Definition: catalogstring.h:130
cmd.h
DelTextCmd::mergeWith
bool mergeWith(const QUndoCommand *other)
Definition: cmd.cpp:141
InsTagCmd::InsTagCmd
InsTagCmd(Catalog *catalog, const DocPosition &pos, const InlineTag &tag)
offset is taken from tag and not from pos
Definition: cmd.cpp:209
fillTagPlaces
bool fillTagPlaces(QMap< int, int > &tagPlaces, const CatalogString &catalogString, int start, int len)
CatalogString cmds helper function.
Definition: cmd.cpp:328
LokalizeUnitCmd::doRedo
virtual void doRedo()=0
Catalog::activePhase
QString activePhase() const
Definition: catalog.h:119
SetNoteCmd::doUndo
void doUndo()
Definition: cmd.cpp:272
DelTextCmd
Definition: cmd.h:99
DocPosition::offset
uint offset
Definition: pos.h:51
DocPosition::entry
int entry
Definition: pos.h:48
Catalog::setModified
bool setModified(DocPos entry, bool modif)
Definition: catalog.cpp:912
DocPosition
This struct represents a position in a catalog.
Definition: pos.h:38
LokalizeUnitCmd::pos
DocPosition pos() const
Definition: cmd.h:52
Catalog::targetDeleteTag
InlineTag targetDeleteTag(const DocPosition &pos)
Definition: catalog.cpp:849
SetStateCmd::doUndo
void doUndo()
Definition: cmd.cpp:201
SetStateCmd::_prevState
TargetState _prevState
Definition: cmd.h:127
SetStateCmd
Definition: cmd.h:112
InsTextCmd::id
int id() const
Definition: cmd.h:90
removeTargetSubstring
bool removeTargetSubstring(Catalog *catalog, DocPosition pos, int delStart, int delLen)
Definition: cmd.cpp:364
SetEquivTransCmd::doUndo
void doUndo()
Definition: cmd.cpp:317
SetStateCmd::instantiateAndPush
static void instantiateAndPush(Catalog *catalog, const DocPosition &pos, TargetState state)
Definition: cmd.cpp:186
catalog_private.h
Catalog::targetInsertTag
void targetInsertTag(const DocPosition &pos, const InlineTag &tag)
Definition: catalog.cpp:837
catalog.h
Tags
Definition: catalogcapabilities.h:33
InlineTag::start
int start
Definition: catalogstring.h:68
DocPosition::form
char form
Definition: pos.h:50
SetStateCmd::doRedo
void doRedo()
Definition: cmd.cpp:196
DelTagCmd::doRedo
void doRedo()
Definition: cmd.cpp:235
Phase
Definition: phase.h:34
LokalizeUnitCmd::setJumpingPos
virtual void setJumpingPos()
may be overridden to set customized pos alternatively customized pos may be set manually in do*() ...
Definition: cmd.cpp:68
InsTagCmd
Do insert tag.
Definition: cmd.h:131
DelTextCmd::doRedo
void doRedo()
Definition: cmd.cpp:168
InlineTag::name
const char * name() const
Definition: catalogstring.h:104
LokalizeUnitCmd::undo
virtual void undo()
Definition: cmd.cpp:59
Catalog::capabilities
int capabilities() const
Definition: catalog.cpp:164
UpdatePhaseCmd::undo
void undo()
Definition: cmd.cpp:297
DelTextCmd::id
int id() const
Definition: cmd.h:104
SetEquivTransCmd::doRedo
void doRedo()
Definition: cmd.cpp:312
Catalog::targetInsert
void targetInsert(const DocPosition &pos, const QString &arg)
Definition: catalog.cpp:825
DelTagCmd::doUndo
void doUndo()
Definition: cmd.cpp:241
Catalog::setNote
Note setNote(const DocPosition &pos, const Note &note)
pos.form is note number
Definition: catalog.cpp:244
InsTextCmd::InsTextCmd
InsTextCmd(Catalog *catalog, const DocPosition &pos, const QString &str)
Definition: cmd.cpp:93
CatalogString
data structure used to pass info about inline elements a XLIFF tag is represented by a TAGRANGE_IMAGE...
Definition: catalogstring.h:128
SetNoteCmd::SetNoteCmd
SetNoteCmd(Catalog *catalog, const DocPosition &pos, const Note &note)
pos.form is note number
Definition: cmd.cpp:252
insertCatalogString
void insertCatalogString(Catalog *catalog, DocPosition pos, const CatalogString &catStr, int start)
Definition: cmd.cpp:421
Catalog::updatePhase
Phase updatePhase(const Phase &phase)
Definition: catalog.cpp:902
SetNoteCmd::setJumpingPos
void setJumpingPos()
may be overridden to set customized pos alternatively customized pos may be set manually in do*() ...
Definition: cmd.cpp:277
CatalogString::tags
QList< InlineTag > tags
Definition: catalogstring.h:131
InsTextCmd::doRedo
void doRedo()
Definition: cmd.cpp:120
Catalog::targetDelete
void targetDelete(const DocPosition &pos, int count)
Definition: catalog.cpp:802
InsTextCmd::mergeWith
bool mergeWith(const QUndoCommand *other)
Definition: cmd.cpp:98
DocPos
simpler version of DocPosition for use in QMap
Definition: pos.h:82
InsTagCmd::doUndo
void doUndo()
Definition: cmd.cpp:224
Catalog
This class represents a catalog It uses CatalogStorage interface to work with catalogs in different f...
Definition: catalog.h:74
InsTagCmd::doRedo
void doRedo()
Definition: cmd.cpp:216
DelTextCmd::doUndo
void doUndo()
Definition: cmd.cpp:172
UpdatePhaseCmd::UpdatePhaseCmd
UpdatePhaseCmd(Catalog *catalog, const Phase &phase)
pos.form is note number
Definition: cmd.cpp:286
setPhaseForPart
static QString setPhaseForPart(Catalog *catalog, const QString &phase, DocPosition phasePos, DocPosition::Part part)
Definition: cmd.cpp:45
Catalog::notes
QVector< Note > notes(const DocPosition &pos) const
Definition: catalog.cpp:228
DelTextCmd::DelTextCmd
DelTextCmd(Catalog *catalog, const DocPosition &pos, const QString &str)
Definition: cmd.cpp:136
UpdatePhaseCmd::redo
void redo()
Definition: cmd.cpp:292
LokalizeUnitCmd::_catalog
Catalog * _catalog
Definition: cmd.h:62
InlineTag::end
int end
Definition: catalogstring.h:69
TargetState
TargetState
Definition: state.h:30
DocPosition::UndefPart
Definition: pos.h:42
LokalizeUnitCmd
Definition: cmd.h:45
QUndoCommand
SetStateCmd::_state
TargetState _state
Definition: cmd.h:126
Catalog::setLastModifiedPos
void setLastModifiedPos(const DocPosition &)
(EDITING) accessed from undo/redo code called BEFORE modification
Definition: catalog.cpp:780
LokalizeTargetCmd::_prevTargetPhase
QString _prevTargetPhase
Definition: cmd.h:76
LokalizeTargetCmd
Definition: cmd.h:68
Catalog::setPhase
QString setPhase(const DocPosition &pos, const QString &phase)
Definition: catalog.cpp:330
InlineTag
data structure used to pass info about inline elements a XLIFF tag is represented by a TAGRANGE_IMAGE...
Definition: catalogstring.h:44
LokalizeUnitCmd::_prevPhase
QString _prevPhase
Definition: cmd.h:65
LokalizeTargetCmd::redo
void redo()
Definition: cmd.cpp:79
DocPosition::Comment
Definition: pos.h:45
closestState
TargetState closestState(bool approved, ProjectLocal::PersonRole role)
Definition: catalog.cpp:1002
LokalizeTargetCmd::undo
void undo()
Definition: cmd.cpp:85
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:03:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

lokalize

Skip menu "lokalize"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal