KDevelop API Documentation

AbbrevPart Class Reference

Provides support for customizable abbrevations - short words which expand into commonly needed code structures. More...

#include <abbrevpart.h>

Inheritance diagram for AbbrevPart:

KDevPlugin QObject KXMLGUIClient List of all members.

Public Member Functions

 AbbrevPart (QObject *parent, const char *name, const QStringList &)
 ~AbbrevPart ()
bool autoWordCompletionEnabled () const
void setAutoWordCompletionEnabled (bool enabled)
void addTemplate (const QString &templ, const QString &descr, const QString &suffixes, const QString &code)
void removeTemplate (const QString &suffixes, const QString &name)
void clearTemplates ()
CodeTemplateList templates () const

Private Slots

void slotExpandText ()
void slotExpandAbbrev ()
void configWidget (KDialogBase *dlg)
void slotActivePartChanged (KParts::Part *)
void slotTextChanged ()
void slotCompletionAborted ()
void slotCompletionDone ()
void slotFilterInsertString (KTextEditor::CompletionEntry *, QString *)
void slotAboutToShowCompletionBox ()

Private Member Functions

void updateActions ()
void load ()
void save ()
QString currentWord () const
QValueList< KTextEditor::CompletionEntryfindAllWords (const QString &text, const QString &prefix)
void insertChars (const QString &chars)

Private Attributes

CodeTemplateList m_templates
bool m_inCompletion
int m_prevLine
int m_prevColumn
int m_sequenceLength
bool m_autoWordCompletionEnabled
QString m_completionFile
KTextEditor::DocumentdocIface
KTextEditor::EditInterfaceeditIface
KTextEditor::ViewCursorInterfaceviewCursorIface
KTextEditor::CodeCompletionInterfacecompletionIface

Detailed Description

Provides support for customizable abbrevations - short words which expand into commonly needed code structures.

Author(s):
Bernd Gehrmann

Maintainer(s):
Roberto Raggi

Feature(s):
Feature 1

Feature 2

Bug:
Bug1

Bug2

Note:
Put you notes here (if you have them!) :)
Verbatin code here

Definition at line 63 of file abbrevpart.h.


Constructor & Destructor Documentation

AbbrevPart::AbbrevPart QObject parent,
const char *  name,
const QStringList
 

Definition at line 65 of file abbrevpart.cpp.

References KConfigBase::readBoolEntry().

AbbrevPart::~AbbrevPart  ) 
 

Definition at line 111 of file abbrevpart.cpp.

References save().


Member Function Documentation

void AbbrevPart::addTemplate const QString templ,
const QString descr,
const QString suffixes,
const QString code
 

Definition at line 442 of file abbrevpart.cpp.

References addTemplate(), CodeTemplateList::insert(), and m_templates.

Referenced by AbbrevConfigWidget::accept(), addTemplate(), and load().

bool AbbrevPart::autoWordCompletionEnabled  )  const
 

Definition at line 116 of file abbrevpart.cpp.

References m_autoWordCompletionEnabled.

Referenced by slotActivePartChanged().

void AbbrevPart::clearTemplates  ) 
 

Definition at line 457 of file abbrevpart.cpp.

References CodeTemplateList::clear(), and m_templates.

Referenced by AbbrevConfigWidget::accept().

void AbbrevPart::configWidget KDialogBase dlg  )  [private, slot]
 

Definition at line 247 of file abbrevpart.cpp.

References KDialogBase::addVBoxPage(), and configWidget().

Referenced by configWidget().

QString AbbrevPart::currentWord  )  const [private]
 

Definition at line 233 of file abbrevpart.cpp.

References KTextEditor::ViewCursorInterface::cursorPositionReal(), editIface, KTextEditor::EditInterface::textLine(), and viewCursorIface.

Referenced by slotExpandAbbrev(), slotExpandText(), and slotFilterInsertString().

QValueList< KTextEditor::CompletionEntry > AbbrevPart::findAllWords const QString text,
const QString prefix
[private]
 

Definition at line 280 of file abbrevpart.cpp.

References KParts::PartManager::activePart(), KParts::PartManager::activeWidget(), endl(), findAllWords(), kdDebug(), len, m_completionFile, m_templates, KDevPlugin::partController(), KTextEditor::CompletionEntry::text, text(), KURL::url(), KParts::ReadOnlyPart::url(), and KTextEditor::CompletionEntry::userdata.

