Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F16570521
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
25 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/interfaces/ktexteditor/CMakeLists.txt b/interfaces/ktexteditor/CMakeLists.txt
index d8a6bbafec..e3bc66cd98 100644
--- a/interfaces/ktexteditor/CMakeLists.txt
+++ b/interfaces/ktexteditor/CMakeLists.txt
@@ -1,95 +1,96 @@
include_directories( ${KDE4_KPARTS_INCLUDES} )
########### next target ###############
set(ktexteditor_LIB_SRCS
ktexteditor.cpp
document.cpp
range.cpp
cursor.cpp
templateinterface.cpp
templateinterface2.cpp
editorchooser.cpp
attribute.cpp
cursorfeedback.cpp
rangefeedback.cpp
smartcursor.cpp
smartrange.cpp
codecompletioninterface.cpp
codecompletionmodel.cpp
codecompletionmodelcontrollerinterface.cpp
configinterface.cpp
smartinterface.cpp
highlightinterface.cpp
movinginterface.cpp
movingcursor.cpp
movingrange.cpp
movingrangefeedback.cpp
)
kde4_add_ui_files(ktexteditor_LIB_SRCS editorchooser_ui.ui )
kde4_add_library(ktexteditor ${LIBRARY_TYPE} ${ktexteditor_LIB_SRCS})
-generate_export_header(ktexteditor)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ktexteditor)
+generate_export_header(ktexteditor EXPORT_FILE_NAME ktexteditor/ktexteditor_export.h)
target_link_libraries(ktexteditor ${KDE4_KDECORE_LIBS} ${QT_QTDBUS_LIBRARY} ${KDE4_KPARTS_LIBS} )
target_link_libraries(ktexteditor LINK_INTERFACE_LIBRARIES ${KDE4_KPARTS_LIBS} )
set_target_properties(ktexteditor
PROPERTIES VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
)
install(TARGETS ktexteditor ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( FILES
${CMAKE_CURRENT_BINARY_DIR}/ktexteditor_export.h
factory.h
editor.h
document.h
view.h
plugin.h
cursor.h
range.h
configpage.h
searchinterface.h
markinterface.h
sessionconfiginterface.h
editorchooser.h
texthintinterface.h
variableinterface.h
templateinterface.h
templateinterface2.h
modificationinterface.h
commandinterface.h
smartinterface.h
attribute.h
cursorfeedback.h
rangefeedback.h
smartcursor.h
smartcursornotifier.h
smartcursorwatcher.h
smartrange.h
smartrangenotifier.h
smartrangewatcher.h
codecompletioninterface.h
codecompletionmodel.h
codecompletionmodelcontrollerinterface.h
configinterface.h
containerinterface.h
annotationinterface.h
loadsavefiltercheckplugin.h
highlightinterface.h
modeinterface.h
movinginterface.h
movingcursor.h
movingrange.h
movingrangefeedback.h
recoveryinterface.h
DESTINATION ${INCLUDE_INSTALL_DIR}/ktexteditor COMPONENT Devel)
install( FILES ktexteditor.desktop ktexteditorplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
install( FILES kcm_ktexteditor.desktop DESTINATION ${DATA_INSTALL_DIR}/kcm_componentchooser )
install( FILES ktexteditor_loadsavefiltercheckplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
diff --git a/interfaces/ktexteditor/codecompletionmodelcontrollerinterface.h b/interfaces/ktexteditor/codecompletionmodelcontrollerinterface.h
index 8be7ea4b05..28750eeebc 100644
--- a/interfaces/ktexteditor/codecompletionmodelcontrollerinterface.h
+++ b/interfaces/ktexteditor/codecompletionmodelcontrollerinterface.h
@@ -1,346 +1,346 @@
/* This file is part of the KDE libraries
Copyright (C) 2008 Niko Sams <niko.sams@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDELIBS_KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
#define KDELIBS_KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
#include <ktexteditor/ktexteditor_export.h>
#include <ktexteditor/smartrange.h>
#include <ktexteditor/cursor.h>
#include "codecompletionmodel.h"
class QModelIndex;
namespace KTextEditor {
class View;
/**
* \short Controller interface for a CodeCompletionModel
*
* \ingroup kte_group_ccmodel_extensions
*
* The CodeCompletionModelControllerInterface gives an CodeCompletionModel better
* control over the completion.
*
* By implementing methods defined in this interface you can:
* - control when automatic completion should start (shouldStartCompletion())
* - define a custom completion range (that will be replaced when the completion
* is executed) (completionRange())
* - dynamically modify the completion range during completion (updateCompletionRange())
* - specify the string used for filtering the completion (filterString())
* - control when completion should stop (shouldAbortCompletion())
*
* When the interface is not implemented, or no methods are overridden the
* default behaviour is used, which will be correct in many situations.
*
*
* \section markext_access Implemeting the Interface
* To use this class implement it in your CodeCompletionModel.
*
* \code
* class MyCodeCompletion : public KTextEditor::CodeCompletionTestModel,
public KTextEditor::CodeCompletionModelControllerInterface
* {
* Q_OBJECT
* Q_INTERFACES(KTextEditor::CodeCompletionModelControllerInterface)
* public:
* KTextEditor::Range completionRange(KTextEditor::View* view, const KTextEditor::Cursor &position);
* };
* \endcode
*
* \see CodeCompletionModel
* \author Niko Sams \<niko.sams@gmail.com\>
* \since 4.2
*/
-class KTEXTEDITOR_EXPORT_DEPRECATED CodeCompletionModelControllerInterface
+class KTEXTEDITOR_DEPRECATED CodeCompletionModelControllerInterface
{
public:
CodeCompletionModelControllerInterface();
virtual ~CodeCompletionModelControllerInterface();
/**
* This function decides if the automatic completion should be started when
* the user entered some text.
*
* The default implementation will return true if the last character in
* \p insertedText is a letter, a number, '.', '_' or '\>'
*
* \param view The view to generate completions for
* \param insertedText The text that was inserted by the user
* \param userInsertion Whether the the text was inserted by the user using typing.
* If false, it may have been inserted for example by code-completion.
* \param position Current cursor position
* \return \e true, if the completion should be started, otherwise \e false
*/
virtual bool shouldStartCompletion(View* view, const QString &insertedText, bool userInsertion, const Cursor &position);
/**
* This function returns the completion range that will be used for the
* current completion.
*
* This range will be used for filtering the completion list and will get
* replaced when executing the completion
*
* The default implementation will work for most languages that don't have
* special chars in identifiers.
*
* \param view The view to generate completions for
* \param position Current cursor position
* \return the completion range
*/
virtual Range completionRange(View* view, const Cursor &position);
/**
* This function lets the CompletionModel dynamically modify the range.
* Called after every change to the range (eg. when user entered text)
*
* The default implementation does nothing.
*
* The smart-mutex is not locked when this is called.
* @warning Make sure you lock it before you change the range
*
* \param view The view to generate completions for
* \param range Reference to the current range
*/
virtual void updateCompletionRange(View* view, SmartRange& range);
/**
* This function returns the filter-text used for the current completion.
* Can return an empty string to disable filtering.
*
* The default implementation will return the text from \p range start to
* the cursor \p position.
*
* The smart-mutex is not locked when this is called.
*
* \param view The view to generate completions for
* \param range The completion range
* \param position Current cursor position
* \return the string used for filtering the completion list
*/
virtual QString filterString(View* view, const SmartRange& range, const Cursor &position);
/**
* This function decides if the completion should be aborted.
* Called after every change to the range (eg. when user entered text)
*
* The default implementation will return true when any special character was entered, or when the range is empty.
*
* The smart-mutex is not locked when this is called.
*
* \param view The view to generate completions for
* \param range The completion range
* \param currentCompletion The text typed so far
* \return \e true, if the completion should be aborted, otherwise \e false
*/
virtual bool shouldAbortCompletion(View* view, const SmartRange& range, const QString ¤tCompletion);
/**
* When an item within this model is currently selected in the completion-list, and the user inserted the given character,
* should the completion-item be executed? This can be used to execute items from other inputs than the return-key.
* For example a function item could be executed by typing '(', or variable items by typing '.'.
* \param selected The currently selected index
* \param inserted The character that was inserted by tue user
*/
virtual bool shouldExecute(const QModelIndex& selected, QChar inserted);
/**
* Notification that completion for this model has been aborted.
* \param view The view in which the completion for this model was aborted
*/
virtual void aborted(View* view);
};
///Extension of CodeCompletionModelControllerInterface
-class KTEXTEDITOR_EXPORT_DEPRECATED CodeCompletionModelControllerInterface2 : public CodeCompletionModelControllerInterface {
+class KTEXTEDITOR_DEPRECATED CodeCompletionModelControllerInterface2 : public CodeCompletionModelControllerInterface {
public:
enum MatchReaction {
None,
HideListIfAutomaticInvocation /** If this is returned, the completion-list is hidden if it was invoked automatically */
};
/**
* Called whenever an item in the completion-list perfectly matches the current filter text.
* \param The index that is matched
* \return Whether the completion-list should be hidden on this event. The default-implementation always returns HideListIfAutomaticInvocation
*/
virtual MatchReaction matchingItem(const QModelIndex& matched);
};
//BEGIN V3
/**
* \short Controller interface for a CodeCompletionModel
*
* \ingroup kte_group_ccmodel_extensions
*
* The CodeCompletionModelControllerInterface3 gives an CodeCompletionModel better
* control over the completion.
*
* By implementing methods defined in this interface you can:
* - control when automatic completion should start (shouldStartCompletion())
* - define a custom completion range (that will be replaced when the completion
* is executed) (completionRange())
* - dynamically modify the completion range during completion (updateCompletionRange())
* - specify the string used for filtering the completion (filterString())
* - control when completion should stop (shouldAbortCompletion())
*
* When the interface is not implemented, or no methods are overridden the
* default behaviour is used, which will be correct in many situations.
*
*
* \section markext_access Implemeting the Interface
* To use this class implement it in your CodeCompletionModel.
*
* \code
* class MyCodeCompletion : public KTextEditor::CodeCompletionTestModel,
public KTextEditor::CodeCompletionModelControllerInterface3
* {
* Q_OBJECT
* Q_INTERFACES(KTextEditor::CodeCompletionModelControllerInterface3)
* public:
* KTextEditor::Range completionRange(KTextEditor::View* view, const KTextEditor::Cursor &position);
* };
* \endcode
*
* \see CodeCompletionModel
* \author Niko Sams \<niko.sams@gmail.com\>
* \author Joseph Wenninger
* \since 4.5
*/
class KTEXTEDITOR_EXPORT CodeCompletionModelControllerInterface3
{
public:
CodeCompletionModelControllerInterface3();
virtual ~CodeCompletionModelControllerInterface3();
/**
* This function decides if the automatic completion should be started when
* the user entered some text.
*
* The default implementation will return true if the last character in
* \p insertedText is a letter, a number, '.', '_' or '\>'
*
* \param view The view to generate completions for
* \param insertedText The text that was inserted by the user
* \param userInsertion Whether the the text was inserted by the user using typing.
* If false, it may have been inserted for example by code-completion.
* \param position Current cursor position
* \return \e true, if the completion should be started, otherwise \e false
*/
virtual bool shouldStartCompletion(View* view, const QString &insertedText, bool userInsertion, const Cursor &position);
/**
* This function returns the completion range that will be used for the
* current completion.
*
* This range will be used for filtering the completion list and will get
* replaced when executing the completion
*
* The default implementation will work for most languages that don't have
* special chars in identifiers.
*
* \param view The view to generate completions for
* \param position Current cursor position
* \return the completion range
*/
virtual Range completionRange(View* view, const Cursor &position);
/**
* This function lets the CompletionModel dynamically modify the range.
* Called after every change to the range (eg. when user entered text)
*
* The default implementation does nothing.
*
* The smart-mutex is not locked when this is called.
* @warning Make sure you lock it before you change the range
*
* \param view The view to generate completions for
* \param range Reference to the current range
* \returns the modified range
*/
virtual Range updateCompletionRange(View* view, const Range& range);
/**
* This function returns the filter-text used for the current completion.
* Can return an empty string to disable filtering.
*
* The default implementation will return the text from \p range start to
* the cursor \p position.
*
* The smart-mutex is not locked when this is called.
*
* \param view The view to generate completions for
* \param range The completion range
* \param position Current cursor position
* \return the string used for filtering the completion list
*/
virtual QString filterString(View* view, const Range& range, const Cursor &position);
/**
* This function decides if the completion should be aborted.
* Called after every change to the range (eg. when user entered text)
*
* The default implementation will return true when any special character was entered, or when the range is empty.
*
* The smart-mutex is not locked when this is called.
*
* \param view The view to generate completions for
* \param range The completion range
* \param currentCompletion The text typed so far
* \return \e true, if the completion should be aborted, otherwise \e false
*/
virtual bool shouldAbortCompletion(View* view, const Range& range, const QString ¤tCompletion);
/**
* When an item within this model is currently selected in the completion-list, and the user inserted the given character,
* should the completion-item be executed? This can be used to execute items from other inputs than the return-key.
* For example a function item could be executed by typing '(', or variable items by typing '.'.
* \param selected The currently selected index
* \param inserted The character that was inserted by tue user
*/
virtual bool shouldExecute(const QModelIndex& selected, QChar inserted);
/**
* Notification that completion for this model has been aborted.
* \param view The view in which the completion for this model was aborted
*/
virtual void aborted(View* view);
public:
enum MatchReaction {
None=0,
HideListIfAutomaticInvocation=1, /** If this is returned, the completion-list is hidden if it was invoked automatically */
ForExtension=0xffff
};
/**
* Called whenever an item in the completion-list perfectly matches the current filter text.
* \param The index that is matched
* \return Whether the completion-list should be hidden on this event. The default-implementation always returns HideListIfAutomaticInvocation
*/
virtual MatchReaction matchingItem(const QModelIndex& matched);
};
//END V3
}
Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface, "org.kde.KTextEditor.CodeCompletionModelControllerInterface")
Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface2, "org.kde.KTextEditor.CodeCompletionModelControllerInterface2")
Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface3, "org.kde.KTextEditor.CodeCompletionModelControllerInterface3")
#endif // KDELIBS_KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
diff --git a/interfaces/ktexteditor/plugin.h b/interfaces/ktexteditor/plugin.h
index 38540ae3d6..94c83d346a 100644
--- a/interfaces/ktexteditor/plugin.h
+++ b/interfaces/ktexteditor/plugin.h
@@ -1,213 +1,213 @@
/* This file is part of the KDE libraries
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
Copyright (C) 2005 Dominik Haumann (dhdev@gmx.de) (documentation)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDELIBS_KTEXTEDITOR_PLUGIN_H
#define KDELIBS_KTEXTEDITOR_PLUGIN_H
#include <QtCore/QObject>
#include <ktexteditor/ktexteditor_export.h>
#include <kservice.h>
class KConfig;
namespace KTextEditor
{
class Document;
class View;
/**
* \brief KTextEditor Plugin interface.
*
* Topics:
* - \ref plugin_intro
* - \ref plugin_config
* - \ref plugin_sessions
* - \ref plugin_arch
*
* \section plugin_intro Introduction
*
* The Plugin class provides methods to create loadable plugins for all
* KTextEditor implementations. A plugin can handle several documents and
* views. For every document the plugin should handle addDocument() is called
* and for every view addView().
*
* \section plugin_config Configuration Management
*
* @todo write docu about config pages (new with kpluginmanager)
* @todo write docu about save/load settings (related to config page)
*
* \section plugin_sessions Session Management
*
* As an extension a Plugin can implement the SessionConfigInterface. This
* interface provides functions to read and write session related settings.
* If you have session dependent data additionally derive your Plugin from
* this interface and implement the session related functions, for example:
* \code
* class MyPlugin : public KTextEditor::Plugin,
* public KTextEditor::SessionConfigInterface
* {
* Q_OBJECT
* Q_INTERFACES(KTextEditor::SessionConfigInterface)
*
* // ...
* virtual void readSessionConfig (const KConfigGroup& config);
* virtual void writeSessionConfig (KConfigGroup& config);
* };
* \endcode
*
* \section plugin_arch Plugin Architecture
*
* After the plugin is loaded the editor implementation should call
* addDocument() and addView() for all documents and views the plugin should
* handle. If your plugin has a GUI it is common to add an extra class, like:
* \code
* class PluginView : public QObject, public KXMLGUIClient
* {
* Q_OBJECT
* public:
* // Constructor and other methods
* PluginView( KTextEditor::View* view )
* : QObject( view ), KXMLGUIClient( view ), m_view( view )
* { ... }
* // ...
* private:
* KTextEditor::View* m_view;
* };
* \endcode
* Your KTextEditor::Plugin derived class then will create a new PluginView
* for every View, i.e. for every call of addView().
*
* The method removeView() will be called whenever a View is removed/closed.
* If you have a PluginView for every view this is the place to remove it.
*
* \see KTextEditor::Editor, KTextEditor::Document, KTextEditor::View,
* KTextEditor::SessionConfigInterface
* \author Christoph Cullmann \<cullmann@kde.org\>
*/
class KTEXTEDITOR_EXPORT Plugin : public QObject
{
Q_OBJECT
public:
/**
* Constructor.
*
* Create a new plugin.
* \param parent parent object
*/
Plugin ( QObject *parent );
/**
* Virtual destructor.
*/
virtual ~Plugin ();
/*
* Following methodes allow the plugin to react on view and document
* creation.
*/
public:
/**
* Add a new \p document to the plugin.
* This method is called whenever the plugin should handle another
* \p document.
*
* For every call of addDocument() will finally follow a call of
* removeDocument(), i.e. the number of calls are identic.
*
* \param document new document to handle
* \see removeDocument(), addView()
*/
virtual void addDocument (Document *document) { Q_UNUSED(document); }
/**
* Remove the \p document from the plugin.
* This method is called whenever the plugin should stop handling
* the \p document.
*
* For every call of addDocument() will finally follow a call of
* removeDocument(), i.e. the number of calls are identic.
*
* \param document document to hang the gui out from
* \see addDocument(), removeView()
*/
virtual void removeDocument (Document *document) { Q_UNUSED(document); }
/**
* This method is called whenever the plugin should add its GUI to
* \p view.
* The process for the Editor can be roughly described as follows:
* - add documents the plugin should handle via addDocument()
* - for every document \e doc call addView() for \e every view for
* \e doc.
*
* For every call of addView() will finally follow a call of
* removeView(), i.e. the number of calls are identic.
*
* \note As addView() is called for \e every view in which the plugin's
* GUI should be visible you must \e not add the GUI by
* iterating over all Document::views() yourself neither use the
* signal Document::viewCreated().
*
* \param view view to hang the gui in
* \see removeView(), addDocument()
*/
virtual void addView (View *view) { Q_UNUSED(view); }
/**
* This method is called whenever the plugin should remove its GUI from
* \p view.
*
* For every call of addView() will finally follow a call of
* removeView(), i.e. the number of calls are identic.
*
* \param view view to hang the gui out from
* \see addView(), removeDocument()
*/
virtual void removeView (View *view) { Q_UNUSED(view); }
private:
class PluginPrivate* const d;
};
/**
* Create a plugin represented by \p service with parent object \p parent.
* To get the KService object you usually use KServiceTypeTrader. Example
* \code
* KService::List list = KServiceTypeTrader::self()->query("KTextEditor/Plugin");
*
* foreach(const KService::Ptr &service, list) {
* // do something with service
* }
* \endcode
* \return the plugin or NULL if it could not be loaded
*/
#ifndef KDE_NO_DEPRECATED
-KTEXTEDITOR_EXPORT_DEPRECATED Plugin *createPlugin ( KService::Ptr service, QObject *parent );
+KTEXTEDITOR_DEPRECATED Plugin *createPlugin ( KService::Ptr service, QObject *parent );
#endif
}
#endif
// kate: space-indent on; indent-width 2; replace-tabs on;
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Nov 1, 9:25 AM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10075821
Default Alt Text
(25 KB)
Attached To
Mode
rKL kdelibs
Attached
Detach File
Event Timeline
Log In to Comment