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

Generated by: LCOV version 1.10