Referenced by findAllWords(), and slotExpandText().

void AbbrevPart::insertChars const QString chars  )  [private]
 

Definition at line 386 of file abbrevpart.cpp.

References KTextEditor::ViewCursorInterface::cursorPositionReal(), editIface, endl(), insertChars(), KTextEditor::EditInterface::insertText(), kdDebug(), KTextEditor::ViewCursorInterface::setCursorPositionReal(), KTextEditor::EditInterface::textLine(), and viewCursorIface.

Referenced by insertChars(), slotExpandAbbrev(), and slotFilterInsertString().

void AbbrevPart::load  )  [private]
 

Definition at line 150 of file abbrevpart.cpp.

References addTemplate(), endl(), KStandardDirs::findAllResources(), kdDebug(), locateLocal(), and m_completionFile.

void AbbrevPart::removeTemplate const QString suffixes,
const QString name
 

Definition at line 451 of file abbrevpart.cpp.

References m_templates, CodeTemplateList::remove(), and removeTemplate().

Referenced by removeTemplate().

void AbbrevPart::save  )  [private]
 

Definition at line 203 of file abbrevpart.cpp.

References CodeTemplateList::allTemplates(), CodeTemplate::code, CodeTemplate::description, endl(), kdDebug(), m_templates, CodeTemplate::name, CodeTemplate::suffixes, and templates().

Referenced by ~AbbrevPart().

void AbbrevPart::setAutoWordCompletionEnabled bool  enabled  ) 
 

Definition at line 121 of file abbrevpart.cpp.

References docIface, m_autoWordCompletionEnabled, setAutoWordCompletionEnabled(), slotAboutToShowCompletionBox(), slotCompletionAborted(), slotCompletionDone(), slotTextChanged(), KConfigBase::sync(), KParts::Part::widget(), and KConfigBase::writeEntry().

Referenced by AbbrevConfigWidget::accept(), and setAutoWordCompletionEnabled().

void AbbrevPart::slotAboutToShowCompletionBox  )  [private, slot]
 

Definition at line 597 of file abbrevpart.cpp.

References endl(), kdDebug(), and m_inCompletion.

Referenced by setAutoWordCompletionEnabled(), and slotActivePartChanged().

void AbbrevPart::slotActivePartChanged KParts::Part  )  [private, slot]
 

Definition at line 467 of file abbrevpart.cpp.

References KActionCollection::action(), KXMLGUIClient::actionCollection(), autoWordCompletionEnabled(), completionIface, docIface, editIface, endl(), kdDebug(), m_prevColumn, m_prevLine, m_sequenceLength, KAction::setEnabled(), slotAboutToShowCompletionBox(), slotActivePartChanged(), slotCompletionAborted(), slotCompletionDone(), slotFilterInsertString(), slotTextChanged(), updateActions(), viewCursorIface, and KParts::Part::widget().

Referenced by slotActivePartChanged().

void AbbrevPart::slotCompletionAborted  )  [private, slot]
 

Definition at line 585 of file abbrevpart.cpp.

References endl(), kdDebug(), and m_inCompletion.

Referenced by setAutoWordCompletionEnabled(), and slotActivePartChanged().

void AbbrevPart::slotCompletionDone  )  [private, slot]
 

Definition at line 591 of file abbrevpart.cpp.

References endl(), kdDebug(), and m_inCompletion.

Referenced by setAutoWordCompletionEnabled(), and slotActivePartChanged().

void AbbrevPart::slotExpandAbbrev  )  [private, slot]
 

Definition at line 343 of file abbrevpart.cpp.

References KParts::PartManager::activePart(), KParts::PartManager::activeWidget(), currentWord(), KTextEditor::ViewCursorInterface::cursorPositionReal(), endl(), insertChars(), kdDebug(), m_templates, KDevPlugin::partController(), KTextEditor::EditInterface::removeText(), KURL::url(), and KParts::ReadOnlyPart::url().

void AbbrevPart::slotExpandText  )  [private, slot]
 

Definition at line 255 of file abbrevpart.cpp.

References completionIface, currentWord(), editIface, findAllWords(), m_inCompletion, KTextEditor::CodeCompletionInterface::showCompletionBox(), KTextEditor::EditInterface::text(), and viewCursorIface.

