LCOV - code coverage report
Current view: top level - framework/source/services - backingwindow.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 2 50.0 %
Date: 2012-08-25 Functions: 1 5 20.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 8 12.5 %

           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 FRAMEWORK_BACKINGWINDOW_HXX
      30                 :            : #define FRAMEWORK_BACKINGWINDOW_HXX
      31                 :            : 
      32                 :            : #include "rtl/ustring.hxx"
      33                 :            : 
      34                 :            : #include "vcl/button.hxx"
      35                 :            : #include "vcl/menubtn.hxx"
      36                 :            : #include "vcl/fixed.hxx"
      37                 :            : #include "vcl/bitmapex.hxx"
      38                 :            : #include "vcl/toolbox.hxx"
      39                 :            : 
      40                 :            : #include "unotools/moduleoptions.hxx"
      41                 :            : #include "svtools/acceleratorexecute.hxx"
      42                 :            : 
      43                 :            : #include "com/sun/star/frame/XDispatchProvider.hpp"
      44                 :            : #include "com/sun/star/frame/XDesktop.hpp"
      45                 :            : #include "com/sun/star/frame/XFrame.hpp"
      46                 :            : #include "com/sun/star/frame/XTerminateListener.hpp"
      47                 :            : #include "com/sun/star/document/XEventListener.hpp"
      48                 :            : #include "com/sun/star/document/XEventBroadcaster.hpp"
      49                 :            : #include "com/sun/star/util/XURLTransformer.hpp"
      50                 :            : #include "com/sun/star/ui/dialogs/XFilePicker.hpp"
      51                 :            : #include "com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp"
      52                 :            : #include "com/sun/star/ui/dialogs/XFilterManager.hpp"
      53                 :            : #include "com/sun/star/ui/dialogs/XFolderPicker.hpp"
      54                 :            : #include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
      55                 :            : #include "com/sun/star/ui/dialogs/ExecutableDialogResults.hpp"
      56                 :            : 
      57                 :            : #include <set>
      58                 :            : 
      59                 :            : class MnemonicGenerator;
      60                 :            : 
      61                 :            : namespace framework
      62                 :            : {
      63                 :            :         // To get the transparent mouse-over look, the closer is actually a toolbox
      64                 :            :     // overload DataChange to handle style changes correctly
      65         [ -  + ]:          2 :     class DecoToolBox : public ToolBox
      66                 :            :     {
      67                 :            :         Size maMinSize;
      68                 :            : 
      69                 :            :         using Window::ImplInit;
      70                 :            :     public:
      71                 :            :                 DecoToolBox( Window* pParent, WinBits nStyle = 0 );
      72                 :            :                 DecoToolBox( Window* pParent, const ResId& rResId );
      73                 :            : 
      74                 :            :         void    DataChanged( const DataChangedEvent& rDCEvt );
      75                 :            : 
      76                 :            :         void    calcMinSize();
      77                 :            :         Size    getMinSize();
      78                 :            :     };
      79                 :            : 
      80                 :            :     class BackingWindow : public Window
      81                 :            :     {
      82 [ #  # ][ #  # ]:          0 :         struct LoadRecentFile
                 [ #  # ]
      83                 :            :         {
      84                 :            :             rtl::OUString                                                             aTargetURL;
      85                 :            :             com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >     aArgSeq;
      86                 :            :         };
      87                 :            : 
      88                 :            :         com::sun::star::uno::Reference<com::sun::star::frame::XDesktop>                  mxDesktop;
      89                 :            :         com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider >        mxDesktopDispatchProvider;
      90                 :            :         com::sun::star::uno::Reference<com::sun::star::frame::XFrame>                    mxFrame;
      91                 :            :         com::sun::star::uno::Reference<com::sun::star::document::XEventBroadcaster>      mxBroadcaster;
      92                 :            : 
      93                 :            :         ImageButton                     maWriterButton;
      94                 :            :         ImageButton                     maCalcButton;
      95                 :            :         ImageButton                     maImpressButton;
      96                 :            :         MenuButton                      maOpenButton;
      97                 :            :         ImageButton                     maDrawButton;
      98                 :            :         ImageButton                     maDBButton;
      99                 :            :         ImageButton                     maMathButton;
     100                 :            :         ImageButton                     maTemplateButton;
     101                 :            : 
     102                 :            :         DecoToolBox                     maToolbox;
     103                 :            : 
     104                 :            :         BitmapEx                        maBackgroundLeft;
     105                 :            :         BitmapEx                        maBackgroundMiddle;
     106                 :            :         BitmapEx                        maBackgroundRight;
     107                 :            : 
     108                 :            :         String                          maCreateString;
     109                 :            :         String                          maOpenString;
     110                 :            :         String                          maTemplateString;
     111                 :            : 
     112                 :            :         Font                            maTextFont;
     113                 :            :         Rectangle                       maControlRect;
     114                 :            : 
     115                 :            :         long                            mnColumnWidth[2];
     116                 :            :         long                            mnTextColumnWidth[2];
     117                 :            :         Color                           maLabelTextColor;
     118                 :            : 
     119                 :            :         Size                            maButtonImageSize;
     120                 :            : 
     121                 :            :         bool                            mbInitControls;
     122                 :            :         sal_Int32                       mnHideExternalLinks;
     123                 :            :         svt::AcceleratorExecute*        mpAccExec;
     124                 :            :         long                            mnBtnPos;
     125                 :            :         long                            mnBtnTop;
     126                 :            : 
     127                 :            :         PopupMenu*                      mpRecentMenu;
     128                 :            :         std::vector< LoadRecentFile >   maRecentFiles;
     129                 :            : 
     130                 :            :         static const int nItemId_Extensions = 1;
     131                 :            :         static const int nItemId_Info = 3;
     132                 :            :         static const int nItemId_TplRep = 4;
     133                 :            :         static const int nShadowTop = 37;
     134                 :            :         static const int nShadowLeft = 38;
     135                 :            :         static const int nShadowRight = 38;
     136                 :            :         static const int nShadowBottom = 38;
     137                 :            : 
     138                 :            :         void loadImage( const ResId& i_rId, PushButton& i_rButton );
     139                 :            : 
     140                 :            :         void layoutButton( const char* i_pURL, int nColumn, int i_nExtraWidth, const std::set<rtl::OUString>& i_rURLS,
     141                 :            :                            SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
     142                 :            :                            PushButton& i_rBtn,
     143                 :            :                            MnemonicGenerator& i_rMnemonicGen,
     144                 :            :                            const String& i_rStr = String()
     145                 :            :                            );
     146                 :            : 
     147                 :            :         void dispatchURL( const rtl::OUString& i_rURL,
     148                 :            :                           const rtl::OUString& i_rTarget = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ),
     149                 :            :                           const com::sun::star::uno::Reference< com::sun::star::frame::XDispatchProvider >& i_xProv = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchProvider >(),
     150                 :            :                           const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& = com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >()
     151                 :            :                           );
     152                 :            : 
     153                 :            :         DECL_LINK( ClickHdl, Button* );
     154                 :            :         DECL_LINK( SelectHdl, Button* );
     155                 :            :         DECL_LINK( ActivateHdl, Button* );
     156                 :            :         DECL_LINK( ToolboxHdl, void* );
     157                 :            : 
     158                 :            :         void initControls();
     159                 :            :         void initBackground();
     160                 :            :         void prepareRecentFileMenu();
     161                 :            :         public:
     162                 :            :         BackingWindow( Window* pParent );
     163                 :            :         ~BackingWindow();
     164                 :            : 
     165                 :            :         virtual void        Paint( const Rectangle& rRect );
     166                 :            :         virtual void        Resize();
     167                 :            :         virtual long        Notify( NotifyEvent& rNEvt );
     168                 :            :         virtual void        DataChanged( const DataChangedEvent& rDCEvt );
     169                 :            :         virtual void        GetFocus();
     170                 :            : 
     171                 :            :         void setOwningFrame( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame );
     172                 :            :     };
     173                 :            : 
     174                 :            : }
     175                 :            : 
     176                 :            : #endif
     177                 :            : 
     178                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10