LCOV - code coverage report
Current view: top level - sw/source/ui/inc - frmpage.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 6 0.0 %
Date: 2012-08-25 Functions: 0 6 0.0 %
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 _FRMPAGE_HXX
      30                 :            : #define _FRMPAGE_HXX
      31                 :            : 
      32                 :            : #include <vcl/fixed.hxx>
      33                 :            : #include <vcl/button.hxx>
      34                 :            : #include <vcl/lstbox.hxx>
      35                 :            : #include <vcl/field.hxx>
      36                 :            : #include <sfx2/tabdlg.hxx>
      37                 :            : #include <svx/swframeposstrings.hxx>
      38                 :            : #include <swtypes.hxx>
      39                 :            : #include <bmpwin.hxx>
      40                 :            : #include <svx/swframeexample.hxx>
      41                 :            : #include <prcntfld.hxx>
      42                 :            : #include <globals.hrc>
      43                 :            : 
      44                 :            : namespace sfx2{class FileDialogHelper;}
      45                 :            : class SwWrtShell;
      46                 :            : struct FrmMap;
      47                 :            : // OD 12.11.2003 #i22341#
      48                 :            : struct SwPosition;
      49                 :            : 
      50                 :            : /*--------------------------------------------------------------------
      51                 :            :      Description:   frame dialog
      52                 :            :  --------------------------------------------------------------------*/
      53                 :            : class SwFrmPage: public SfxTabPage
      54                 :            : {
      55                 :            :     // size
      56                 :            :     FixedLine       aSizeFL;
      57                 :            :     FixedText       aWidthFT;
      58                 :            :     FixedText       aWidthAutoFT;
      59                 :            :     PercentField    aWidthED;
      60                 :            :     CheckBox        aRelWidthCB;
      61                 :            :     CheckBox        aAutoWidthCB;
      62                 :            :     FixedText       aHeightFT;
      63                 :            :     FixedText       aHeightAutoFT;
      64                 :            :     PercentField    aHeightED;
      65                 :            :     CheckBox        aRelHeightCB;
      66                 :            :     CheckBox        aAutoHeightCB;
      67                 :            :     CheckBox        aFixedRatioCB;
      68                 :            :     PushButton      aRealSizeBT;
      69                 :            : 
      70                 :            :     // anchor
      71                 :            :     FixedLine       aTypeSepFL;
      72                 :            :     FixedLine       aTypeFL;
      73                 :            :     RadioButton     aAnchorAtPageRB;
      74                 :            :     RadioButton     aAnchorAtParaRB;
      75                 :            :     RadioButton     aAnchorAtCharRB;
      76                 :            :     RadioButton     aAnchorAsCharRB;
      77                 :            :     RadioButton     aAnchorAtFrameRB;
      78                 :            : 
      79                 :            :     // position
      80                 :            :     FixedLine       aPositionFL;
      81                 :            :     FixedText       aHorizontalFT;
      82                 :            :     ListBox         aHorizontalDLB;
      83                 :            :     FixedText       aAtHorzPosFT;
      84                 :            :     MetricField     aAtHorzPosED;
      85                 :            :     FixedText       aHoriRelationFT;
      86                 :            :     ListBox         aHoriRelationLB;
      87                 :            :     CheckBox        aMirrorPagesCB;
      88                 :            :     FixedText       aVerticalFT;
      89                 :            :     ListBox         aVerticalDLB;
      90                 :            :     FixedText       aAtVertPosFT;
      91                 :            :     MetricField     aAtVertPosED;
      92                 :            :     FixedText       aVertRelationFT;
      93                 :            :     ListBox         aVertRelationLB;
      94                 :            :     // OD 02.10.2003 #i18732# - check box for new option 'FollowTextFlow'
      95                 :            :     CheckBox        aFollowTextFlowCB;
      96                 :            : 
      97                 :            :     // example
      98                 :            :     SvxSwFrameExample   aExampleWN;
      99                 :            : 
     100                 :            :     //'string provider'
     101                 :            :     SvxSwFramePosString aFramePosString;
     102                 :            : 
     103                 :            :     sal_Bool            bAtHorzPosModified;
     104                 :            :     sal_Bool            bAtVertPosModified;
     105                 :            : 
     106                 :            :     sal_Bool            bFormat;
     107                 :            :     sal_Bool            bNew;
     108                 :            :     sal_Bool            bNoModifyHdl;
     109                 :            :     sal_Bool            bVerticalChanged;  //check done whether frame is in vertical environment
     110                 :            :     sal_Bool            bIsVerticalFrame;  //current frame is in vertical environment - strings are exchanged
     111                 :            :     // --> OD 2009-08-31 #mongolianlayou#
     112                 :            :     sal_Bool            bIsVerticalL2R;
     113                 :            :     sal_Bool            bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
     114                 :            :     sal_Bool            bHtmlMode;
     115                 :            :     sal_uInt16          nHtmlMode;
     116                 :            :     sal_uInt16          nDlgType;
     117                 :            :     Size            aGrfSize;
     118                 :            :     Size            aWrap;
     119                 :            :     SwTwips         nUpperBorder;
     120                 :            :     SwTwips         nLowerBorder;
     121                 :            :     double          fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button
     122                 :            : 
     123                 :            :     // OD 12.11.2003 #i22341# - keep content position of character for
     124                 :            :     // to character anchored objects.
     125                 :            :     const SwPosition* mpToCharCntntPos;
     126                 :            : 
     127                 :            :     // old alignment
     128                 :            :     short        nOldH;
     129                 :            :     short    nOldHRel;
     130                 :            :     short        nOldV;
     131                 :            :     short    nOldVRel;
     132                 :            : 
     133                 :            :     FrmMap* pVMap;
     134                 :            :     FrmMap* pHMap;
     135                 :            : 
     136                 :            :     bool    m_bAllowVertPositioning;
     137                 :            :     bool    m_bIsMathOLE;
     138                 :            :     bool    m_bIsMathBaselineAlignment;
     139                 :            : 
     140                 :            :     virtual void    ActivatePage(const SfxItemSet& rSet);
     141                 :            :     virtual int     DeactivatePage(SfxItemSet *pSet);
     142                 :            : 
     143                 :            : 
     144                 :            :     DECL_LINK(RangeModifyHdl, void *);
     145                 :            :     DECL_LINK(AnchorTypeHdl, void *);
     146                 :            :     DECL_LINK( PosHdl, ListBox * );
     147                 :            :     DECL_LINK( RelHdl, ListBox * );
     148                 :            :     void            InitPos(RndStdIds eId, sal_uInt16 nH, sal_uInt16 nHRel,
     149                 :            :                             sal_uInt16 nV,  sal_uInt16 nVRel,
     150                 :            :                             long   nX,  long   nY);
     151                 :            : 
     152                 :            :     DECL_LINK(RealSizeHdl, void *);
     153                 :            :     DECL_LINK( RelSizeClickHdl, CheckBox * );
     154                 :            :     DECL_LINK(MirrorHdl, void *);
     155                 :            : 
     156                 :            :     DECL_LINK( AutoWidthClickHdl, void* );
     157                 :            :     DECL_LINK( AutoHeightClickHdl, void* );
     158                 :            : 
     159                 :            :     // update example
     160                 :            :     void            UpdateExample();
     161                 :            :     DECL_LINK( ModifyHdl, Edit * );
     162                 :            : 
     163                 :            :     void            Init(const SfxItemSet& rSet, sal_Bool bReset = sal_False);
     164                 :            :     // OD 12.11.2003 #i22341# - adjustment to handle maps, that are ambigous
     165                 :            :     //                          in the alignment.
     166                 :            :     sal_uInt16          FillPosLB( const FrmMap* _pMap,
     167                 :            :                                const sal_uInt16 _nAlign,
     168                 :            :                                const sal_uInt16 _nRel,
     169                 :            :                                ListBox& _rLB );
     170                 :            :     // OD 14.11.2003 #i22341# - adjustment to handle maps, that are ambigous
     171                 :            :     //                          in their string entries.
     172                 :            :     sal_uLong           FillRelLB( const FrmMap* _pMap,
     173                 :            :                                const sal_uInt16 _nLBSelPos,
     174                 :            :                                const sal_uInt16 _nAlign,
     175                 :            :                                sal_uInt16 _nRel,
     176                 :            :                                ListBox& _rLB,
     177                 :            :                                FixedText& _rFT );
     178                 :            :     sal_uInt16          GetMapPos( const FrmMap *pMap, ListBox &rAlignLB );
     179                 :            :     short           GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB);
     180                 :            :     short           GetRelation(FrmMap *pMap, ListBox &rRelationLB);
     181                 :            :     RndStdIds       GetAnchor();
     182                 :            : 
     183                 :            :     void            EnableGraficMode( void );   // hides auto check boxes and re-org controls for "Real Size" button
     184                 :            : 
     185                 :            :     SwFrmPage(Window *pParent, const SfxItemSet &rSet);
     186                 :            :     ~SwFrmPage();
     187                 :            : 
     188                 :            :     using SfxTabPage::ActivatePage;
     189                 :            :     using SfxTabPage::DeactivatePage;
     190                 :            : 
     191                 :            : public:
     192                 :            : 
     193                 :            :     static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
     194                 :            :     static sal_uInt16* GetRanges();
     195                 :            : 
     196                 :            :     virtual sal_Bool FillItemSet(SfxItemSet &rSet);
     197                 :            :     virtual void Reset(const SfxItemSet &rSet);
     198                 :            : 
     199                 :          0 :     void            SetNewFrame(sal_Bool bNewFrame) { bNew      = bNewFrame; }
     200                 :            :     void            SetFormatUsed(sal_Bool bFmt);
     201                 :          0 :     void            SetFrmType(sal_uInt16 nType)    { nDlgType  = nType;     }
     202                 :          0 :     inline sal_Bool     IsInGraficMode( void )      { return nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE; }
     203                 :            :     void            EnableVerticalPositioning( bool bEnable );
     204                 :            : };
     205                 :            : 
     206                 :            : class SwGrfExtPage: public SfxTabPage
     207                 :            : {
     208                 :            :     // mirror
     209                 :            :     FixedLine       aMirrorFL;
     210                 :            :     CheckBox        aMirrorVertBox;
     211                 :            :     CheckBox        aMirrorHorzBox;
     212                 :            :     RadioButton     aAllPagesRB;
     213                 :            :     RadioButton     aLeftPagesRB;
     214                 :            :     RadioButton     aRightPagesRB;
     215                 :            :     BmpWindow       aBmpWin;
     216                 :            : 
     217                 :            :     FixedLine       aConnectFL;
     218                 :            :     FixedText       aConnectFT;
     219                 :            :     Edit            aConnectED;
     220                 :            :     PushButton      aBrowseBT;
     221                 :            : 
     222                 :            :     String          aFilterName;
     223                 :            :     String          aGrfName, aNewGrfName;
     224                 :            : 
     225                 :            :     ::sfx2::FileDialogHelper*     pGrfDlg;
     226                 :            : 
     227                 :            :     sal_Bool            bHtmlMode;
     228                 :            : 
     229                 :            :     // handler for mirroring
     230                 :            :     DECL_LINK(MirrorHdl, void *);
     231                 :            :     DECL_LINK(BrowseHdl, void *);
     232                 :            : 
     233                 :            :     virtual void    ActivatePage(const SfxItemSet& rSet);
     234                 :            :     SwGrfExtPage(Window *pParent, const SfxItemSet &rSet);
     235                 :            :     ~SwGrfExtPage();
     236                 :            : 
     237                 :            :     using SfxTabPage::ActivatePage;
     238                 :            :     using SfxTabPage::DeactivatePage;
     239                 :            : 
     240                 :            : public:
     241                 :            : 
     242                 :            :     static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
     243                 :            : 
     244                 :            :     virtual sal_Bool FillItemSet(SfxItemSet &rSet);
     245                 :            :     virtual void Reset(const SfxItemSet &rSet);
     246                 :            :     virtual int  DeactivatePage(SfxItemSet *pSet);
     247                 :            : };
     248                 :            : 
     249                 :            : class SwFrmURLPage : public SfxTabPage
     250                 :            : {
     251                 :            :     // hyperlink
     252                 :            :     FixedLine       aHyperLinkFL;
     253                 :            :     FixedText       aURLFT;
     254                 :            :     Edit            aURLED;
     255                 :            :     PushButton      aSearchPB;
     256                 :            :     FixedText       aNameFT;
     257                 :            :     Edit            aNameED;
     258                 :            :     FixedText       aFrameFT;
     259                 :            :     ComboBox        aFrameCB;
     260                 :            : 
     261                 :            :     // image map
     262                 :            :     FixedLine       aImageFL;
     263                 :            :     CheckBox        aServerCB;
     264                 :            :     CheckBox        aClientCB;
     265                 :            : 
     266                 :            :     DECL_LINK(InsertFileHdl, void *);
     267                 :            : 
     268                 :            : 
     269                 :            :     SwFrmURLPage(Window *pParent, const SfxItemSet &rSet);
     270                 :            :     ~SwFrmURLPage();
     271                 :            : 
     272                 :            :     using SfxTabPage::ActivatePage;
     273                 :            :     using SfxTabPage::DeactivatePage;
     274                 :            : 
     275                 :            : public:
     276                 :            : 
     277                 :            :     static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
     278                 :            : 
     279                 :            :     virtual sal_Bool FillItemSet(SfxItemSet &rSet);
     280                 :            :     virtual void Reset(const SfxItemSet &rSet);
     281                 :            : };
     282                 :            : 
     283                 :            : class SwFrmAddPage : public SfxTabPage
     284                 :            : {
     285                 :            :       FixedLine   aNamesFL;
     286                 :            :     FixedText   aNameFT;
     287                 :            :     Edit        aNameED;
     288                 :            :     FixedText   aAltNameFT;
     289                 :            :     Edit        aAltNameED;
     290                 :            :     FixedText   aPrevFT;
     291                 :            :     ListBox     aPrevLB;
     292                 :            :     FixedText   aNextFT;
     293                 :            :     ListBox     aNextLB;
     294                 :            :         FixedLine   aProtectFL;
     295                 :            : 
     296                 :            :     CheckBox    aProtectContentCB;
     297                 :            :     CheckBox    aProtectFrameCB;
     298                 :            :     CheckBox    aProtectSizeCB;
     299                 :            :     FixedLine   aExtFL;
     300                 :            : 
     301                 :            :     CheckBox    aEditInReadonlyCB;
     302                 :            :     CheckBox    aPrintFrameCB;
     303                 :            :     FixedText   aTextFlowFT;
     304                 :            :     ListBox     aTextFlowLB;
     305                 :            : 
     306                 :            : 
     307                 :            :     SwWrtShell* pWrtSh;
     308                 :            : 
     309                 :            :     sal_uInt16      nDlgType;
     310                 :            :     sal_Bool        bHtmlMode;
     311                 :            :     sal_Bool        bFormat;
     312                 :            :     sal_Bool        bNew;
     313                 :            : 
     314                 :            :     DECL_LINK(EditModifyHdl, void *);
     315                 :            :     DECL_LINK(ChainModifyHdl, ListBox*);
     316                 :            : 
     317                 :            :     SwFrmAddPage(Window *pParent, const SfxItemSet &rSet);
     318                 :            :     ~SwFrmAddPage();
     319                 :            : 
     320                 :            : public:
     321                 :            : 
     322                 :            :     static SfxTabPage*  Create(Window *pParent, const SfxItemSet &rSet);
     323                 :            :     static sal_uInt16*      GetRanges();
     324                 :            : 
     325                 :            :     virtual sal_Bool FillItemSet(SfxItemSet &rSet);
     326                 :            :     virtual void Reset(const SfxItemSet &rSet);
     327                 :            : 
     328                 :            :     void            SetFormatUsed(sal_Bool bFmt);
     329                 :          0 :     void            SetFrmType(sal_uInt16 nType) { nDlgType = nType; }
     330                 :          0 :     void            SetNewFrame(sal_Bool bNewFrame) { bNew  = bNewFrame; }
     331                 :          0 :     void            SetShell(SwWrtShell* pSh) { pWrtSh  = pSh; }
     332                 :            : 
     333                 :            : };
     334                 :            : 
     335                 :            : #endif // _FRMPAGE_HXX
     336                 :            : 
     337                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10