Referenced by slotTextChanged().

void AbbrevPart::slotFilterInsertString KTextEditor::CompletionEntry ,
QString
[private, slot]
 

Definition at line 549 of file abbrevpart.cpp.

References KParts::PartManager::activePart(), KParts::PartManager::activeWidget(), currentWord(), KTextEditor::ViewCursorInterface::cursorPositionReal(), editIface, endl(), insertChars(), kdDebug(), length(), m_templates, KDevPlugin::partController(), KTextEditor::EditInterface::removeText(), slotFilterInsertString(), KTextEditor::CompletionEntry::text, text(), KURL::url(), KParts::ReadOnlyPart::url(), KTextEditor::CompletionEntry::userdata, and viewCursorIface.

Referenced by slotActivePartChanged(), and slotFilterInsertString().

void AbbrevPart::slotTextChanged  )  [private, slot]
 

Definition at line 516 of file abbrevpart.cpp.

References KTextEditor::ViewCursorInterface::cursorPositionReal(), editIface, m_inCompletion, m_prevColumn, m_prevLine, m_sequenceLength, slotExpandText(), KTextEditor::EditInterface::textLine(), and viewCursorIface.

Referenced by setAutoWordCompletionEnabled(), and slotActivePartChanged().

CodeTemplateList AbbrevPart::templates  )  const
 

Definition at line 462 of file abbrevpart.cpp.

References m_templates.

Referenced by AbbrevConfigWidget::AbbrevConfigWidget(), AbbrevConfigWidget::addTemplate(), and save().

void AbbrevPart::updateActions  )  [private]
 

Definition at line 579 of file abbrevpart.cpp.

References KActionCollection::action(), KXMLGUIClient::actionCollection(), docIface, and KAction::setEnabled().

Referenced by slotActivePartChanged().


Member Data Documentation

KTextEditor::CodeCompletionInterface* AbbrevPart::completionIface [private]
 

Definition at line 110 of file abbrevpart.h.

Referenced by slotActivePartChanged(), and slotExpandText().

KTextEditor::Document* AbbrevPart::docIface [private]
 

Definition at line 107 of file abbrevpart.h.

Referenced by setAutoWordCompletionEnabled(), slotActivePartChanged(), and updateActions().

KTextEditor::EditInterface* AbbrevPart::editIface [private]
 

Definition at line 108 of file abbrevpart.h.

Referenced by currentWord(), insertChars(), slotActivePartChanged(), slotExpandText(), slotFilterInsertString(), and slotTextChanged().

bool AbbrevPart::m_autoWordCompletionEnabled [private]
 

Definition at line 104 of file abbrevpart.h.

Referenced by autoWordCompletionEnabled(), and setAutoWordCompletionEnabled().

QString AbbrevPart::m_completionFile [private]
 

Definition at line 105 of file abbrevpart.h.

Referenced by findAllWords(), and load().

bool AbbrevPart::m_inCompletion [private]
 

Definition at line 100 of file abbrevpart.h.

Referenced by slotAboutToShowCompletionBox(), slotCompletionAborted(), slotCompletionDone(), slotExpandText(), and slotTextChanged().

int AbbrevPart::m_prevColumn [private]
 

Definition at line 102 of file abbrevpart.h.

Referenced by slotActivePartChanged(), and slotTextChanged().

int AbbrevPart::m_prevLine [private]
 

Definition at line 101 of file abbrevpart.h.

Referenced by slotActivePartChanged(), and slotTextChanged().

int AbbrevPart::m_sequenceLength [private]
 

Definition at line 103 of file abbrevpart.h.

Referenced by slotActivePartChanged(), and slotTextChanged().

CodeTemplateList AbbrevPart::m_templates [private]
 

Definition at line 99 of file abbrevpart.h.

Referenced by addTemplate(), clearTemplates(), findAllWords(), removeTemplate(), save(), slotExpandAbbrev(), slotFilterInsertString(), and templates().

KTextEditor::ViewCursorInterface* AbbrevPart::viewCursorIface [private]
 

Definition at line 109 of file abbrevpart.h.

Referenced by currentWord(), insertChars(), slotActivePartChanged(), slotExpandText(), slotFilterInsertString(), and slotTextChanged().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:18 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003