LCOV - code coverage report
Current view: top level - sw/source/uibase/inc - srcedtw.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 0 19 0.0 %
Date: 2014-11-03 Functions: 0 15 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             : #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_SRCEDTW_HXX
      20             : #define INCLUDED_SW_SOURCE_UIBASE_INC_SRCEDTW_HXX
      21             : 
      22             : #include <vcl/window.hxx>
      23             : #include <svl/lstner.hxx>
      24             : #include <vcl/timer.hxx>
      25             : 
      26             : #include <vcl/xtextedt.hxx>
      27             : #include <set>
      28             : 
      29             : namespace com { namespace sun { namespace star { namespace beans {
      30             :     class XMultiPropertySet;
      31             : } } } }
      32             : 
      33             : class ScrollBar;
      34             : class SwSrcView;
      35             : class SwSrcEditWindow;
      36             : class TextEngine;
      37             : class ExtTextView;
      38             : class DataChangedEvent;
      39             : 
      40           0 : class TextViewOutWin : public vcl::Window
      41             : {
      42             :     ExtTextView*    pTextView;
      43             : 
      44             : protected:
      45             :     virtual void    Paint( const Rectangle& ) SAL_OVERRIDE;
      46             :     virtual void    KeyInput( const KeyEvent& rKeyEvt ) SAL_OVERRIDE;
      47             :     virtual void    MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
      48             :     virtual void    MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
      49             :     virtual void    MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
      50             :     virtual void    Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
      51             :     virtual void    DataChanged( const DataChangedEvent& ) SAL_OVERRIDE;
      52             : 
      53             : public:
      54           0 :         TextViewOutWin(vcl::Window* pParent, WinBits nBits) :
      55           0 :             Window(pParent, nBits), pTextView(0){}
      56             : 
      57           0 :     void    SetTextView( ExtTextView* pView ) {pTextView = pView;}
      58             : 
      59             : };
      60             : 
      61             : typedef std::set<sal_uInt16> SyntaxLineSet;
      62             : 
      63             : class SwSrcEditWindow : public vcl::Window, public SfxListener
      64             : {
      65             : private:
      66             :     class ChangesListener;
      67             :     friend class ChangesListener;
      68             :     ExtTextView*    pTextView;
      69             :     ExtTextEngine*  pTextEngine;
      70             : 
      71             :     TextViewOutWin* pOutWin;
      72             :     ScrollBar       *pHScrollbar,
      73             :                     *pVScrollbar;
      74             : 
      75             :     SwSrcView*      pSrcView;
      76             : 
      77             :     rtl::Reference< ChangesListener > listener_;
      78             :     osl::Mutex mutex_;
      79             :     com::sun::star::uno::Reference< com::sun::star::beans::XMultiPropertySet >
      80             :         notifier_;
      81             : 
      82             :     long            nCurTextWidth;
      83             :     sal_uInt16          nStartLine;
      84             :     rtl_TextEncoding eSourceEncoding;
      85             :     bool            bReadonly;
      86             :     bool            bDoSyntaxHighlight;
      87             :     bool            bHighlighting;
      88             : 
      89             :     Timer           aSyntaxIdleTimer;
      90             :     SyntaxLineSet   aSyntaxLineTable;
      91             : 
      92             :     void            ImpDoHighlight( const OUString& rSource, sal_uInt16 nLineOff );
      93             : 
      94             :     using OutputDevice::SetFont;
      95             :     void            SetFont();
      96             : 
      97             :     DECL_LINK( SyntaxTimerHdl, Timer * );
      98             :     DECL_LINK( TimeoutHdl, Timer * );
      99             : 
     100             :     using Window::Notify;
     101             :     using Window::Invalidate;
     102             : 
     103             : protected:
     104             : 
     105             :     virtual void    Resize() SAL_OVERRIDE;
     106             :     virtual void    DataChanged( const DataChangedEvent& ) SAL_OVERRIDE;
     107             :     virtual void    GetFocus() SAL_OVERRIDE;
     108             : //  virtual void    LoseFocus();
     109             : 
     110             :     void            CreateTextEngine();
     111             :     void            DoSyntaxHighlight( sal_uInt16 nPara );
     112             : 
     113             :     virtual void    Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     114             : 
     115             :     DECL_LINK(ScrollHdl, ScrollBar*);
     116             : 
     117             : public:
     118             :                     SwSrcEditWindow( vcl::Window* pParent, SwSrcView* pParentView );
     119             :                     virtual ~SwSrcEditWindow();
     120             : 
     121             :     void            SetScrollBarRanges();
     122             :     void            InitScrollBars();
     123           0 :     void            Read(SvStream& rInput) { pTextEngine->Read(rInput); }
     124           0 :     void            Write(SvStream& rOutput) { pTextEngine->Write(rOutput); }
     125             : 
     126           0 :     ExtTextView*    GetTextView()
     127           0 :                         {return pTextView;}
     128           0 :     TextEngine*     GetTextEngine()
     129           0 :                         {return pTextEngine;}
     130           0 :     SwSrcView*      GetSrcView() {return pSrcView;}
     131             : 
     132           0 :     TextViewOutWin* GetOutWin() {return pOutWin;}
     133             : 
     134             :     virtual void    Invalidate( sal_uInt16 nFlags = 0 ) SAL_OVERRIDE;
     135             : 
     136           0 :     void            ClearModifyFlag()
     137           0 :                         { pTextEngine->SetModified(false); }
     138           0 :     bool            IsModified() const
     139           0 :                         { return pTextEngine->IsModified();}
     140             :     void            CreateScrollbars();
     141             : 
     142           0 :     void            SetReadonly(bool bSet){bReadonly = bSet;}
     143           0 :     bool            IsReadonly(){return bReadonly;}
     144             : 
     145             :     void            DoDelayedSyntaxHighlight( sal_uInt16 nPara );
     146             : 
     147           0 :     void            SetStartLine(sal_uInt16 nLine){nStartLine = nLine;}
     148             : 
     149             :     virtual void    Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
     150             :     void            HandleWheelCommand( const CommandEvent& rCEvt );
     151             : 
     152             :     void            SetTextEncoding(rtl_TextEncoding eEncoding);
     153             : };
     154             : 
     155             : #endif
     156             : 
     157             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10