lib

KoAutoFormat Class Reference

List of all members.

Detailed Description

Definition at line 96 of file KoAutoFormat.h.


Public Types

enum  KeyCompletionAction {
  Enter = 0, Tab = 1, Space = 2, End = 3,
  Right = 4
}

Public Member Functions

 KoAutoFormat (KoDocument *_doc, KoVariableCollection *_varCollection, KoVariableFormatCollection *_varFormatCollection)
 KoAutoFormat (const KoAutoFormat &format)
 ~KoAutoFormat ()
KCommandapplyAutoFormat (KoTextObject *obj)
void doAutoFormat (KoTextCursor *cursor, KoTextParag *parag, int index, QChar ch, KoTextObject *txtObj)
bool doCompletion (KoTextCursor *textEditCursor, KoTextParag *parag, int const index, KoTextObject *txtObj)
bool doToolTipCompletion (KoTextCursor *textEditCursor, KoTextParag *parag, int index, KoTextObject *txtObj, int keyPress)
void showToolTipBox (KoTextParag *parag, int index, QWidget *widget, const QPoint &pos)
void removeToolTipCompletion ()
bool doIgnoreDoubleSpace (KoTextParag *parag, int index, QChar ch)
QString getLastWord (const int max_words, KoTextParag *parag, int const index)
void configTypographicDoubleQuotes (TypographicQuotes _tq)
void configTypographicSimpleQuotes (TypographicQuotes _tq)
void configUpperCase (bool _uc)
void configUpperUpper (bool _uu)
void configAdvancedAutocorrect (bool _aa)
void configAutoDetectUrl (bool _au)
void configIgnoreDoubleSpace (bool _ids)
void configRemoveSpaceBeginEndLine (bool _space)
void configUseBulletStyle (bool _ubs)
void configBulletStyle (QChar b)
void configAutoChangeFormat (bool b)
void configAutoReplaceNumber (bool b)
void configAutoNumberStyle (bool b)
void configCompletion (bool b)
void configToolTipCompletion (bool b)
void configAppendSpace (bool b)
void configMinWordLength (uint val)
void configNbMaxCompletionWord (uint val)
void configAddCompletionWord (bool b)
void configIncludeTwoUpperUpperLetterException (bool b)
void configIncludeAbbreviation (bool b)
void configAutoSuperScript (bool b)
void configCorrectionWithFormat (bool b)
void configCapitalizeNameOfDays (bool b)
void configAutoFormatLanguage (const QString &_lang)
void configKeyCompletionAction (KeyCompletionAction action)
TypographicQuotes getConfigTypographicSimpleQuotes () const
TypographicQuotes getConfigTypographicDoubleQuotes () const
TypographicQuotes getDefaultTypographicDoubleQuotes () const
TypographicQuotes getDefaultTypographicSimpleQuotes () const
bool getConfigUpperCase () const
bool getConfigUpperUpper () const
bool getConfigAdvancedAutoCorrect () const
bool getConfigAutoDetectUrl () const
bool getConfigIgnoreDoubleSpace () const
bool getConfigRemoveSpaceBeginEndLine () const
bool getConfigUseBulletSyle () const
QChar getConfigBulletStyle () const
bool getConfigAutoChangeFormat () const
bool getConfigAutoReplaceNumber () const
bool getConfigAutoNumberStyle () const
bool getConfigCompletion () const
bool getConfigToolTipCompletion () const
bool getConfigAppendSpace () const
uint getConfigMinWordLength () const
uint getConfigNbMaxCompletionWord () const
bool getConfigAddCompletionWord () const
bool getConfigIncludeTwoUpperUpperLetterException () const
bool getConfigIncludeAbbreviation () const
bool getConfigAutoSuperScript () const
bool getConfigCorrectionWithFormat () const
bool getConfigCapitalizeNameOfDays () const
QString getConfigAutoFormatLanguage () const
KeyCompletionAction getConfigKeyAction () const
const QDict< KoAutoFormatEntry > & getAutoFormatEntries () const
KoAutoFormatEntryfindFormatEntry (const QString &text)
void addAutoFormatEntry (const QString &key, KoAutoFormatEntry *entry)
void addAutoFormatEntry (const QString &key, const QString &replace)
void removeAutoFormatEntry (const QString &key)
void copyAutoFormatEntries (const KoAutoFormat &other)
void copyListException (const QStringList &_list)
void copyListTwoUpperCaseException (const QStringList &_list)
QStringList listException () const
QStringList listTwoUpperLetterException () const
QStringList listCompletion () const
KCompletion * getCompletion () const
int nbSuperScriptEntry () const
void readConfig (bool force=false)
void saveConfig ()
void updateMaxWords ()

