LCOV - code coverage report
Current view: top level - basctl/source/basicide - baside2.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 32 0.0 %
Date: 2014-04-14 Functions: 0 36 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef BASCTL_BASIDE2_HXX
      21             : #define BASCTL_BASIDE2_HXX
      22             : 
      23             : #include "layout.hxx"
      24             : #include "bastypes.hxx"
      25             : #include "bastype3.hxx"
      26             : #include "basidesh.hxx"
      27             : #include "breakpoint.hxx"
      28             : #include "linenumberwindow.hxx"
      29             : 
      30             : #include <svheader.hxx>
      31             : 
      32             : class ExtTextEngine;
      33             : class ExtTextView;
      34             : class SvxSearchItem;
      35             : #include <svtools/svtabbx.hxx>
      36             : #include <svtools/headbar.hxx>
      37             : 
      38             : #include <vcl/button.hxx>
      39             : #include <basic/sbstar.hxx>
      40             : #include <basic/sbmod.hxx>
      41             : #include <vcl/split.hxx>
      42             : #include <svl/lstner.hxx>
      43             : #include <svtools/colorcfg.hxx>
      44             : #include <vcl/lstbox.hxx>
      45             : #include <vcl/scrbar.hxx>
      46             : 
      47             : #include <sfx2/progress.hxx>
      48             : #include <unotools/options.hxx>
      49             : #include <rtl/ref.hxx>
      50             : 
      51             : #include <set>
      52             : #include <boost/scoped_ptr.hpp>
      53             : 
      54             : #include <vcl/textdata.hxx>
      55             : #include <basic/codecompletecache.hxx>
      56             : #include <com/sun/star/reflection/XIdlClass.hpp>
      57             : #include <comphelper/namedvaluecollection.hxx>
      58             : #include <comphelper/processfactory.hxx>
      59             : #include <comphelper/syntaxhighlight.hxx>
      60             : #include <comphelper/configurationhelper.hxx>
      61             : #include <com/sun/star/reflection/XIdlReflection.hpp>
      62             : 
      63             : namespace com { namespace sun { namespace star { namespace beans {
      64             :     class XMultiPropertySet;
      65             : } } } }
      66             : 
      67             : namespace basctl
      68             : {
      69             : 
      70             : class ObjectCatalog;
      71             : class CodeCompleteListBox;
      72             : class CodeCompleteWindow;
      73             : 
      74             : // #108672 Helper functions to get/set text in TextEngine
      75             : // using the stream interface (get/setText() only supports
      76             : // tools Strings limited to 64K).
      77             : // defined in baside2b.cxx
      78             : OUString getTextEngineText (ExtTextEngine&);
      79             : void setTextEngineText (ExtTextEngine&, OUString const&);
      80             : 
      81             : class EditorWindow : public Window, public SfxListener
      82             : {
      83             : friend class CodeCompleteListBox;
      84             : private:
      85             :     class ChangesListener;
      86             : 
      87             :     boost::scoped_ptr<ExtTextView> pEditView;
      88             :     boost::scoped_ptr<ExtTextEngine> pEditEngine;
      89             :     ModulWindow&    rModulWindow;
      90             : 
      91             :     rtl::Reference< ChangesListener > listener_;
      92             :     osl::Mutex mutex_;
      93             :     com::sun::star::uno::Reference< com::sun::star::beans::XMultiPropertySet >
      94             :         notifier_;
      95             : 
      96             :     long            nCurTextWidth;
      97             : 
      98             :     SyntaxHighlighter   aHighlighter;
      99             :     Timer           aSyntaxIdleTimer;
     100             :     typedef std::set<sal_uInt16> SyntaxLineSet;
     101             :     SyntaxLineSet   aSyntaxLineTable;
     102             :     DECL_LINK(SyntaxTimerHdl, void *);
     103             : 
     104             :     // progress bar
     105             :     class ProgressInfo;
     106             :     boost::scoped_ptr<ProgressInfo> pProgress;
     107             : 
     108             :     virtual void DataChanged(DataChangedEvent const & rDCEvt) SAL_OVERRIDE;
     109             : 
     110             :     using           Window::Notify;
     111             :     virtual void    Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     112             : 
     113             :     void            ImpDoHighlight( sal_uLong nLineOff );
     114             :     void            ImplSetFont();
     115             : 
     116             :     bool            bHighlightning;
     117             :     bool            bDoSyntaxHighlight;
     118             :     bool            bDelayHighlight;
     119             : 
     120             :     virtual
     121             :     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
     122             :     GetComponentInterface(sal_Bool bCreate = true) SAL_OVERRIDE;
     123             :     CodeCompleteDataCache aCodeCompleteCache;
     124             :     boost::scoped_ptr< CodeCompleteWindow > pCodeCompleteWnd;
     125             :     OUString GetActualSubName( sal_uLong nLine ); // gets the actual subroutine name according to line number
     126             :     void SetupAndShowCodeCompleteWnd(const std::vector< OUString >& aEntryVect, TextSelection aSel );
     127             :     void HandleAutoCorrect();
     128             :     void HandleAutoCloseParen();
     129             :     void HandleAutoCloseDoubleQuotes();
     130             :     void HandleCodeCompletion();
     131             :     void HandleProcedureCompletion();
     132             :     TextSelection GetLastHighlightPortionTextSelection();
     133             : 
     134             : protected:
     135             :     virtual void    Paint( const Rectangle& ) SAL_OVERRIDE;
     136             :     virtual void    Resize() SAL_OVERRIDE;
     137             :     virtual void    KeyInput( const KeyEvent& rKeyEvt ) SAL_OVERRIDE;
     138             :     virtual void    MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
     139             :     virtual void    MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
     140             :     virtual void    MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
     141             :     virtual void    Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
     142             :     virtual void    LoseFocus() SAL_OVERRIDE;
     143             :     virtual void    RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
     144             : 
     145             :     void            DoSyntaxHighlight( sal_uLong nPara );
     146             :     OUString        GetWordAtCursor();
     147             :     bool            ImpCanModify();
     148             : 
     149             : public:
     150             :                     EditorWindow (Window* pParent, ModulWindow*);
     151             :                     virtual ~EditorWindow();
     152             : 
     153           0 :     ExtTextEngine*  GetEditEngine() const   { return pEditEngine.get(); }
     154           0 :     ExtTextView*    GetEditView() const     { return pEditView.get(); }
     155             : 
     156             :     void            CreateProgress( const OUString& rText, sal_uLong nRange );
     157             :     void            DestroyProgress();
     158             : 
     159             :     void            ParagraphInsertedDeleted( sal_uLong nNewPara, bool bInserted );
     160             :     void            DoDelayedSyntaxHighlight( sal_uLong nPara );
     161             : 
     162             :     void            CreateEditEngine();
     163             :     void            SetScrollBarRanges();
     164             :     void            InitScrollBars();
     165             : 
     166             :     void            ForceSyntaxTimeout();
     167             :     bool            SetSourceInBasic();
     168             : 
     169           0 :     bool            CanModify() { return ImpCanModify(); }
     170             : 
     171             :     void            UpdateSyntaxHighlighting ();
     172             : };
     173             : 
     174             : 
     175             : class BreakPointWindow : public Window
     176             : {
     177             : private:
     178             :     ModulWindow&    rModulWindow;
     179             :     long            nCurYOffset;
     180             :     sal_uInt16      nMarkerPos;
     181             :     BreakPointList  aBreakPointList;
     182             :     bool            bErrorMarker;
     183             : 
     184             :     virtual void DataChanged(DataChangedEvent const & rDCEvt) SAL_OVERRIDE;
     185             : 
     186             :     void setBackgroundColor(Color aColor);
     187             : 
     188             : protected:
     189             :     virtual void    Paint( const Rectangle& ) SAL_OVERRIDE;
     190             :     BreakPoint*     FindBreakPoint( const Point& rMousePos );
     191             :     void            ShowMarker( bool bShow );
     192             :     virtual void    MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
     193             :     virtual void    Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
     194             : 
     195             :     bool            SyncYOffset();
     196             : 
     197             : public:
     198             :                     BreakPointWindow (Window* pParent, ModulWindow*);
     199             :                     virtual ~BreakPointWindow();
     200             : 
     201             :     void            SetMarkerPos( sal_uInt16 nLine, bool bErrorMarker = false );
     202             :     void            SetNoMarker ();
     203             : 
     204             :     void            DoScroll( long nHorzScroll, long nVertScroll );
     205           0 :     long&           GetCurYOffset()         { return nCurYOffset; }
     206           0 :     BreakPointList& GetBreakPoints()        { return aBreakPointList; }
     207             : };
     208             : 
     209             : 
     210             : class WatchTreeListBox : public SvHeaderTabListBox
     211             : {
     212             :     OUString aEditingRes;
     213             : 
     214             : protected:
     215             :     virtual bool    EditingEntry( SvTreeListEntry* pEntry, Selection& rSel  ) SAL_OVERRIDE;
     216             :     virtual bool    EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText ) SAL_OVERRIDE;
     217             : 
     218             :     bool            ImplBasicEntryEdited( SvTreeListEntry* pEntry, const OUString& rResult );
     219             :     SbxBase*        ImplGetSBXForEntry( SvTreeListEntry* pEntry, bool& rbArrayElement );
     220             : 
     221             : public:
     222             :     WatchTreeListBox( Window* pParent, WinBits nWinBits );
     223             :     virtual ~WatchTreeListBox();
     224             : 
     225             :     void            RequestingChildren( SvTreeListEntry * pParent ) SAL_OVERRIDE;
     226             :     void            UpdateWatches( bool bBasicStopped = false );
     227             : 
     228             :     using           SvTabListBox::SetTabs;
     229             :     virtual void    SetTabs() SAL_OVERRIDE;
     230             : };
     231             : 
     232             : 
     233             : 
     234             : class WatchWindow : public DockingWindow
     235             : {
     236             : private:
     237             :     OUString            aWatchStr;
     238             :     ExtendedEdit        aXEdit;
     239             :     ImageButton         aRemoveWatchButton;
     240             :     WatchTreeListBox    aTreeListBox;
     241             :     HeaderBar           aHeaderBar;
     242             : 
     243             : protected:
     244             :     virtual void    Resize() SAL_OVERRIDE;
     245             :     virtual void    Paint( const Rectangle& rRect ) SAL_OVERRIDE;
     246             : 
     247             :     DECL_LINK( ButtonHdl, ImageButton * );
     248             :     DECL_LINK(TreeListHdl, void *);
     249             :     DECL_LINK( implEndDragHdl, HeaderBar * );
     250             :     DECL_LINK( EditAccHdl, Accelerator * );
     251             : 
     252             : 
     253             : public:
     254             :                     WatchWindow (Layout* pParent);
     255             :                     virtual ~WatchWindow();
     256             : 
     257             :     void            AddWatch( const OUString& rVName );
     258             :     bool            RemoveSelectedWatch();
     259             :     void            UpdateWatches( bool bBasicStopped = false );
     260             : 
     261             :     WatchTreeListBox&   GetWatchTreeListBox() { return aTreeListBox; }
     262             : };
     263             : 
     264             : 
     265             : class StackWindow : public DockingWindow
     266             : {
     267             : private:
     268             :     SvTreeListBox   aTreeListBox;
     269             :     OUString        aStackStr;
     270             : 
     271             : protected:
     272             :     virtual void    Resize() SAL_OVERRIDE;
     273             :     virtual void    Paint( const Rectangle& rRect ) SAL_OVERRIDE;
     274             : 
     275             : public:
     276             :                     StackWindow (Layout* pParent);
     277             :                     virtual ~StackWindow();
     278             : 
     279             :     void            UpdateCalls();
     280             : };
     281             : 
     282             : 
     283           0 : class ComplexEditorWindow : public Window
     284             : {
     285             : private:
     286             :     BreakPointWindow    aBrkWindow;
     287             :     LineNumberWindow    aLineNumberWindow;
     288             :     EditorWindow        aEdtWindow;
     289             :     ScrollBar           aEWVScrollBar;
     290             : 
     291             :     virtual void DataChanged(DataChangedEvent const & rDCEvt) SAL_OVERRIDE;
     292             : 
     293             : protected:
     294             :     virtual void        Resize() SAL_OVERRIDE;
     295             :     DECL_LINK( ScrollHdl, ScrollBar * );
     296             : 
     297             : public:
     298             :                         ComplexEditorWindow( ModulWindow* pParent );
     299             : 
     300           0 :     BreakPointWindow&   GetBrkWindow()      { return aBrkWindow; }
     301           0 :     LineNumberWindow&   GetLineNumberWindow() { return aLineNumberWindow; }
     302           0 :     EditorWindow&       GetEdtWindow()      { return aEdtWindow; }
     303           0 :     ScrollBar&          GetEWVScrollBar()   { return aEWVScrollBar; }
     304             : 
     305             :     void SetLineNumberDisplay(bool b);
     306             : };
     307             : 
     308             : 
     309             : class ModulWindow: public BaseWindow
     310             : {
     311             : private:
     312             :     ModulWindowLayout&  rLayout;
     313             :     StarBASICRef        xBasic;
     314             :     short               nValid;
     315             :     ComplexEditorWindow aXEditorWindow;
     316             :     BasicStatus         aStatus;
     317             :     SbModuleRef         xModule;
     318             :     OUString            aCurPath;
     319             :     OUString            m_aModule;
     320             : 
     321             :     void                CheckCompileBasic();
     322             :     bool                BasicExecute();
     323             : 
     324             :     void                GoOnTop();
     325             : 
     326             :     sal_Int32           FormatAndPrint( Printer* pPrinter, sal_Int32 nPage = -1 );
     327             :     SbModuleRef         XModule();
     328             : protected:
     329             :     virtual void    Resize() SAL_OVERRIDE;
     330             :     virtual void    GetFocus() SAL_OVERRIDE;
     331             :     virtual void    Paint( const Rectangle& ) SAL_OVERRIDE;
     332             :     virtual void    DoInit() SAL_OVERRIDE;
     333             :     virtual void    DoScroll( ScrollBar* pCurScrollBar ) SAL_OVERRIDE;
     334             : 
     335             : public:
     336             :                     TYPEINFO_OVERRIDE();
     337             : 
     338             :     ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName, OUString& aModule );
     339             : 
     340             :                     virtual ~ModulWindow();
     341             : 
     342             :     virtual void    ExecuteCommand (SfxRequest& rReq) SAL_OVERRIDE;
     343             :     virtual void    ExecuteGlobal (SfxRequest& rReq) SAL_OVERRIDE;
     344             :     virtual void    GetState( SfxItemSet& ) SAL_OVERRIDE;
     345             :     virtual void    StoreData() SAL_OVERRIDE;
     346             :     virtual void    UpdateData() SAL_OVERRIDE;
     347             :     virtual bool    CanClose() SAL_OVERRIDE;
     348             :     // return number of pages to be printed
     349             :     virtual sal_Int32 countPages( Printer* pPrinter ) SAL_OVERRIDE;
     350             :     // print page
     351             :     virtual void printPage( sal_Int32 nPage, Printer* pPrinter ) SAL_OVERRIDE;
     352             :     virtual OUString  GetTitle() SAL_OVERRIDE;
     353             :     virtual EntryDescriptor CreateEntryDescriptor() SAL_OVERRIDE;
     354             :     virtual bool    AllowUndo() SAL_OVERRIDE;
     355             :     virtual void    SetReadOnly (bool bReadOnly) SAL_OVERRIDE;
     356             :     virtual bool    IsReadOnly() SAL_OVERRIDE;
     357             : 
     358           0 :     StarBASIC*      GetBasic() { XModule(); return xBasic; }
     359             : 
     360           0 :     SbModule*       GetSbModule() { return xModule; }
     361           0 :     void            SetSbModule( SbModule* pModule ) { xModule = pModule; }
     362             :     OUString        GetSbModuleName();
     363             : 
     364             :     bool            CompileBasic();
     365             :     bool            BasicRun();
     366             :     bool            BasicStepOver();
     367             :     bool            BasicStepInto();
     368             :     bool            BasicStepOut();
     369             :     void            BasicStop();
     370             :     bool            BasicToggleBreakPoint();
     371             :     void            BasicToggleBreakPointEnabled();
     372             :     void            ManageBreakPoints();
     373             :     void            UpdateBreakPoint( const BreakPoint& rBrk );
     374             :     void            BasicAddWatch();
     375             :     void            BasicRemoveWatch();
     376             : 
     377             :     bool            BasicErrorHdl( StarBASIC* pBasic );
     378             :     long            BasicBreakHdl( StarBASIC* pBasic );
     379             :     void            AssertValidEditEngine();
     380             : 
     381             :     bool            LoadBasic();
     382             :     bool            SaveBasicSource();
     383             :     bool            ImportDialog();
     384             : 
     385             :     void            EditMacro( const OUString& rMacroName );
     386             : 
     387             :     bool            ToggleBreakPoint( sal_uLong nLine );
     388             : 
     389           0 :     BasicStatus&    GetBasicStatus() { return aStatus; }
     390             : 
     391             :     virtual bool    IsModified () SAL_OVERRIDE;
     392             :     virtual bool    IsPasteAllowed () SAL_OVERRIDE;
     393             : 
     394             :     void            FrameWindowMoved();
     395             :     void            ShowCursor( bool bOn );
     396             : 
     397             :     virtual sal_uInt16  GetSearchOptions() SAL_OVERRIDE;
     398             :     virtual sal_uInt16  StartSearchAndReplace (SvxSearchItem const&, bool bFromStart = false) SAL_OVERRIDE;
     399             : 
     400           0 :     EditorWindow&       GetEditorWindow()       { return aXEditorWindow.GetEdtWindow(); }
     401           0 :     BreakPointWindow&   GetBreakPointWindow()   { return aXEditorWindow.GetBrkWindow(); }
     402           0 :     LineNumberWindow&   GetLineNumberWindow()   { return aXEditorWindow.GetLineNumberWindow(); }
     403           0 :     ScrollBar&          GetEditVScrollBar()     { return aXEditorWindow.GetEWVScrollBar(); }
     404           0 :     ExtTextEngine*      GetEditEngine()         { return GetEditorWindow().GetEditEngine(); }
     405           0 :     ExtTextView*        GetEditView()           { return GetEditorWindow().GetEditView(); }
     406           0 :     BreakPointList&     GetBreakPoints()        { return GetBreakPointWindow().GetBreakPoints(); }
     407           0 :     ModulWindowLayout&  GetLayout ()            { return rLayout; }
     408             : 
     409             :     virtual void        BasicStarted() SAL_OVERRIDE;
     410             :     virtual void        BasicStopped() SAL_OVERRIDE;
     411             : 
     412             :     virtual ::svl::IUndoManager*
     413             :                         GetUndoManager() SAL_OVERRIDE;
     414             : 
     415           0 :     const OUString&         GetModule() const { return m_aModule; }
     416           0 :     void                    SetModule( const OUString& aModule ) { m_aModule = aModule; }
     417             : 
     418             :     virtual void Activating () SAL_OVERRIDE;
     419             :     virtual void Deactivating () SAL_OVERRIDE;
     420             : 
     421             :     virtual void OnNewDocument () SAL_OVERRIDE;
     422             :     virtual char const* GetHid () const SAL_OVERRIDE;
     423             :     virtual ItemType GetType () const SAL_OVERRIDE;
     424             :     virtual bool HasActiveEditor () const SAL_OVERRIDE;
     425             : 
     426             :     void UpdateModule ();
     427             : };
     428             : 
     429           0 : class ModulWindowLayout: public Layout
     430             : {
     431             : public:
     432             :     ModulWindowLayout (Window* pParent, ObjectCatalog&);
     433             : public:
     434             :     // Layout:
     435             :     virtual void Activating (BaseWindow&) SAL_OVERRIDE;
     436             :     virtual void Deactivating () SAL_OVERRIDE;
     437             :     virtual void GetState (SfxItemSet&, unsigned nWhich) SAL_OVERRIDE;
     438             :     virtual void UpdateDebug (bool bBasicStopped) SAL_OVERRIDE;
     439             : public:
     440             :     void BasicAddWatch (OUString const&);
     441             :     void BasicRemoveWatch ();
     442           0 :     Color GetSyntaxColor (TokenTypes eType) const { return aSyntaxColors.GetColor(eType); }
     443             : 
     444             : protected:
     445             :     // Window:
     446             :     virtual void Paint (const Rectangle& rRect) SAL_OVERRIDE;
     447             :     // Layout:
     448             :     virtual void OnFirstSize (long nWidth, long nHeight) SAL_OVERRIDE;
     449             : 
     450             : private:
     451             :     // main child window
     452             :     ModulWindow* pChild;
     453             :     // dockable windows
     454             :     WatchWindow aWatchWindow;
     455             :     StackWindow aStackWindow;
     456             :     ObjectCatalog& rObjectCatalog;
     457             : private:
     458             :     virtual void DataChanged (DataChangedEvent const& rDCEvt) SAL_OVERRIDE;
     459             : private:
     460             :     // SyntaxColors -- stores Basic syntax highlighting colors
     461             :     class SyntaxColors : public utl::ConfigurationListener
     462             :     {
     463             :     public:
     464             :         SyntaxColors ();
     465             :         virtual ~SyntaxColors ();
     466             :     public:
     467           0 :         void SetActiveEditor (EditorWindow* pEditor_) { pEditor = pEditor_; }
     468             :         void SettingsChanged ();
     469             :     public:
     470           0 :         Color GetColor (TokenTypes eType) const { return aColors[eType]; }
     471             : 
     472             :     private:
     473             :         virtual void ConfigurationChanged (utl::ConfigurationBroadcaster*, sal_uInt32) SAL_OVERRIDE;
     474             :         void NewConfig (bool bFirst);
     475             : 
     476             :     private:
     477             :         // the color values (the indexes are TokenTypes, see comphelper/syntaxhighlight.hxx)
     478             :         Color aColors[TT_KEYWORDS + 1];
     479             :         // the configuration
     480             :         svtools::ColorConfig aConfig;
     481             :         // the active editor
     482             :         EditorWindow* pEditor;
     483             : 
     484             :     } aSyntaxColors;
     485             : };
     486             : 
     487           0 : class CodeCompleteListBox: public ListBox
     488             : {
     489             : friend class CodeCompleteWindow;
     490             : friend class EditorWindow;
     491             : private:
     492             :     OUStringBuffer aFuncBuffer;
     493             :     /* a buffer to build up function name when typing
     494             :      * a function name, used for showing/hiding listbox values
     495             :      * */
     496             :     CodeCompleteWindow* pCodeCompleteWindow; // parent window
     497             : 
     498             :     void SetMatchingEntries(); // sets the visible entries based on aFuncBuffer variable
     499             :     void HideAndRestoreFocus();
     500             :     ExtTextView* GetParentEditView();
     501             : 
     502             : public:
     503             :     CodeCompleteListBox( CodeCompleteWindow* pPar );
     504             :     void InsertSelectedEntry(); //insert the selected entry
     505             : 
     506             :     DECL_LINK(ImplDoubleClickHdl, void*);
     507             :     DECL_LINK(ImplSelectHdl, void*);
     508             : 
     509             : protected:
     510             :     virtual void KeyInput( const KeyEvent& rKeyEvt ) SAL_OVERRIDE;
     511             : };
     512             : 
     513             : class CodeCompleteWindow: public Window
     514             : {
     515             : friend class CodeCompleteListBox;
     516             : private:
     517             :     EditorWindow* pParent; // parent window
     518             :     TextSelection aTextSelection;
     519             :     CodeCompleteListBox* pListBox;
     520             : 
     521             :     void InitListBox(); // initialize the ListBox
     522             : 
     523             : public:
     524             :     CodeCompleteWindow( EditorWindow* pPar );
     525           0 :     virtual ~CodeCompleteWindow(){ delete pListBox; }
     526             : 
     527             :     void InsertEntry( const OUString& aStr );
     528             :     void ClearListBox();
     529             :     void SetTextSelection( const TextSelection& aSel );
     530             :     const TextSelection& GetTextSelection() const;
     531             :     void ResizeAndPositionListBox();
     532             :     void SelectFirstEntry(); //selects first entry in ListBox
     533             :     void ClearAndHide();
     534             :     /*
     535             :      * clears if typed anything, then hides
     536             :      * the window, clear internal variables
     537             :      * */
     538           0 :     CodeCompleteListBox* GetListBox(){return pListBox;}
     539             : };
     540             : 
     541             : class UnoTypeCodeCompletetor
     542             : {
     543             : private:
     544             :     ::css::uno::Reference< ::css::lang::XMultiServiceFactory > xFactory;
     545             :     ::css::uno::Reference< ::css::reflection::XIdlReflection > xRefl;
     546             :     ::css::uno::Reference< ::css::reflection::XIdlClass > xClass;
     547             :     bool bCanComplete;
     548             : 
     549             :     bool CheckField( const OUString& sFieldName );
     550             :     bool CheckMethod( const OUString& sMethName );
     551             : 
     552             : public:
     553             :     UnoTypeCodeCompletetor( const std::vector< OUString >& aVect, const OUString& sVarType );
     554           0 :     ~UnoTypeCodeCompletetor(){}
     555             : 
     556             :     std::vector< OUString > GetXIdlClassMethods() const;
     557             :     std::vector< OUString > GetXIdlClassFields() const;
     558             : 
     559             :     bool CanCodeComplete() const;
     560             : };
     561             : 
     562             : } // namespace basctl
     563             : 
     564             : #endif // BASCTL_BASIDE2_HXX
     565             : 
     566             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10