#include <kdevlanguagesupport.h>

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) |
![]() | |
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
Features supported by this language support.
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
-
info Important 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. parent The parent object for the plugin. Parent object must implement KDevApi interface. Otherwise the plugin will not be constructed. name The 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
|
signal |
Emitted before removing the file from the memory symbol store.
◆ addAttribute()
|
virtual |
Opens an "Add attribute" dialog and adds the configured attribute to the sources.
Define AddAttribute feature if you reimplement this method.
- Parameters
-
klass The class DOM to add an attribute to.
Definition at line 88 of file kdevlanguagesupport.cpp.
◆ 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
|
signal |
Emitted when a file has been added to the memory symbol store.
◆ addFunction
|
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
-
type The type of integrated designer. formName The name of a GUI form. function The function to implement (add).
Definition at line 107 of file kdevlanguagesupport.cpp.
◆ addMethod()
|
virtual |
Opens an "Add method" dialog and adds the configured method to the sources.
Define AddMethod feature if you reimplement this method.
- Parameters
-
klass The class DOM to add a method to.
Definition at line 80 of file kdevlanguagesupport.cpp.
◆ createAccessMethods()
|
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
-
theClass The class the methods should be added to. theVariable The attribute the access methods should be generated for.
Definition at line 152 of file kdevlanguagesupport.cpp.
◆ designer()
|
virtual |
Reimplement this method if you want to use integrated GUI designer for the language.
Implementation could look like (in pseudo code):
ImplementationWidget and TQtDesignerIntegration classes are available from designerintegration support library.
- Parameters
-
type The 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
|
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
-
type The type of integrated designer. formName The name of a GUI form. oldFunction The old function signature before editing. function The new function signature after editing.
Definition at line 122 of file kdevlanguagesupport.cpp.
◆ 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()
|
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
-
name Class name.
Definition at line 56 of file kdevlanguagesupport.cpp.
◆ formatModelItem()
|
virtual |
Formats a CodeModelItem as used by the CodeModel to the human-readable convention.
- Parameters
-
item Symbol to format. shortDescription Show 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()
|
virtual |
Formats a Tag as used by the persistent symbol store to the human-readable convention.
- Parameters
-
tag Tag to format.
Definition at line 51 of file kdevlanguagesupport.cpp.
◆ implementVirtualMethods()
|
virtual |
Opens an "Implement Virtual Methods" dialog and adds the configured methods to the sources.
Define AddMethod feature if you reimplement this method.
- Parameters
-
klass The class DOM to add a virtual method to.
Definition at line 84 of file kdevlanguagesupport.cpp.
◆ 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
|
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
-
type The type of integrated designer. formName The name of a GUI form. functionName The name of a function to seek in the code for.
Definition at line 144 of file kdevlanguagesupport.cpp.
◆ openSource
|
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
-
type The type of integrated designer. formName The name of a GUI form.
Definition at line 158 of file kdevlanguagesupport.cpp.
◆ removedSourceInfo
|
signal |
Emitted when a file has been removed from the memory symbol store.
◆ removeFunction
|
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
-
type The type of integrated designer. formName The name of a GUI form. function The function to remove.
Definition at line 130 of file kdevlanguagesupport.cpp.
◆ shouldSplitDocument()
|
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
-
name URL of the document in question.
Definition at line 66 of file kdevlanguagesupport.cpp.
◆ splitOrientation()
|
virtual |
Returns the language parts Split View orientation.
By default Qt::Vertical.
Definition at line 71 of file kdevlanguagesupport.cpp.
◆ splitOrientationChanged
|
signal |
Emitted when the language part changes the Split View orientation.
◆ subclassWidget()
|
virtual |
Opens an "Subclass Widget" dialog for given TQt .ui file (formName) and propmts to implement it's slots.
- Parameters
-
formName The name of a form to subclass.
- Returns
- A list of newly created files.
Definition at line 92 of file kdevlanguagesupport.cpp.
◆ unformatClassName()
|
virtual |
The opposite of formatClassName.
Reverts formatting.
- Parameters
-
name Class name.
Definition at line 61 of file kdevlanguagesupport.cpp.
◆ updatedSourceInfo
|
signal |
Emitted when the content of the memory symbol store has been modified.
◆ updateWidget()
|
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
-
formName The name of a form which is being subclassed. fileName The 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: