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

okular

  • sources
  • kde-4.12
  • kdegraphics
  • okular
  • core
documentcommands.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2013 Jon Mease <jon.mease@gmail.com> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  ***************************************************************************/
9 
10 #include "documentcommands_p.h"
11 
12 #include "annotations.h"
13 #include "debug_p.h"
14 #include "document_p.h"
15 #include "form.h"
16 
17 #include <KLocalizedString>
18 
19 namespace Okular {
20 
21 AddAnnotationCommand::AddAnnotationCommand( Okular::DocumentPrivate * docPriv, Okular::Annotation* annotation, int pageNumber )
22  : m_docPriv( docPriv ),
23  m_annotation( annotation ),
24  m_pageNumber( pageNumber ),
25  m_done( false )
26 {
27  setText( i18nc ("Add an annotation to the page", "add annotation" ) );
28 }
29 
30 AddAnnotationCommand::~AddAnnotationCommand()
31 {
32  if ( !m_done )
33  {
34  delete m_annotation;
35  }
36 }
37 
38 void AddAnnotationCommand::undo()
39 {
40  m_docPriv->performRemovePageAnnotation( m_pageNumber, m_annotation );
41  m_done = false;
42 }
43 
44 void AddAnnotationCommand::redo()
45 {
46  m_docPriv->performAddPageAnnotation( m_pageNumber, m_annotation );
47  m_done = true;
48 }
49 
50 
51 RemoveAnnotationCommand::RemoveAnnotationCommand(Okular::DocumentPrivate * doc, Okular::Annotation* annotation, int pageNumber)
52  : m_doc( doc ),
53  m_annotation( annotation ),
54  m_pageNumber( pageNumber ),
55  m_done( false )
56 {
57  setText( i18nc( "Remove an annotation from the page", "remove annotation" ) );
58 }
59 
60 RemoveAnnotationCommand::~RemoveAnnotationCommand()
61 {
62  if ( m_done )
63  {
64  delete m_annotation;
65  }
66 }
67 
68 void RemoveAnnotationCommand::undo()
69 {
70  m_doc->performAddPageAnnotation( m_pageNumber, m_annotation );
71  m_done = false;
72 }
73 
74 void RemoveAnnotationCommand::redo(){
75  m_doc->performRemovePageAnnotation( m_pageNumber, m_annotation );
76  m_done = true;
77 }
78 
79 
80 ModifyAnnotationPropertiesCommand::ModifyAnnotationPropertiesCommand( DocumentPrivate* docPriv,
81  Annotation* annotation,
82  int pageNumber,
83  QDomNode oldProperties,
84  QDomNode newProperties )
85  : m_docPriv( docPriv ),
86  m_annotation( annotation ),
87  m_pageNumber( pageNumber ),
88  m_prevProperties( oldProperties ),
89  m_newProperties( newProperties )
90 {
91  setText(i18nc("Modify an annotation's internal properties (Color, line-width, etc.)", "modify annotation properties"));
92 }
93 
94 void ModifyAnnotationPropertiesCommand::undo()
95 {
96  m_annotation->setAnnotationProperties( m_prevProperties );
97  m_docPriv->performModifyPageAnnotation( m_pageNumber, m_annotation, true );
98 }
99 
100 void ModifyAnnotationPropertiesCommand::redo()
101 {
102  m_annotation->setAnnotationProperties( m_newProperties );
103  m_docPriv->performModifyPageAnnotation( m_pageNumber, m_annotation, true );
104 }
105 
106 TranslateAnnotationCommand::TranslateAnnotationCommand( DocumentPrivate* docPriv,
107  Annotation* annotation,
108  int pageNumber,
109  const Okular::NormalizedPoint & delta,
110  bool completeDrag )
111  : m_docPriv( docPriv ),
112  m_annotation( annotation ),
113  m_pageNumber( pageNumber ),
114  m_delta( delta ),
115  m_completeDrag( completeDrag )
116 {
117  setText( i18nc( "Translate an annotation's position on the page", "translate annotation" ) );
118 }
119 
120 void TranslateAnnotationCommand::undo()
121 {
122  m_annotation->translate( minusDelta() );
123  m_docPriv->performModifyPageAnnotation( m_pageNumber, m_annotation, true );
124 }
125 
126 void TranslateAnnotationCommand::redo()
127 {
128  m_annotation->translate( m_delta );
129  m_docPriv->performModifyPageAnnotation( m_pageNumber, m_annotation, true );
130 }
131 
132 int TranslateAnnotationCommand::id() const
133 {
134  return 1;
135 }
136 
137 bool TranslateAnnotationCommand::mergeWith( const QUndoCommand* uc )
138 {
139  TranslateAnnotationCommand *tuc = (TranslateAnnotationCommand*)uc;
140 
141  if ( tuc->m_annotation != m_annotation )
142  return false;
143 
144  if ( m_completeDrag )
145  {
146  return false;
147  }
148  m_delta = Okular::NormalizedPoint( tuc->m_delta.x + m_delta.x, tuc->m_delta.y + m_delta.y );
149  m_completeDrag = tuc->m_completeDrag;
150  return true;
151 }
152 
153 Okular::NormalizedPoint TranslateAnnotationCommand::minusDelta()
154 {
155  return Okular::NormalizedPoint( -m_delta.x, -m_delta.y );
156 }
157 
158 
159 EditTextCommand::EditTextCommand( const QString & newContents,
160  int newCursorPos,
161  const QString & prevContents,
162  int prevCursorPos,
163  int prevAnchorPos )
164  : m_newContents( newContents ),
165  m_newCursorPos( newCursorPos ),
166  m_prevContents( prevContents ),
167  m_prevCursorPos( prevCursorPos ),
168  m_prevAnchorPos( prevAnchorPos )
169 {
170  setText( i18nc( "Generic text edit command", "edit text" ) );
171 
173  // If There was a selection then edit was not a simple single character backspace, delete, or insert
174  if (m_prevCursorPos != m_prevAnchorPos)
175  {
176  kDebug(OkularDebug) << "OtherEdit, selection";
177  m_editType = OtherEdit;
178  }
179  else if ( newContentsRightOfCursor() == oldContentsRightOfCursor() &&
180  newContentsLeftOfCursor() == oldContentsLeftOfCursor().left(oldContentsLeftOfCursor().length() - 1) &&
181  oldContentsLeftOfCursor().right(1) != "\n" )
182  {
183  kDebug(OkularDebug) << "CharBackspace";
184  m_editType = CharBackspace;
185  }
186  else if ( newContentsLeftOfCursor() == oldContentsLeftOfCursor() &&
187  newContentsRightOfCursor() == oldContentsRightOfCursor().right(oldContentsRightOfCursor().length() - 1) &&
188  oldContentsRightOfCursor().left(1) != "\n" )
189  {
190  kDebug(OkularDebug) << "CharDelete";
191  m_editType = CharDelete;
192  }
193  else if ( newContentsRightOfCursor() == oldContentsRightOfCursor() &&
194  newContentsLeftOfCursor().left( newContentsLeftOfCursor().length() - 1) == oldContentsLeftOfCursor() &&
195  newContentsLeftOfCursor().right(1) != "\n" )
196  {
197  kDebug(OkularDebug) << "CharInsert";
198  m_editType = CharInsert;
199  }
200  else
201  {
202  kDebug(OkularDebug) << "OtherEdit";
203  m_editType = OtherEdit;
204  }
205 }
206 
207 bool EditTextCommand::mergeWith(const QUndoCommand* uc)
208 {
209  EditTextCommand *euc = (EditTextCommand*)uc;
210 
211  // Only attempt merge of euc into this if our new state matches euc's old state and
212  // the editTypes match and are not type OtherEdit
213  if ( m_newContents == euc->m_prevContents
214  && m_newCursorPos == euc->m_prevCursorPos
215  && m_editType == euc->m_editType
216  && m_editType != OtherEdit )
217  {
218  m_newContents = euc->m_newContents;
219  m_newCursorPos = euc->m_newCursorPos;
220  return true;
221  }
222  return false;
223 }
224 
225 QString EditTextCommand::oldContentsLeftOfCursor()
226 {
227  return m_prevContents.left(m_prevCursorPos);
228 }
229 
230 QString EditTextCommand::oldContentsRightOfCursor()
231 {
232  return m_prevContents.right(m_prevContents.length() - m_prevCursorPos);
233 }
234 
235 QString EditTextCommand::newContentsLeftOfCursor()
236 {
237  return m_newContents.left(m_newCursorPos);
238 }
239 
240 QString EditTextCommand::newContentsRightOfCursor()
241 {
242  return m_newContents.right(m_newContents.length() - m_newCursorPos);
243 }
244 
245 EditAnnotationContentsCommand::EditAnnotationContentsCommand( DocumentPrivate* docPriv,
246  Annotation* annotation,
247  int pageNumber,
248  const QString & newContents,
249  int newCursorPos,
250  const QString & prevContents,
251  int prevCursorPos,
252  int prevAnchorPos )
253 : EditTextCommand( newContents, newCursorPos, prevContents, prevCursorPos, prevAnchorPos ),
254  m_docPriv( docPriv ),
255  m_annotation( annotation ),
256  m_pageNumber( pageNumber )
257 {
258  setText( i18nc( "Edit an annotation's text contents", "edit annotation contents" ) );
259 }
260 
261 void EditAnnotationContentsCommand::undo()
262 {
263  m_docPriv->performSetAnnotationContents( m_prevContents, m_annotation, m_pageNumber );
264  emit m_docPriv->m_parent->annotationContentsChangedByUndoRedo( m_annotation, m_prevContents, m_prevCursorPos, m_prevAnchorPos );
265 }
266 
267 void EditAnnotationContentsCommand::redo()
268 {
269  m_docPriv->performSetAnnotationContents( m_newContents, m_annotation, m_pageNumber );
270  emit m_docPriv->m_parent->annotationContentsChangedByUndoRedo( m_annotation, m_newContents, m_newCursorPos, m_newCursorPos );
271 }
272 
273 int EditAnnotationContentsCommand::id() const
274 {
275  return 2;
276 }
277 
278 bool EditAnnotationContentsCommand::mergeWith(const QUndoCommand* uc)
279 {
280  EditAnnotationContentsCommand *euc = (EditAnnotationContentsCommand*)uc;
281  // Only attempt merge of euc into this if they modify the same annotation
282  if ( m_annotation == euc->m_annotation )
283  {
284  return EditTextCommand::mergeWith( uc );
285  }
286  else
287  {
288  return false;
289  }
290 }
291 
292 EditFormTextCommand::EditFormTextCommand( Okular::Document* doc,
293  Okular::FormFieldText* form,
294  int pageNumber,
295  const QString & newContents,
296  int newCursorPos,
297  const QString & prevContents,
298  int prevCursorPos,
299  int prevAnchorPos )
300 : EditTextCommand( newContents, newCursorPos, prevContents, prevCursorPos, prevAnchorPos ),
301  m_doc ( doc ),
302  m_form( form ),
303  m_pageNumber( pageNumber )
304 {
305  setText( i18nc( "Edit an form's text contents", "edit form contents" ) );
306 }
307 
308 void EditFormTextCommand::undo()
309 {
310  m_form->setText( m_prevContents );
311  m_doc->formTextChangedByUndoRedo( m_pageNumber, m_form, m_prevContents, m_prevCursorPos, m_prevAnchorPos );
312 }
313 
314 void EditFormTextCommand::redo()
315 {
316  m_form->setText( m_newContents );
317  m_doc->formTextChangedByUndoRedo( m_pageNumber, m_form, m_newContents, m_newCursorPos, m_newCursorPos );
318 }
319 
320 int EditFormTextCommand::id() const
321 {
322  return 3;
323 }
324 
325 bool EditFormTextCommand::mergeWith(const QUndoCommand* uc)
326 {
327  EditFormTextCommand *euc = (EditFormTextCommand*)uc;
328  // Only attempt merge of euc into this if they modify the same form
329  if ( m_form == euc->m_form )
330  {
331  return EditTextCommand::mergeWith( uc );
332  }
333  else
334  {
335  return false;
336  }
337 }
338 
339 EditFormListCommand::EditFormListCommand( Okular::Document* doc,
340  FormFieldChoice* form,
341  int pageNumber,
342  const QList< int > & newChoices,
343  const QList< int > & prevChoices )
344 : m_doc( doc ),
345  m_form( form ),
346  m_pageNumber( pageNumber ),
347  m_newChoices( newChoices ),
348  m_prevChoices( prevChoices )
349 {
350  setText( i18nc( "Edit a list form's choices", "edit list form choices" ) );
351 }
352 
353 void EditFormListCommand::undo()
354 {
355  m_form->setCurrentChoices( m_prevChoices );
356  m_doc->formListChangedByUndoRedo( m_pageNumber, m_form, m_prevChoices );
357 }
358 
359 void EditFormListCommand::redo()
360 {
361  m_form->setCurrentChoices( m_newChoices );
362  m_doc->formListChangedByUndoRedo( m_pageNumber, m_form, m_newChoices );
363 }
364 
365 EditFormComboCommand::EditFormComboCommand( Okular::Document* doc,
366  FormFieldChoice* form,
367  int pageNumber,
368  const QString & newContents,
369  int newCursorPos,
370  const QString & prevContents,
371  int prevCursorPos,
372  int prevAnchorPos )
373 : EditTextCommand( newContents, newCursorPos, prevContents, prevCursorPos, prevAnchorPos ),
374  m_doc( doc ),
375  m_form( form ),
376  m_pageNumber( pageNumber ),
377  m_newIndex( -1 ),
378  m_prevIndex( -1 )
379 {
380  setText( i18nc( "Edit a combo form's selection", "edit combo form selection" ) );
381 
382  // Determine new and previous choice indices (if any)
383  for ( int i = 0; i < m_form->choices().size(); i++ )
384  {
385  if ( m_form->choices()[i] == m_prevContents )
386  {
387  m_prevIndex = i;
388  }
389 
390  if ( m_form->choices()[i] == m_newContents )
391  {
392  m_newIndex = i;
393  }
394  }
395 }
396 
397 void EditFormComboCommand::undo()
398 {
399  if ( m_prevIndex != -1 )
400  {
401  m_form->setCurrentChoices( QList<int>() << m_prevIndex );
402  }
403  else
404  {
405  m_form->setEditChoice( m_prevContents );
406  }
407  m_doc->formComboChangedByUndoRedo( m_pageNumber, m_form, m_prevContents, m_prevCursorPos, m_prevAnchorPos );
408 }
409 
410 void EditFormComboCommand::redo()
411 {
412  if ( m_newIndex != -1 )
413  {
414  m_form->setCurrentChoices( QList<int>() << m_newIndex );
415  }
416  else
417  {
418  m_form->setEditChoice( m_newContents );
419  }
420  m_doc->formComboChangedByUndoRedo( m_pageNumber, m_form, m_newContents, m_newCursorPos, m_newCursorPos );
421 }
422 
423 int EditFormComboCommand::id() const
424 {
425  return 4;
426 }
427 
428 bool EditFormComboCommand::mergeWith( const QUndoCommand *uc )
429 {
430  EditFormComboCommand *euc = (EditFormComboCommand*)uc;
431  // Only attempt merge of euc into this if they modify the same form
432  if ( m_form == euc->m_form )
433  {
434  bool shouldMerge = EditTextCommand::mergeWith( uc );
435  if( shouldMerge )
436  {
437  m_newIndex = euc->m_newIndex;
438  }
439  return shouldMerge;
440  }
441  else
442  {
443  return false;
444  }
445 }
446 
447 EditFormButtonsCommand::EditFormButtonsCommand( Okular::Document* doc,
448  int pageNumber,
449  const QList< FormFieldButton* > & formButtons,
450  const QList< bool > & newButtonStates )
451 : m_doc( doc ),
452  m_pageNumber( pageNumber ),
453  m_formButtons( formButtons ),
454  m_newButtonStates( newButtonStates ),
455  m_prevButtonStates( QList< bool >() )
456 {
457  setText( i18nc( "Edit the state of a group of form buttons", "edit form button states" ) );
458  foreach( FormFieldButton* formButton, m_formButtons )
459  {
460  m_prevButtonStates.append( formButton->state() );
461  }
462 }
463 
464 void EditFormButtonsCommand::undo()
465 {
466  clearFormButtonStates();
467  for( int i = 0; i < m_formButtons.size(); i++ )
468  {
469  bool checked = m_prevButtonStates.at( i );
470  if ( checked )
471  m_formButtons.at( i )->setState( checked );
472  }
473  m_doc->formButtonsChangedByUndoRedo( m_pageNumber, m_formButtons );
474 }
475 
476 void EditFormButtonsCommand::redo()
477 {
478  clearFormButtonStates();
479  for( int i = 0; i < m_formButtons.size(); i++ )
480  {
481  bool checked = m_newButtonStates.at( i );
482  if ( checked )
483  m_formButtons.at( i )->setState( checked );
484  }
485  m_doc->formButtonsChangedByUndoRedo( m_pageNumber, m_formButtons );
486 }
487 
488 void EditFormButtonsCommand::clearFormButtonStates()
489 {
490  foreach( FormFieldButton* formButton, m_formButtons )
491  {
492  formButton->setState( false );
493  }
494 }
495 
496 }
497 
Okular::FormFieldChoice::setEditChoice
virtual void setEditChoice(const QString &text)
Sets the text entered into an editable combo box choice field.
Definition: form.cpp:247
Okular::NormalizedPoint
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition: area.h:47
Okular::EditAnnotationContentsCommand::mergeWith
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:278
Okular::EditFormTextCommand::id
virtual int id() const
Definition: documentcommands.cpp:320
Okular::DocumentPrivate::performAddPageAnnotation
void performAddPageAnnotation(int page, Annotation *annotation)
Definition: document.cpp:1035
Okular::EditAnnotationContentsCommand::redo
virtual void redo()
Definition: documentcommands.cpp:267
Okular::RemoveAnnotationCommand::redo
virtual void redo()
Definition: documentcommands.cpp:74
Okular::EditFormComboCommand::EditFormComboCommand
EditFormComboCommand(Okular::Document *doc, FormFieldChoice *form, int pageNumber, const QString &newText, int newCursorPos, const QString &prevText, int prevCursorPos, int prevAnchorPos)
Definition: documentcommands.cpp:365
Okular::RemoveAnnotationCommand::RemoveAnnotationCommand
RemoveAnnotationCommand(Okular::DocumentPrivate *doc, Okular::Annotation *annotation, int pageNumber)
Definition: documentcommands.cpp:51
Okular::EditTextCommand::m_prevContents
QString m_prevContents
Definition: documentcommands_p.h:133
Okular::Document::formListChangedByUndoRedo
void formListChangedByUndoRedo(int page, Okular::FormFieldChoice *form, const QList< int > &choices)
This signal is emmitted whenever the selected choices for the given list form on the given page are c...
debug_p.h
Okular::NormalizedPoint::y
double y
The normalized y coordinate.
Definition: area.h:97
Okular::EditTextCommand::m_prevAnchorPos
int m_prevAnchorPos
Definition: documentcommands_p.h:135
Okular::TranslateAnnotationCommand::minusDelta
Okular::NormalizedPoint minusDelta()
Definition: documentcommands.cpp:153
Okular::TranslateAnnotationCommand::TranslateAnnotationCommand
TranslateAnnotationCommand(Okular::DocumentPrivate *docPriv, Okular::Annotation *annotation, int pageNumber, const Okular::NormalizedPoint &delta, bool completeDrag)
Definition: documentcommands.cpp:106
Okular::EditAnnotationContentsCommand::undo
virtual void undo()
Definition: documentcommands.cpp:261
Okular::EditAnnotationContentsCommand
Definition: documentcommands_p.h:140
Okular::AddAnnotationCommand::redo
virtual void redo()
Definition: documentcommands.cpp:44
Okular::EditFormComboCommand::undo
virtual void undo()
Definition: documentcommands.cpp:397
Okular::EditFormComboCommand::id
virtual int id() const
Definition: documentcommands.cpp:423
Okular::EditAnnotationContentsCommand::id
virtual int id() const
Definition: documentcommands.cpp:273
Okular::FormFieldText
Interface of a text form field.
Definition: form.h:176
Okular::Annotation::translate
void translate(const NormalizedPoint &coord)
Move the annotation by the specified coordinates.
Definition: annotations.cpp:622
Okular::ModifyAnnotationPropertiesCommand::redo
virtual void redo()
Definition: documentcommands.cpp:100
Okular::EditFormTextCommand::redo
virtual void redo()
Definition: documentcommands.cpp:314
Okular::TranslateAnnotationCommand::redo
virtual void redo()
Definition: documentcommands.cpp:126
Okular::EditTextCommand::m_editType
EditType m_editType
Definition: documentcommands_p.h:136
Okular::TranslateAnnotationCommand::undo
virtual void undo()
Definition: documentcommands.cpp:120
Okular::TranslateAnnotationCommand
Definition: documentcommands_p.h:79
Okular::DocumentPrivate::performSetAnnotationContents
void performSetAnnotationContents(const QString &newContents, Annotation *annot, int pageNumber)
Definition: document.cpp:1150
Okular::AddAnnotationCommand::~AddAnnotationCommand
virtual ~AddAnnotationCommand()
Definition: documentcommands.cpp:30
Okular::EditFormTextCommand::undo
virtual void undo()
Definition: documentcommands.cpp:308
Okular::EditAnnotationContentsCommand::EditAnnotationContentsCommand
EditAnnotationContentsCommand(Okular::DocumentPrivate *docPriv, Okular::Annotation *annotation, int pageNumber, const QString &newContents, int newCursorPos, const QString &prevContents, int prevCursorPos, int prevAnchorPos)
Definition: documentcommands.cpp:245
Okular::TranslateAnnotationCommand::id
virtual int id() const
Definition: documentcommands.cpp:132
Okular::Document::annotationContentsChangedByUndoRedo
void annotationContentsChangedByUndoRedo(Okular::Annotation *annotation, const QString &contents, int cursorPos, int anchorPos)
This signal is emmitted whenever the contents of the given annotation are changed by an undo or redo ...
annotations.h
Okular::FormFieldChoice
Interface of a choice form field.
Definition: form.h:258
Okular::FormFieldButton::state
virtual bool state() const =0
The state of the button.
documentcommands_p.h
OkularDebug
#define OkularDebug
Definition: debug_p.h:13
Okular::EditFormButtonsCommand::redo
virtual void redo()
Definition: documentcommands.cpp:476
Okular::Document
The Document.
Definition: document.h:84
Okular::ModifyAnnotationPropertiesCommand::ModifyAnnotationPropertiesCommand
ModifyAnnotationPropertiesCommand(Okular::DocumentPrivate *docPriv, Okular::Annotation *annotation, int pageNumber, QDomNode oldProperties, QDomNode newProperties)
Definition: documentcommands.cpp:80
Okular::AddAnnotationCommand::undo
virtual void undo()
Definition: documentcommands.cpp:38
Okular::EditFormComboCommand::redo
virtual void redo()
Definition: documentcommands.cpp:410
form.h
Okular::FormFieldChoice::choices
virtual QStringList choices() const =0
The possible choices of the choice field.
Okular::EditTextCommand::m_newCursorPos
int m_newCursorPos
Definition: documentcommands_p.h:132
Okular::FormFieldChoice::setCurrentChoices
virtual void setCurrentChoices(const QList< int > &choices)
Sets the selected choices to choices .
Definition: form.cpp:238
Okular::EditFormListCommand::EditFormListCommand
EditFormListCommand(Okular::Document *doc, FormFieldChoice *form, int pageNumber, const QList< int > &newChoices, const QList< int > &prevChoices)
Definition: documentcommands.cpp:339
Okular::AddAnnotationCommand::AddAnnotationCommand
AddAnnotationCommand(Okular::DocumentPrivate *docPriv, Okular::Annotation *annotation, int pageNumber)
Definition: documentcommands.cpp:21
Okular::DocumentPrivate
Definition: document_p.h:83
Okular::EditTextCommand::mergeWith
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:207
Okular::DocumentPrivate::performRemovePageAnnotation
void performRemovePageAnnotation(int page, Annotation *annotation)
Definition: document.cpp:1068
Okular::NormalizedPoint::x
double x
The normalized x coordinate.
Definition: area.h:92
document_p.h
Okular::Document::formComboChangedByUndoRedo
void formComboChangedByUndoRedo(int page, Okular::FormFieldChoice *form, const QString &text, int cursorPos, int anchorPos)
This signal is emmitted whenever the active text for the given combo form on the given page is change...
Okular::EditFormComboCommand
Definition: documentcommands_p.h:206
Okular::FormFieldButton::setState
virtual void setState(bool state)
Sets the state of the button to the new state .
Definition: form.cpp:110
Okular::Annotation
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:90
Okular::FormFieldText::setText
virtual void setText(const QString &text)
Sets the new text in the text field.
Definition: form.cpp:148
Okular::EditTextCommand::m_newContents
QString m_newContents
Definition: documentcommands_p.h:131
Okular::DocumentPrivate::performModifyPageAnnotation
void performModifyPageAnnotation(int page, Annotation *annotation, bool appearanceChanged)
Definition: document.cpp:1106
Okular::RemoveAnnotationCommand::~RemoveAnnotationCommand
virtual ~RemoveAnnotationCommand()
Definition: documentcommands.cpp:60
Okular::EditFormTextCommand
Definition: documentcommands_p.h:164
Okular::EditFormComboCommand::mergeWith
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:428
Okular::RemoveAnnotationCommand::undo
virtual void undo()
Definition: documentcommands.cpp:68
Okular::Document::formButtonsChangedByUndoRedo
void formButtonsChangedByUndoRedo(int page, const QList< Okular::FormFieldButton * > &formButtons)
This signal is emmitted whenever the state of the specified group of form buttons (formButtons) on th...
Okular::EditFormTextCommand::mergeWith
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:325
Okular::EditFormButtonsCommand::undo
virtual void undo()
Definition: documentcommands.cpp:464
Okular::TranslateAnnotationCommand::mergeWith
virtual bool mergeWith(const QUndoCommand *uc)
Definition: documentcommands.cpp:137
Okular::Document::formTextChangedByUndoRedo
void formTextChangedByUndoRedo(int page, Okular::FormFieldText *form, const QString &contents, int cursorPos, int anchorPos)
This signal is emmitted whenever the text contents of the given text form on the given page are chang...
Okular::EditFormListCommand::redo
virtual void redo()
Definition: documentcommands.cpp:359
Okular::EditTextCommand::m_prevCursorPos
int m_prevCursorPos
Definition: documentcommands_p.h:134
Okular::EditFormTextCommand::EditFormTextCommand
EditFormTextCommand(Okular::Document *doc, Okular::FormFieldText *form, int pageNumber, const QString &newContents, int newCursorPos, const QString &prevContents, int prevCursorPos, int prevAnchorPos)
Definition: documentcommands.cpp:292
QUndoCommand
Okular::DocumentPrivate::m_parent
Document * m_parent
Definition: document_p.h:187
Okular::EditFormButtonsCommand::EditFormButtonsCommand
EditFormButtonsCommand(Okular::Document *doc, int pageNumber, const QList< FormFieldButton * > &formButtons, const QList< bool > &newButtonStates)
Definition: documentcommands.cpp:447
Okular::EditFormListCommand::undo
virtual void undo()
Definition: documentcommands.cpp:353
Okular::EditTextCommand::EditTextCommand
EditTextCommand(const QString &newContents, int newCursorPos, const QString &prevContents, int prevCursorPos, int prevAnchorPos)
Definition: documentcommands.cpp:159
Okular::FormFieldButton
Interface of a button form field.
Definition: form.h:118
Okular::ModifyAnnotationPropertiesCommand::undo
virtual void undo()
Definition: documentcommands.cpp:94
Okular::Annotation::setAnnotationProperties
void setAnnotationProperties(const QDomNode &node)
Sets annotations internal properties according to the contents of node.
Definition: annotations.cpp:810
Okular::EditTextCommand
Definition: documentcommands_p.h:102
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

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