LCOV - code coverage report
Current view: top level - sc/source/ui/inc - uiitems.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 24 12.5 %
Date: 2012-08-25 Functions: 3 24 12.5 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 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_UIITEMS_HXX
      30                 :            : #define SC_UIITEMS_HXX
      31                 :            : 
      32                 :            : #include "scdllapi.h"
      33                 :            : #include "conditio.hxx"
      34                 :            : #include "sortparam.hxx"
      35                 :            : #include "subtotalparam.hxx"
      36                 :            : #include "paramisc.hxx"
      37                 :            : #include <svl/poolitem.hxx>
      38                 :            : 
      39                 :            : #include <boost/scoped_ptr.hpp>
      40                 :            : 
      41                 :            : class ScEditEngineDefaulter;
      42                 :            : class EditTextObject;
      43                 :            : class ScViewData;
      44                 :            : class ScDPSaveData;
      45                 :            : struct ScQueryParam;
      46                 :            : 
      47                 :            : // ---------------------------------------------------------------------------
      48                 :            : 
      49                 :            : //  Items
      50                 :            : 
      51                 :            : class ScInputStatusItem : public SfxPoolItem
      52                 :            : {
      53                 :            :     ScAddress           aCursorPos;
      54                 :            :     ScAddress           aStartPos;
      55                 :            :     ScAddress           aEndPos;
      56                 :            :     String              aString;
      57                 :            :     EditTextObject*     pEditData;
      58                 :            : 
      59                 :            : public:
      60                 :            :                             TYPEINFO();
      61                 :            : 
      62                 :            :                             ScInputStatusItem( sal_uInt16 nWhich,
      63                 :            :                                                const ScAddress& rCurPos,
      64                 :            :                                                const ScAddress& rStartPos,
      65                 :            :                                                const ScAddress& rEndPos,
      66                 :            :                                                const String& rString,
      67                 :            :                                                const EditTextObject* pData );
      68                 :            :                             ScInputStatusItem( const ScInputStatusItem& rItem );
      69                 :            :                             ~ScInputStatusItem();
      70                 :            : 
      71                 :            :     virtual String          GetValueText() const;
      72                 :            : 
      73                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
      74                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
      75                 :            : 
      76                 :          0 :     const ScAddress&        GetPos() const      { return aCursorPos; }
      77                 :            :     const ScAddress&        GetStartPos() const { return aStartPos; }
      78                 :            :     const ScAddress&        GetEndPos() const   { return aEndPos; }
      79                 :            :     SCTAB                   GetTab() const      { return aCursorPos.Tab(); }
      80                 :            :     SCCOL                   GetCol() const      { return aCursorPos.Col(); }
      81                 :            :     SCROW                   GetRow() const      { return aCursorPos.Row(); }
      82                 :            :     SCCOL                   GetStartCol() const { return aStartPos.Col(); }
      83                 :            :     SCROW                   GetStartRow() const { return aStartPos.Row(); }
      84                 :            :     SCCOL                   GetEndCol() const   { return aEndPos.Col(); }
      85                 :            :     SCROW                   GetEndRow() const   { return aEndPos.Row(); }
      86                 :            : 
      87                 :          0 :     const String&           GetString() const   { return aString; }
      88                 :          0 :     const EditTextObject*   GetEditData() const { return pEditData; }
      89                 :            : };
      90                 :            : 
      91                 :            : 
      92                 :            : #define SC_TAB_INSERTED     1
      93                 :            : #define SC_TAB_DELETED      2
      94                 :            : #define SC_TAB_MOVED        3
      95                 :            : #define SC_TAB_COPIED       4
      96                 :            : #define SC_TAB_HIDDEN       5
      97                 :            : #define SC_TABS_INSERTED    6
      98                 :            : #define SC_TABS_DELETED     7
      99                 :            : 
     100                 :            : class ScTablesHint : public SfxHint
     101                 :            : {
     102                 :            :     sal_uInt16 nId;
     103                 :            :     SCTAB nTab1;
     104                 :            :     SCTAB nTab2;
     105                 :            : 
     106                 :            : public:
     107                 :            :                     TYPEINFO();
     108                 :            :                     ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0);
     109                 :            :                     ~ScTablesHint();
     110                 :            : 
     111                 :         64 :     sal_uInt16          GetId() const           { return nId; }
     112                 :         64 :     SCTAB           GetTab1() const         { return nTab1; }
     113                 :         64 :     SCTAB           GetTab2() const         { return nTab2; }
     114                 :            : };
     115                 :            : 
     116                 :            : class ScEditViewHint : public SfxHint
     117                 :            : {
     118                 :            :     ScEditEngineDefaulter*  pEditEngine;
     119                 :            :     ScAddress                   aCursorPos;
     120                 :            : 
     121                 :            : public:
     122                 :            :                     TYPEINFO();
     123                 :            :                     ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos );
     124                 :            :                     ~ScEditViewHint();
     125                 :            : 
     126                 :          0 :     SCCOL           GetCol() const      { return aCursorPos.Col(); }
     127                 :          0 :     SCROW           GetRow() const      { return aCursorPos.Row(); }
     128                 :          0 :     SCTAB           GetTab() const      { return aCursorPos.Tab(); }
     129                 :          0 :     ScEditEngineDefaulter*  GetEngine() const   { return pEditEngine; }
     130                 :            : 
     131                 :            : private:
     132                 :            :     ScEditViewHint(); // disabled
     133                 :            : };
     134                 :            : 
     135                 :            : class ScIndexHint : public SfxHint
     136                 :            : {
     137                 :            :     sal_uInt16 nId;
     138                 :            :     sal_uInt16 nIndex;
     139                 :            : 
     140                 :            : public:
     141                 :            :                     TYPEINFO();
     142                 :            :                     ScIndexHint(sal_uInt16 nNewId, sal_uInt16 nIdx);
     143                 :            :                     ~ScIndexHint();
     144                 :            : 
     145                 :          0 :     sal_uInt16          GetId() const           { return nId; }
     146                 :          0 :     sal_uInt16          GetIndex() const        { return nIndex; }
     147                 :            : };
     148                 :            : 
     149                 :            : //----------------------------------------------------------------------------
     150                 :            : // Parameter item for the sort dialog:
     151                 :            : 
     152                 :            : class SC_DLLPUBLIC ScSortItem : public SfxPoolItem
     153                 :            : {
     154                 :            : public:
     155                 :            :                             TYPEINFO();
     156                 :            :                             ScSortItem( sal_uInt16              nWhich,
     157                 :            :                                         ScViewData*         ptrViewData,
     158                 :            :                                         const ScSortParam*  pSortData );
     159                 :            :                             ScSortItem( sal_uInt16              nWhich,
     160                 :            :                                         const ScSortParam*  pSortData );
     161                 :            :                             ScSortItem( const ScSortItem& rItem );
     162                 :            :                             ~ScSortItem();
     163                 :            : 
     164                 :            :     virtual String          GetValueText() const;
     165                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
     166                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
     167                 :            :     virtual bool            QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
     168                 :            : 
     169                 :          0 :     ScViewData*         GetViewData () const { return pViewData; }
     170                 :          0 :     const ScSortParam&  GetSortData () const { return theSortData; }
     171                 :            : 
     172                 :            : private:
     173                 :            :     ScViewData*     pViewData;
     174                 :            :     ScSortParam     theSortData;
     175                 :            : };
     176                 :            : 
     177                 :            : //----------------------------------------------------------------------------
     178                 :            : 
     179                 :            : class SC_DLLPUBLIC ScQueryItem : public SfxPoolItem
     180                 :            : {
     181                 :            : public:
     182                 :            :                             TYPEINFO();
     183                 :            :                             ScQueryItem( sal_uInt16                 nWhich,
     184                 :            :                                          ScViewData*            ptrViewData,
     185                 :            :                                          const ScQueryParam*    pQueryData );
     186                 :            :                             ScQueryItem( sal_uInt16                 nWhich,
     187                 :            :                                          const ScQueryParam*    pQueryData );
     188                 :            :                             ScQueryItem( const ScQueryItem& rItem );
     189                 :            :                             ~ScQueryItem();
     190                 :            : 
     191                 :            :     virtual String          GetValueText() const;
     192                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
     193                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
     194                 :            : 
     195                 :          0 :     ScViewData*         GetViewData () const { return pViewData; }
     196                 :            :     const ScQueryParam& GetQueryData() const;
     197                 :            : 
     198                 :            :     bool        GetAdvancedQuerySource(ScRange& rSource) const;
     199                 :            :     void        SetAdvancedQuerySource(const ScRange* pSource);
     200                 :            : 
     201                 :            : private:
     202                 :            :     boost::scoped_ptr<ScQueryParam> mpQueryData;
     203                 :            :     ScViewData*     pViewData;
     204                 :            :     ScRange         aAdvSource;
     205                 :            :     bool            bIsAdvanced;
     206                 :            : };
     207                 :            : 
     208                 :            : //----------------------------------------------------------------------------
     209                 :            : 
     210                 :            : class SC_DLLPUBLIC ScSubTotalItem : public SfxPoolItem
     211                 :            : {
     212                 :            : public:
     213                 :            :                 TYPEINFO();
     214                 :            :                 ScSubTotalItem( sal_uInt16                  nWhich,
     215                 :            :                                 ScViewData*             ptrViewData,
     216                 :            :                                 const ScSubTotalParam*  pSubTotalData );
     217                 :            :                 ScSubTotalItem( sal_uInt16                  nWhich,
     218                 :            :                                 const ScSubTotalParam*  pSubTotalData );
     219                 :            :                 ScSubTotalItem( const ScSubTotalItem&   rItem );
     220                 :            :                 ~ScSubTotalItem();
     221                 :            : 
     222                 :            :     virtual String          GetValueText() const;
     223                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
     224                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
     225                 :            :     virtual bool            QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const;
     226                 :            : 
     227                 :          0 :     ScViewData*             GetViewData () const { return pViewData; }
     228                 :          0 :     const ScSubTotalParam&  GetSubTotalData() const { return theSubTotalData; }
     229                 :            : 
     230                 :            : private:
     231                 :            :     ScViewData*     pViewData;
     232                 :            :     ScSubTotalParam theSubTotalData;
     233                 :            : };
     234                 :            : 
     235                 :            : //----------------------------------------------------------------------------
     236                 :            : 
     237                 :            : class SC_DLLPUBLIC ScUserListItem : public SfxPoolItem
     238                 :            : {
     239                 :            : public:
     240                 :            :                 TYPEINFO();
     241                 :            :                 ScUserListItem( sal_uInt16 nWhich );
     242                 :            :                 ScUserListItem( const ScUserListItem& rItem );
     243                 :            :                 ~ScUserListItem();
     244                 :            : 
     245                 :            :     virtual String          GetValueText() const;
     246                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
     247                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
     248                 :            : 
     249                 :            :     void        SetUserList ( const ScUserList& rUserList );
     250                 :          0 :     ScUserList* GetUserList () const { return pUserList; }
     251                 :            : 
     252                 :            : private:
     253                 :            :     ScUserList* pUserList;
     254                 :            : };
     255                 :            : 
     256                 :            : //----------------------------------------------------------------------------
     257                 :            : 
     258                 :            : class ScConsolidateItem : public SfxPoolItem
     259                 :            : {
     260                 :            : public:
     261                 :            :                 TYPEINFO();
     262                 :            :                 ScConsolidateItem( sal_uInt16                    nWhich,
     263                 :            :                                    const ScConsolidateParam* pParam );
     264                 :            :                 ScConsolidateItem( const ScConsolidateItem& rItem );
     265                 :            :                 ~ScConsolidateItem();
     266                 :            : 
     267                 :            :     virtual String          GetValueText() const;
     268                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
     269                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
     270                 :            : 
     271                 :          0 :     const ScConsolidateParam& GetData() const { return theConsData; }
     272                 :            : 
     273                 :            : private:
     274                 :            :     ScConsolidateParam  theConsData;
     275                 :            : };
     276                 :            : 
     277                 :            : //----------------------------------------------------------------------------
     278                 :            : 
     279                 :            : class ScPivotItem : public SfxPoolItem
     280                 :            : {
     281                 :            : public:
     282                 :            :                 TYPEINFO();
     283                 :            :                 ScPivotItem( sal_uInt16 nWhich, const ScDPSaveData* pData,
     284                 :            :                              const ScRange* pRange, sal_Bool bNew );
     285                 :            :                 ScPivotItem( const ScPivotItem& rItem );
     286                 :            :                 ~ScPivotItem();
     287                 :            : 
     288                 :            :     virtual String          GetValueText() const;
     289                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
     290                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
     291                 :            : 
     292                 :          0 :     const ScDPSaveData& GetData() const         { return *pSaveData; }
     293                 :          0 :     const ScRange&      GetDestRange() const    { return aDestRange; }
     294                 :          0 :     sal_Bool                IsNewSheet() const      { return bNewSheet; }
     295                 :            : 
     296                 :            : private:
     297                 :            :     ScDPSaveData*   pSaveData;
     298                 :            :     ScRange         aDestRange;
     299                 :            :     sal_Bool            bNewSheet;
     300                 :            : };
     301                 :            : 
     302                 :            : //----------------------------------------------------------------------------
     303                 :            : 
     304                 :            : class ScSolveItem : public SfxPoolItem
     305                 :            : {
     306                 :            : public:
     307                 :            :                 TYPEINFO();
     308                 :            :                 ScSolveItem( sal_uInt16              nWhich,
     309                 :            :                              const ScSolveParam* pParam );
     310                 :            :                 ScSolveItem( const ScSolveItem& rItem );
     311                 :            :                 ~ScSolveItem();
     312                 :            : 
     313                 :            :     virtual String          GetValueText() const;
     314                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
     315                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
     316                 :            : 
     317                 :          0 :     const ScSolveParam& GetData() const { return theSolveData; }
     318                 :            : 
     319                 :            : private:
     320                 :            :     ScSolveParam    theSolveData;
     321                 :            : };
     322                 :            : 
     323                 :            : //----------------------------------------------------------------------------
     324                 :            : 
     325                 :            : class ScTabOpItem : public SfxPoolItem
     326                 :            : {
     327                 :            : public:
     328                 :            :                 TYPEINFO();
     329                 :            :                 ScTabOpItem( sal_uInt16              nWhich,
     330                 :            :                              const ScTabOpParam* pParam );
     331                 :            :                 ScTabOpItem( const ScTabOpItem& rItem );
     332                 :            :                 ~ScTabOpItem();
     333                 :            : 
     334                 :            :     virtual String          GetValueText() const;
     335                 :            :     virtual int             operator==( const SfxPoolItem& ) const;
     336                 :            :     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
     337                 :            : 
     338                 :          0 :     const ScTabOpParam& GetData() const { return theTabOpData; }
     339                 :            : 
     340                 :            : private:
     341                 :            :     ScTabOpParam    theTabOpData;
     342                 :            : };
     343                 :            : 
     344                 :            : #endif
     345                 :            : 
     346                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10