LCOV - code coverage report
Current view: top level - sc/inc - appoptio.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 35 35 100.0 %
Date: 2012-08-25 Functions: 35 35 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 7 14 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef SC_APPOPTIO_HXX
      30                 :            : #define SC_APPOPTIO_HXX
      31                 :            : 
      32                 :            : #include <vcl/field.hxx>
      33                 :            : #include <sfx2/zoomitem.hxx>
      34                 :            : #include <unotools/configitem.hxx>
      35                 :            : #include "scdllapi.h"
      36                 :            : #include "scmod.hxx"
      37                 :            : #include "global.hxx"
      38                 :            : #include "optutil.hxx"
      39                 :            : 
      40                 :            : class SC_DLLPUBLIC ScAppOptions
      41                 :            : {
      42                 :            : public:
      43                 :            :                 ScAppOptions();
      44                 :            :                 ScAppOptions( const ScAppOptions& rCpy );
      45                 :            :                 ~ScAppOptions();
      46                 :            : 
      47                 :            :     void        SetDefaults();
      48                 :            : 
      49                 :         54 :     void        SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit;      }
      50                 :         81 :     FieldUnit   GetAppMetric() const            { return eMetric;       }
      51                 :         54 :     void        SetZoom( sal_uInt16 nNew )          { nZoom = nNew;         }
      52                 :        237 :     sal_uInt16      GetZoom() const                 { return nZoom;         }
      53                 :         54 :     void        SetZoomType( SvxZoomType eNew ) { eZoomType = eNew;     }
      54                 :        237 :     SvxZoomType GetZoomType() const             { return eZoomType;     }
      55                 :         51 :     void        SetSynchronizeZoom( sal_Bool bNew ) { bSynchronizeZoom = bNew; }
      56                 :          1 :     sal_Bool        GetSynchronizeZoom() const      { return bSynchronizeZoom; }
      57                 :          1 :     sal_uInt16      GetLRUFuncListCount() const     { return nLRUFuncCount; }
      58                 :          1 :     sal_uInt16*     GetLRUFuncList() const          { return pLRUList;      }
      59                 :            :     void        SetLRUFuncList( const sal_uInt16* pList,
      60                 :            :                                 const sal_uInt16  nCount );
      61                 :         54 :     void        SetStatusFunc( sal_uInt16 nNew )    { nStatusFunc = nNew;   }
      62                 :        310 :     sal_uInt16      GetStatusFunc() const           { return nStatusFunc;   }
      63                 :         54 :     void        SetAutoComplete( sal_Bool bNew )    { bAutoComplete = bNew; }
      64                 :          8 :     sal_Bool        GetAutoComplete() const         { return bAutoComplete; }
      65                 :         53 :     void        SetDetectiveAuto( sal_Bool bNew )   { bDetectiveAuto = bNew; }
      66                 :          8 :     sal_Bool        GetDetectiveAuto() const        { return bDetectiveAuto; }
      67                 :            : 
      68                 :         51 :     void        SetTrackContentColor(sal_uInt32 nNew) { nTrackContentColor = nNew; }
      69                 :          1 :     sal_uInt32  GetTrackContentColor() const     { return nTrackContentColor; }
      70                 :         51 :     void        SetTrackInsertColor(sal_uInt32 nNew)  { nTrackInsertColor = nNew;  }
      71                 :          1 :     sal_uInt32  GetTrackInsertColor() const      { return nTrackInsertColor;  }
      72                 :         51 :     void        SetTrackDeleteColor(sal_uInt32 nNew)  { nTrackDeleteColor = nNew;  }
      73                 :          1 :     sal_uInt32  GetTrackDeleteColor() const      { return nTrackDeleteColor;  }
      74                 :         51 :     void        SetTrackMoveColor(sal_uInt32 nNew)    { nTrackMoveColor = nNew;    }
      75                 :          1 :     sal_uInt32  GetTrackMoveColor() const        { return nTrackMoveColor;    }
      76                 :            : 
      77                 :          8 :     ScLkUpdMode GetLinkMode() const             { return eLinkMode ;}
      78                 :         54 :     void        SetLinkMode( ScLkUpdMode nSet ) {   eLinkMode  = nSet;}
      79                 :            : 
      80                 :         51 :     void        SetDefaultObjectSizeWidth(sal_Int32 nNew)   { nDefaultObjectSizeWidth = nNew; }
      81                 :          1 :     sal_Int32       GetDefaultObjectSizeWidth() const       { return nDefaultObjectSizeWidth; }
      82                 :         51 :     void        SetDefaultObjectSizeHeight(sal_Int32 nNew)  { nDefaultObjectSizeHeight = nNew; }
      83                 :          1 :     sal_Int32       GetDefaultObjectSizeHeight() const      { return nDefaultObjectSizeHeight; }
      84                 :            : 
      85                 :         51 :     void        SetShowSharedDocumentWarning( sal_Bool bNew )   { mbShowSharedDocumentWarning = bNew; }
      86                 :          1 :     sal_Bool        GetShowSharedDocumentWarning() const        { return mbShowSharedDocumentWarning; }
      87                 :          1 :     ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return meKeyBindingType; }
      88                 :         51 :     void        SetKeyBindingType( ScOptionsUtil::KeyBindingType e ) { meKeyBindingType = e; }
      89                 :            : 
      90                 :            :     const ScAppOptions& operator=   ( const ScAppOptions& rOpt );
      91                 :            : 
      92                 :            : private:
      93                 :            :     FieldUnit   eMetric;
      94                 :            :     sal_uInt16      nLRUFuncCount;
      95                 :            :     sal_uInt16*     pLRUList;
      96                 :            :     SvxZoomType eZoomType;
      97                 :            :     sal_uInt16      nZoom;
      98                 :            :     sal_Bool        bSynchronizeZoom;
      99                 :            :     sal_uInt16      nStatusFunc;
     100                 :            :     sal_Bool        bAutoComplete;
     101                 :            :     sal_Bool        bDetectiveAuto;
     102                 :            :     sal_uInt32  nTrackContentColor;
     103                 :            :     sal_uInt32  nTrackInsertColor;
     104                 :            :     sal_uInt32  nTrackDeleteColor;
     105                 :            :     sal_uInt32  nTrackMoveColor;
     106                 :            :     ScLkUpdMode eLinkMode;
     107                 :            :     sal_Int32       nDefaultObjectSizeWidth;
     108                 :            :     sal_Int32       nDefaultObjectSizeHeight;
     109                 :            :     sal_Bool        mbShowSharedDocumentWarning;
     110                 :            :     ScOptionsUtil::KeyBindingType meKeyBindingType;
     111                 :            : };
     112                 :            : 
     113                 :            : 
     114                 :            : //==================================================================
     115                 :            : //  Config Item containing app options
     116                 :            : //==================================================================
     117                 :            : 
     118 [ +  - ][ +  - ]:         18 : class ScAppCfg : public ScAppOptions
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
     119                 :            : {
     120                 :            :     //  spread about 5 config paths
     121                 :            :     //! split ScAppOptions into different classes
     122                 :            : 
     123                 :            :     ScLinkConfigItem    aLayoutItem;
     124                 :            :     ScLinkConfigItem    aInputItem;
     125                 :            :     ScLinkConfigItem    aRevisionItem;
     126                 :            :     ScLinkConfigItem    aContentItem;
     127                 :            :     ScLinkConfigItem    aSortListItem;
     128                 :            :     ScLinkConfigItem    aMiscItem;
     129                 :            :     ScLinkConfigItem    aCompatItem;
     130                 :            : 
     131                 :            :     DECL_LINK( LayoutCommitHdl, void* );
     132                 :            :     DECL_LINK( InputCommitHdl, void* );
     133                 :            :     DECL_LINK( RevisionCommitHdl, void* );
     134                 :            :     DECL_LINK( ContentCommitHdl, void* );
     135                 :            :     DECL_LINK( SortListCommitHdl, void* );
     136                 :            :     DECL_LINK( MiscCommitHdl, void* );
     137                 :            :     DECL_LINK( CompatCommitHdl, void* );
     138                 :            : 
     139                 :            :     com::sun::star::uno::Sequence<rtl::OUString> GetLayoutPropertyNames();
     140                 :            :     com::sun::star::uno::Sequence<rtl::OUString> GetInputPropertyNames();
     141                 :            :     com::sun::star::uno::Sequence<rtl::OUString> GetRevisionPropertyNames();
     142                 :            :     com::sun::star::uno::Sequence<rtl::OUString> GetContentPropertyNames();
     143                 :            :     com::sun::star::uno::Sequence<rtl::OUString> GetSortListPropertyNames();
     144                 :            :     com::sun::star::uno::Sequence<rtl::OUString> GetMiscPropertyNames();
     145                 :            :     com::sun::star::uno::Sequence<rtl::OUString> GetCompatPropertyNames();
     146                 :            : 
     147                 :            : public:
     148                 :            :             ScAppCfg();
     149                 :            : 
     150                 :            :     void    SetOptions( const ScAppOptions& rNew );
     151                 :            :     void    OptionsChanged();   // after direct access to ScAppOptions base class
     152                 :            : };
     153                 :            : 
     154                 :            : #endif
     155                 :            : 
     156                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10