• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • TDevelop Interfaces Library
 

TDevelop Interfaces Library

Public Types | Public Slots | Signals | Public Member Functions | List of all members
KDevLanguageSupport Class Reference

#include <kdevlanguagesupport.h>

Inheritance diagram for KDevLanguageSupport:
KDevPlugin

Public Types

enum  Features {
  Classes =1, Structs =2, Functions =4, Variables =8,
  Namespaces =16, Signals =32, Slots =64, Declarations =128,
  NewClass =512, AddMethod =1024, AddAttribute =2048, CreateAccessMethods =4096
}
 

Public Slots

void addFunction (DesignerType type, const TQString &formName, Function function)
 
void removeFunction (DesignerType type, const TQString &formName, Function function)
 
void editFunction (DesignerType type, const TQString &formName, Function oldFunction, Function function)
 
void openFunction (DesignerType type, const TQString &formName, const TQString &functionName)
 
void openSource (DesignerType type, const TQString &formName)
 

Signals

void updatedSourceInfo ()
 
void aboutToRemoveSourceInfo (const TQString &fileName)
 
void removedSourceInfo (const TQString &fileName)
 
void addedSourceInfo (const TQString &fileName)
 
void splitOrientationChanged (Qt::Orientation orientation)
 

Public Member Functions

 KDevLanguageSupport (const KDevPluginInfo *info, TQObject *parent, const char *name)
 
 ~KDevLanguageSupport ()
 
virtual Features features ()
 
virtual KMimeType::List mimeTypes ()
 
virtual TQString formatTag (const Tag &tag)
 
virtual TQString formatModelItem (const CodeModelItem *item, bool shortDescription=false)
 
virtual TQString formatClassName (const TQString &name)
 
virtual TQString unformatClassName (const TQString &name)
 
virtual bool shouldSplitDocument (const KURL &url)
 
virtual Qt::Orientation splitOrientation () const
 
virtual void addClass ()
 
virtual void addMethod (ClassDom klass)
 
virtual void implementVirtualMethods (ClassDom klass)
 
virtual void addAttribute (ClassDom klass)
 
virtual void createAccessMethods (ClassDom theClass, VariableDom theVariable)
 
virtual TQStringList subclassWidget (const TQString &formName)
 
virtual TQStringList updateWidget (const TQString &formName, const TQString &fileName)
 
virtual KDevDesignerIntegration * designer (KInterfaceDesigner::DesignerType type)
 
- Public Member Functions inherited from KDevPlugin
 KDevPlugin (const KDevPluginInfo *info, TQObject *parent, const char *name=0)
 
virtual ~KDevPlugin ()
 
const KDevPluginInfo * info ()
 
KDevMainWindow * mainWindow ()
 
KDevCore * core () const
 
KDevProject * project () const
 
KDevLanguageSupport * languageSupport () const
 
CodeModel * codeModel () const
 
TQDomDocument * projectDom () const
 
KDevPartController * partController () const
 
virtual KDevPluginController * pluginController () const
 
KDevCodeRepository * codeRepository () const
 
template<class Extension >
Extension * extension (const TQString &serviceType, const TQString &constraint="")
 
virtual void restorePartialProjectSession (const TQDomElement *el)
 
virtual void savePartialProjectSession (TQDomElement *el)
 

Detailed Description

KDevelop language support interface - the base class for all programming language support plugins.

Language support is used to load facilities specific to certain programming language. Language supports are usually loaded among with a project. In this case project file defines which language support to load.

