• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

katecodecompletion.h
00001 /* This file is part of the KDE libraries
00002 
00003    Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
00004    Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
00005    Copyright (C) 2001 by Victor Röder <Victor_Roeder@GMX.de>
00006    Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
00007 
00008    This library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public
00010    License version 2 as published by the Free Software Foundation.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 /******** Partly based on the ArgHintWidget of Qt3 by Trolltech AS *********/
00024 /* Trolltech doesn't mind, if we license that piece of code as LGPL, because there isn't much
00025  * left from the desigener code */
00026 
00027 
00028 #ifndef __KateCodeCompletion_H__
00029 #define __KateCodeCompletion_H__
00030 
00031 #include <tdetexteditor/codecompletioninterface.h>
00032 
00033 #include <tqvaluelist.h>
00034 #include <tqstringlist.h>
00035 #include <tqlabel.h>
00036 #include <tqframe.h>
00037 #include <tqmap.h>
00038 #include <tqintdict.h>
00039 
00040 class KateView;
00041 class KateArgHint;
00042 class KateCCListBox;
00043 
00044 class TQLayout;
00045 class TQVBox;
00046 
00047 class KateCodeCompletionCommentLabel : public TQLabel
00048 {
00049   Q_OBJECT
00050 
00051   public:
00052     KateCodeCompletionCommentLabel( TQWidget* parent, const TQString& text) : TQLabel( parent, "toolTipTip",
00053              (WFlags)(WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM) )
00054     {
00055         setMargin(1);
00056         setIndent(0);
00057         setAutoMask( false );
00058         setFrameStyle( TQFrame::Plain | TQFrame::Box );
00059         setLineWidth( 1 );
00060         setAlignment( AlignAuto | AlignTop );
00061         polish();
00062         setText(text);
00063         adjustSize();
00064     }
00065 };
00066 
00067 class KateCodeCompletion : public TQObject
00068 {
00069   Q_OBJECT
00070 
00071   friend class KateViewInternal;
00072 
00073   public:
00074     KateCodeCompletion(KateView *view);
00075     ~KateCodeCompletion();
00076 
00077     bool codeCompletionVisible ();
00078 
00079     void showArgHint(
00080         TQStringList functionList, const TQString& strWrapping, const TQString& strDelimiter );
00081     void showCompletionBox(
00082         TQValueList<KTextEditor::CompletionEntry> entries, int offset = 0, bool casesensitive = true );
00083     bool eventFilter( TQObject* o, TQEvent* e );
00084 
00085     void handleKey (TQKeyEvent *e);
00086 
00087   public slots:
00088     void slotCursorPosChanged();
00089     void showComment();
00090     void updateBox () { updateBox(false); }
00091 
00092   signals:
00093     void completionAborted();
00094     void completionDone();
00095     void argHintHidden();
00096     void completionDone(KTextEditor::CompletionEntry);
00097     void filterInsertString(KTextEditor::CompletionEntry*,TQString *);
00098 
00099   private:
00100     void doComplete();
00101     void abortCompletion();
00102     void complete( KTextEditor::CompletionEntry );
00103     void updateBox( bool newCoordinate );
00104 
00105     KateArgHint*    m_pArgHint;
00106     KateView*       m_view;
00107     TQVBox*          m_completionPopup;
00108     KateCCListBox*       m_completionListBox;
00109     TQValueList<KTextEditor::CompletionEntry> m_complList;
00110     uint            m_lineCursor;
00111     uint            m_colCursor;
00112     int             m_offset;
00113     bool            m_caseSensitive;
00114     KateCodeCompletionCommentLabel* m_commentLabel;
00115 };
00116 
00117 class KateArgHint: public TQFrame
00118 {
00119   Q_OBJECT
00120 
00121   public:
00122       KateArgHint( KateView* =0, const char* =0 );
00123       virtual ~KateArgHint();
00124 
00125       virtual void setCurrentFunction( int );
00126       virtual int currentFunction() const { return m_currentFunction; }
00127 
00128       void setArgMarkInfos( const TQString&, const TQString& );
00129 
00130       virtual void addFunction( int, const TQString& );
00131       TQString functionAt( int id ) const { return m_functionMap[ id ]; }
00132 
00133       virtual void show();
00134       virtual void adjustSize();
00135       virtual bool eventFilter( TQObject*, TQEvent* );
00136 
00137   signals:
00138       void argHintHidden();
00139       void argHintCompleted();
00140       void argHintAborted();
00141 
00142   public slots:
00143       virtual void reset( int, int );
00144       virtual void cursorPositionChanged( KateView*, int, int );
00145 
00146   private slots:
00147       void slotDone(bool completed);
00148 
00149   private:
00150       TQMap<int, TQString> m_functionMap;
00151       int m_currentFunction;
00152       TQString m_wrapping;
00153       TQString m_delimiter;
00154       bool m_markCurrentFunction;
00155       int m_currentLine;
00156       int m_currentCol;
00157       KateView* editorView;
00158       TQIntDict<TQLabel> labelDict;
00159       TQLayout* layout;
00160 };
00161 
00162 #endif
00163 
00164 // kate: space-indent on; indent-width 2; replace-tabs on;

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.