LCOV - code coverage report
Current view: top level - include/vcl - textdata.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 33 0.0 %
Date: 2014-04-14 Functions: 0 34 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_VCL_TEXTDATA_HXX
      21             : #define INCLUDED_VCL_TEXTDATA_HXX
      22             : 
      23             : #include <rtl/ustring.hxx>
      24             : #include <svl/brdcst.hxx>
      25             : #include <svl/smplhint.hxx>
      26             : #include <vcl/dllapi.h>
      27             : 
      28             : // for Notify, if all paragraphs were deleted
      29             : #define TEXT_PARA_ALL               0xFFFFFFFF
      30             : 
      31             : class TextPaM
      32             : {
      33             : private:
      34             :     sal_uLong           mnPara;
      35             :     sal_uInt16          mnIndex;
      36             : 
      37             : public:
      38           0 :                     TextPaM()                               { mnPara = 0, mnIndex = 0; }
      39           0 :                     TextPaM( sal_uLong nPara, sal_uInt16 nIndex )   { mnPara = nPara, mnIndex = nIndex; }
      40             : 
      41           0 :     sal_uLong           GetPara() const     { return mnPara; }
      42           0 :     sal_uLong&          GetPara()           { return mnPara; }
      43             : 
      44           0 :     sal_uInt16          GetIndex() const    { return mnIndex; }
      45           0 :     sal_uInt16&         GetIndex()          { return mnIndex; }
      46             : 
      47             :     inline bool     operator == ( const TextPaM& rPaM ) const;
      48             :     inline bool     operator != ( const TextPaM& rPaM ) const;
      49             :     inline bool     operator < ( const TextPaM& rPaM ) const;
      50             :     inline bool     operator > ( const TextPaM& rPaM ) const;
      51             : };
      52             : 
      53           0 : inline bool TextPaM::operator == ( const TextPaM& rPaM ) const
      54             : {
      55           0 :     return ( ( mnPara == rPaM.mnPara ) && ( mnIndex == rPaM.mnIndex ) ) ? true : false;
      56             : }
      57             : 
      58           0 : inline bool TextPaM::operator != ( const TextPaM& rPaM ) const
      59             : {
      60           0 :     return !( *this == rPaM );
      61             : }
      62             : 
      63           0 : inline bool TextPaM::operator < ( const TextPaM& rPaM ) const
      64             : {
      65           0 :     return ( ( mnPara < rPaM.mnPara ) ||
      66           0 :              ( ( mnPara == rPaM.mnPara ) && mnIndex < rPaM.mnIndex ) ) ? true : false;
      67             : }
      68             : 
      69           0 : inline bool TextPaM::operator > ( const TextPaM& rPaM ) const
      70             : {
      71           0 :     return ( ( mnPara > rPaM.mnPara ) ||
      72           0 :              ( ( mnPara == rPaM.mnPara ) && mnIndex > rPaM.mnIndex ) ) ? true : false;
      73             : }
      74             : 
      75             : class VCL_DLLPUBLIC TextSelection
      76             : {
      77             : private:
      78             :     TextPaM         maStartPaM;
      79             :     TextPaM         maEndPaM;
      80             : 
      81             : public:
      82             :                     TextSelection();
      83             :                     TextSelection( const TextPaM& rPaM );
      84             :                     TextSelection( const TextPaM& rStart, const TextPaM& rEnd );
      85             : 
      86           0 :     const TextPaM&  GetStart() const    { return maStartPaM; }
      87           0 :     TextPaM&        GetStart()          { return maStartPaM; }
      88             : 
      89           0 :     const TextPaM&  GetEnd() const      { return maEndPaM; }
      90           0 :     TextPaM&        GetEnd()            { return maEndPaM; }
      91             : 
      92             :     void            Justify();
      93             : 
      94           0 :     bool            HasRange() const    { return maStartPaM != maEndPaM; }
      95             : 
      96             :     inline bool     operator == ( const TextSelection& rSel ) const;
      97             :     inline bool     operator != ( const TextSelection& rSel ) const;
      98             : };
      99             : 
     100           0 : inline bool TextSelection::operator == ( const TextSelection& rSel ) const
     101             : {
     102           0 :     return ( ( maStartPaM == rSel.maStartPaM ) && ( maEndPaM == rSel.maEndPaM ) );
     103             : }
     104             : 
     105           0 : inline bool TextSelection::operator != ( const TextSelection& rSel ) const
     106             : {
     107           0 :     return !( *this == rSel );
     108             : }
     109             : 
     110             : #define TEXT_HINT_PARAINSERTED              1
     111             : #define TEXT_HINT_PARAREMOVED               2
     112             : #define TEXT_HINT_PARACONTENTCHANGED        3
     113             : #define TEXT_HINT_TEXTHEIGHTCHANGED         4
     114             : #define TEXT_HINT_FORMATPARA                5
     115             : #define TEXT_HINT_TEXTFORMATTED             6
     116             : #define TEXT_HINT_MODIFIED                  7
     117             : #define TEXT_HINT_BLOCKNOTIFICATION_START   8
     118             : #define TEXT_HINT_BLOCKNOTIFICATION_END     9
     119             : #define TEXT_HINT_INPUT_START               10
     120             : #define TEXT_HINT_INPUT_END                 11
     121             : 
     122             : #define TEXT_HINT_VIEWSCROLLED          100
     123             : #define TEXT_HINT_VIEWSELECTIONCHANGED  101
     124             : #define TEXT_HINT_VIEWCARETCHANGED      102
     125             : 
     126           0 : class VCL_DLLPUBLIC TextHint : public SfxSimpleHint
     127             : {
     128             : private:
     129             :     sal_uLong   mnValue;
     130             : 
     131             : public:
     132             :             TYPEINFO_OVERRIDE();
     133             :             TextHint( sal_uLong nId );
     134             :             TextHint( sal_uLong nId, sal_uLong nValue );
     135             : 
     136           0 :     sal_uLong   GetValue() const        { return mnValue; }
     137             :     void    SetValue( sal_uLong n )     { mnValue = n; }
     138             : };
     139             : 
     140             : struct TEIMEInfos
     141             : {
     142             :     OUString    aOldTextAfterStartPos;
     143             :     sal_uInt16* pAttribs;
     144             :     TextPaM     aPos;
     145             :     sal_Int32   nLen;
     146             :     bool        bCursor;
     147             :     bool        bWasCursorOverwrite;
     148             : 
     149             :     TEIMEInfos(const TextPaM& rPos, const OUString& rOldTextAfterStartPos);
     150             :     ~TEIMEInfos();
     151             : 
     152             :     void CopyAttribs(const sal_uInt16* pA, sal_Int32 nL);
     153             :     void DestroyAttribs();
     154             : };
     155             : 
     156             : // -----------------  Wrapper for old Tools List -------------------
     157             : 
     158             : #include <vector>
     159             : #include <algorithm>
     160             : 
     161           0 : template <class T> class ToolsList : public ::std::vector< T >
     162             : {
     163             : public:
     164           0 :     size_t Count() const { return ::std::vector< T >::size(); }
     165           0 :     size_t GetPos( T pObject ) const { return ( ::std::find( this->begin(), this->end(), pObject ) ) - this->begin(); }
     166           0 :     T      GetObject( size_t nIndex ) const { return (*this)[nIndex]; }
     167           0 :     void   Insert( T pObject, size_t nPos ) { ::std::vector< T >::insert( this->begin()+nPos, pObject ); }
     168           0 :     void   Remove( size_t nPos ) { ::std::vector< T >::erase( this->begin()+nPos ); }
     169             : };
     170             : 
     171             : #endif // INCLUDED_VCL_TEXTDATA_HXX
     172             : 
     173             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10