Language support plugin is a good place for:

  • a language parser which fills memory and persistent symbol store (see CodeModel and KDevCodeRepository);
  • code wizards specific to a programming language (like new class wizard);
  • GUI designer integration (see KDevLanguageSupport::designer method documentation and KDevDesignerIntegration class documentation;
  • symbol (class, function, etc.) name formatting to a human-readable convention (pretty formatted name).

Definition at line 61 of file kdevlanguagesupport.h.

Member Enumeration Documentation

◆ Features

enum KDevLanguageSupport::Features

Features supported by this language support.

Enumerator
Classes 

Language has classes (or class-like packages).

Structs 

Language has structures or records.

Functions 

Language has functions.

Variables 

Language has variables.

Namespaces 

Language has namespaces.

Signals 

Language has signals (or qt library bindings are available).

Slots 

Language has slots (or qt library bindings are available).

Declarations 

Language has function declarations (like c, c++ and pascal).

NewClass 

Language support can create classes.

AddMethod 

Language support can create methods.

AddAttribute 

Language support can create class attributes.

CreateAccessMethods 

Language support can create get/set methods for attributes.

Definition at line 69 of file kdevlanguagesupport.h.

Constructor & Destructor Documentation

◆ KDevLanguageSupport()

KDevLanguageSupport::KDevLanguageSupport ( const KDevPluginInfo *  info,
TQObject *  parent,
const char *  name 
)

Constructs a language support plugin.

Parameters
infoImportant information about the plugin - plugin internal and generic (GUI) name, description, a list of authors, etc. That information is used to show plugin information in various places like "about application" dialog, plugin selector dialog, etc. Plugin does not take ownership on info object, also its lifetime should be equal to the lifetime of the plugin.
parentThe parent object for the plugin. Parent object must implement KDevApi interface. Otherwise the plugin will not be constructed.
nameThe internal name which identifies the plugin.

Definition at line 32 of file kdevlanguagesupport.cpp.

◆ ~KDevLanguageSupport()

KDevLanguageSupport::~KDevLanguageSupport ( )

Destructor.

Definition at line 37 of file kdevlanguagesupport.cpp.

Member Function Documentation

◆ aboutToRemoveSourceInfo

void KDevLanguageSupport::aboutToRemoveSourceInfo ( const TQString &  fileName)
signal

Emitted before removing the file from the memory symbol store.

◆ addAttribute()

void KDevLanguageSupport::addAttribute ( ClassDom  klass)
virtual

Opens an "Add attribute" dialog and adds the configured attribute to the sources.

Define AddAttribute feature if you reimplement this method.

Parameters
klassThe class DOM to add an attribute to.

Definition at line 88 of file kdevlanguagesupport.cpp.

◆ addClass()

void KDevLanguageSupport::addClass ( )
virtual

Opens a "New class" dialog and adds the configured class to the sources.

Define NewClass feature if you reimplement this method.

Definition at line 76 of file kdevlanguagesupport.cpp.

◆ addedSourceInfo

void KDevLanguageSupport::addedSourceInfo ( const TQString &  fileName)
signal

Emitted when a file has been added to the memory symbol store.

◆ addFunction

void KDevLanguageSupport::addFunction ( DesignerType  type,
const TQString &  formName,
Function  function 
)
slot

Adds a function requested by a GUI designer.

No need to reimplement this slot unless you want to use specific implementation of KDevDesignerIntegration interface.

Parameters
typeThe type of integrated designer.
formNameThe name of a GUI form.
functionThe function to implement (add).

Definition at line 107 of file kdevlanguagesupport.cpp.

◆ addMethod()

void KDevLanguageSupport::addMethod ( ClassDom  klass)
virtual

Opens an "Add method" dialog and adds the configured method to the sources.

Define AddMethod feature if you reimplement this method.

Parameters
klassThe class DOM to add a method to.

Definition at line 80 of file kdevlanguagesupport.cpp.

◆ createAccessMethods()

void KDevLanguageSupport::createAccessMethods ( ClassDom  theClass,
VariableDom  theVariable 
)
virtual

Opens an "create get/set methods" dialog and adds the configured methods to the sources.

Define CreateAccessMethods feature if you reimplement this method.

Parameters
theClassThe class the methods should be added to.
theVariableThe attribute the access methods should be generated for.

Definition at line 152 of file kdevlanguagesupport.cpp.

◆ designer()

KDevDesignerIntegration * KDevLanguageSupport::designer ( KInterfaceDesigner::DesignerType  type)
virtual

Reimplement this method if you want to use integrated GUI designer for the language.

Implementation could look like (in pseudo code):

KDevDesignerIntegration *des = 0;
switch (type)
{
case KInterfaceDesigner::TQtDesigner:
des = getDesignerFromCache(type);
if (des == 0)
{
MyLanguageImplementationWidget *impl = new MyLanguageImplementationWidget(this);
des = new TQtDesignerMyLanguageIntegration(this, impl);
des->loadSettings(*project()->projectDom(), "kdevmylangsupport/designerintegration");
saveDesignerToCache(type, des);
}
break;
}
return des;

ImplementationWidget and TQtDesignerIntegration classes are available from designerintegration support library.

Parameters
typeThe type of the designer to integrate.
Returns
The pointer to designer integration of given type or 0.

Definition at line 138 of file kdevlanguagesupport.cpp.

◆ editFunction

void KDevLanguageSupport::editFunction ( DesignerType  type,
const TQString &  formName,
Function  oldFunction,
Function  function 
)
slot

Edits a function requested by a GUI designer.

No need to reimplement this slot unless you want to use specific implementation of KDevDesignerIntegration interface.

Parameters
typeThe type of integrated designer.
formNameThe name of a GUI form.
oldFunctionThe old function signature before editing.
functionThe new function signature after editing.

Definition at line 122 of file kdevlanguagesupport.cpp.

◆ features()

KDevLanguageSupport::Features KDevLanguageSupport::features ( )
virtual
Returns
The feature set of the language. This is e.g. used by the class view to decide which organizer items to display and which not.

Definition at line 41 of file kdevlanguagesupport.cpp.

◆ formatClassName()

TQString KDevLanguageSupport::formatClassName ( const TQString &  name)
virtual

Formats a canonicalized class path as used by the symbol store to the human-readable convention.

For example, the C++ support part formats the string "KParts.Part" into "KParts::Part".

Parameters
nameClass name.

Definition at line 56 of file kdevlanguagesupport.cpp.

◆ formatModelItem()

TQString KDevLanguageSupport::formatModelItem ( const CodeModelItem *  item,
bool  shortDescription = false 
)
virtual

Formats a CodeModelItem as used by the CodeModel to the human-readable convention.

Parameters
itemSymbol to format.
shortDescriptionShow short description of a symbol. For example, when formatting functions short description could be a function signature without the return type and argument default values.

Definition at line 102 of file kdevlanguagesupport.cpp.

◆ formatTag()

TQString KDevLanguageSupport::formatTag ( const Tag &  tag)
virtual

Formats a Tag as used by the persistent symbol store to the human-readable convention.

Parameters
tagTag to format.

Definition at line 51 of file kdevlanguagesupport.cpp.

◆ implementVirtualMethods()

void KDevLanguageSupport::implementVirtualMethods ( ClassDom  klass)
virtual

Opens an "Implement Virtual Methods" dialog and adds the configured methods to the sources.

Define AddMethod feature if you reimplement this method.

Parameters
klassThe class DOM to add a virtual method to.

Definition at line 84 of file kdevlanguagesupport.cpp.

◆ mimeTypes()

KMimeType::List KDevLanguageSupport::mimeTypes ( )
virtual
Returns
A typical mimetype list for the support language, this list should be configurable in the languagesupport dialog.

Definition at line 46 of file kdevlanguagesupport.cpp.

◆ openFunction

void KDevLanguageSupport::openFunction ( DesignerType  type,
const TQString &  formName,
const TQString &  functionName 
)
slot

Opens a function requested by a GUI designer.

No need to reimplement this slot unless you want to use specific implementation of KDevDesignerIntegration interface.

Parameters
typeThe type of integrated designer.
formNameThe name of a GUI form.
functionNameThe name of a function to seek in the code for.

Definition at line 144 of file kdevlanguagesupport.cpp.

◆ openSource

void KDevLanguageSupport::openSource ( DesignerType  type,
const TQString &  formName 
)
slot

Opens a form source requested by a GUI designer.

No need to reimplement this slot unless you want to use specific implementation of KDevDesignerIntegration interface.

Parameters
typeThe type of integrated designer.
formNameThe name of a GUI form.

Definition at line 158 of file kdevlanguagesupport.cpp.

◆ removedSourceInfo

void KDevLanguageSupport::removedSourceInfo ( const TQString &  fileName)
signal

Emitted when a file has been removed from the memory symbol store.

◆ removeFunction

void KDevLanguageSupport::removeFunction ( DesignerType  type,
const TQString &  formName,
Function  function 
)
slot

Removes a function requested by a GUI designer.

No need to reimplement this slot unless you want to use specific implementation of KDevDesignerIntegration interface.

Parameters
typeThe type of integrated designer.
formNameThe name of a GUI form.
functionThe function to remove.

Definition at line 130 of file kdevlanguagesupport.cpp.

◆ shouldSplitDocument()

bool KDevLanguageSupport::shouldSplitDocument ( const KURL &  url)
virtual

Determines whether the document should be opened in a split view.

The language part can determine this internally and then set the active document and if so, set the active document so that the newly opened one will be split with it.

Parameters
nameURL of the document in question.

Definition at line 66 of file kdevlanguagesupport.cpp.

◆ splitOrientation()

Qt::Orientation KDevLanguageSupport::splitOrientation ( ) const
virtual

Returns the language parts Split View orientation.

By default Qt::Vertical.

Definition at line 71 of file kdevlanguagesupport.cpp.

◆ splitOrientationChanged

void KDevLanguageSupport::splitOrientationChanged ( Qt::Orientation  orientation)
signal

Emitted when the language part changes the Split View orientation.

◆ subclassWidget()

TQStringList KDevLanguageSupport::subclassWidget ( const TQString &  formName)
virtual

Opens an "Subclass Widget" dialog for given TQt .ui file (formName) and propmts to implement it's slots.

Parameters
formNameThe name of a form to subclass.
Returns
A list of newly created files.

Definition at line 92 of file kdevlanguagesupport.cpp.

◆ unformatClassName()

TQString KDevLanguageSupport::unformatClassName ( const TQString &  name)
virtual

The opposite of formatClassName.

Reverts formatting.

Parameters
nameClass name.

Definition at line 61 of file kdevlanguagesupport.cpp.

◆ updatedSourceInfo

void KDevLanguageSupport::updatedSourceInfo ( )
signal

Emitted when the content of the memory symbol store has been modified.

◆ updateWidget()

TQStringList KDevLanguageSupport::updateWidget ( const TQString &  formName,
const TQString &  fileName 
)
virtual

Opens an "Update Widget" dialog for given TQt .ui file (formName) and prompts to add missing slot implementations in the subclass located in fileName.

Parameters
formNameThe name of a form which is being subclassed.
fileNameThe name of a file with a subclass.
Returns
A list of updated files. Can be empty because usually no additional actions are required on updated files.

Definition at line 97 of file kdevlanguagesupport.cpp.


The documentation for this class was generated from the following files:
  • kdevlanguagesupport.h
  • kdevlanguagesupport.cpp

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for TDevelop Interfaces Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.