Static Public Member Functions

static QString getLastWord (KoTextParag *parag, int const index)
static QString getWordAfterSpace (KoTextParag *parag, int const index)
static bool isUpper (const QChar &c)
static bool isLower (const QChar &c)
static bool isMark (const QChar &c)
static bool isSeparator (const QChar &c)

Protected Member Functions

KCommanddoAutoCorrect (KoTextCursor *textEditCursor, KoTextParag *parag, int &index, KoTextObject *txtObj)
KCommanddoUpperCase (KoTextCursor *textEditCursor, KoTextParag *parag, int index, const QString &word, KoTextObject *txtObj)
KCommanddoTypographicQuotes (KoTextCursor *textEditCursor, KoTextParag *parag, int index, KoTextObject *txtObj, bool doubleQuotes)
void buildMaxLen ()
void doAutoDetectUrl (KoTextCursor *textEditCursor, KoTextParag *parag, int &index, QString &word, KoTextObject *txtObj)
KCommanddoRemoveSpaceBeginEndLine (KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj, int &index)
KCommanddoAutoChangeFormat (KoTextCursor *textEditCursor, KoTextParag *parag, int index, const QString &word, KoTextObject *txtObj)
KCommanddoUseBulletStyle (KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj, int &index)
KCommanddoAutoReplaceNumber (KoTextCursor *textEditCursor, KoTextParag *parag, int &index, const QString &word, KoTextObject *txtObj)
KCommanddoUseNumberStyle (KoTextCursor *, KoTextParag *parag, KoTextObject *txtObj, int &index)
void doAutoIncludeUpperUpper (KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj)
void doAutoIncludeAbbreviation (KoTextCursor *textEditCursor, KoTextParag *parag, KoTextObject *txtObj)
KCommanddoAutoSuperScript (KoTextCursor *textEditCursor, KoTextParag *parag, int index, const QString &word, KoTextObject *txtObj)
KCommanddoCapitalizeNameOfDays (KoTextCursor *textEditCursor, KoTextParag *parag, int index, const QString &word, KoTextObject *txtObj)
void loadEntry (const QDomElement &nl, bool _allLanguages=false)
QDomElement saveEntry (QDictIterator< KoAutoFormatEntry > _entry, QDomDocument doc)

Static Protected Member Functions

static void changeTextFormat (KoSearchContext *formatOptions, KoTextFormat *format, int &flags)

Classes

struct  TypographicQuotes

Constructor & Destructor Documentation

KoAutoFormat::KoAutoFormat ( KoDocument _doc,
KoVariableCollection _varCollection,
KoVariableFormatCollection _varFormatCollection 
)

There is a single instance of KoAutoFormat per document (and a temporary one in the auto-format dialog).

Definition at line 119 of file KoAutoFormat.cpp.

KoAutoFormat::KoAutoFormat ( const KoAutoFormat format  ) 

Copy constructor, used by KoAutoFormatDia.

Definition at line 176 of file KoAutoFormat.cpp.


Member Function Documentation

void KoAutoFormat::doAutoFormat ( KoTextCursor cursor,
KoTextParag parag,
int  index,
QChar  ch,
KoTextObject txtObj 
)

Called by edit widget when a character (ch) has been inserted into parag, at the given index.

Definition at line 1101 of file KoAutoFormat.cpp.

bool KoAutoFormat::doCompletion ( KoTextCursor textEditCursor,
KoTextParag parag,
int const  index,
KoTextObject txtObj 
)

Called by edit widget when a call a competion.

Definition at line 913 of file KoAutoFormat.cpp.

QString KoAutoFormat::getLastWord ( KoTextParag parag,
int const  index 
) [static]

Helper method, returns the last word before parag,index.

Definition at line 865 of file KoAutoFormat.cpp.

QString KoAutoFormat::getWordAfterSpace ( KoTextParag parag,
int const  index 
) [static]

Helper method, returns the last word before parag,index different from getLastWord, because we test just space character and not punctualtion character.

Definition at line 898 of file KoAutoFormat.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys