LCOV - code coverage report
Current view: top level - sd/source/ui/inc - ViewShell.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 10 17 58.8 %
Date: 2012-08-25 Functions: 7 14 50.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 4 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 SD_VIEW_SHELL_HXX
      30                 :            : #define SD_VIEW_SHELL_HXX
      31                 :            : 
      32                 :            : #include <rtl/ref.hxx>
      33                 :            : 
      34                 :            : #include <vcl/field.hxx>
      35                 :            : #include <sfx2/viewsh.hxx>
      36                 :            : #include <vcl/prntypes.hxx>
      37                 :            : #include <svtools/transfer.hxx>
      38                 :            : #include <comphelper/implementationreference.hxx>
      39                 :            : #include "glob.hxx"
      40                 :            : #include "pres.hxx"
      41                 :            : #include "cfgids.hxx"
      42                 :            : #include "View.hxx"
      43                 :            : #include "sddllapi.h"
      44                 :            : 
      45                 :            : #include <com/sun/star/drawing/XDrawSubController.hpp>
      46                 :            : #include <memory>
      47                 :            : #include <boost/shared_ptr.hpp>
      48                 :            : 
      49                 :            : class SdPage;
      50                 :            : class SvxRuler;
      51                 :            : class SdrOle2Obj;       // fuer die, die Teile von SVDRAW rausdefiniert haben
      52                 :            : class ScrollBarBox;
      53                 :            : class SdDrawDocument;
      54                 :            : class ScrollBar;
      55                 :            : 
      56                 :            : extern const String aEmptyStr;
      57                 :            : 
      58                 :            : namespace com { namespace sun { namespace star {
      59                 :            : namespace embed {
      60                 :            :     class XEmbeddedObject;
      61                 :            : }}}}
      62                 :            : 
      63                 :            : namespace css = ::com::sun::star;
      64                 :            : 
      65                 :            : namespace sd {
      66                 :            : 
      67                 :            : class DrawDocShell;
      68                 :            : class FrameView;
      69                 :            : class LayerTabBar;
      70                 :            : class View;
      71                 :            : class ViewShellBase;
      72                 :            : class Window;
      73                 :            : class WindowUpdater;
      74                 :            : class ZoomList;
      75                 :            : 
      76                 :            : #undef OUTPUT_DRAWMODE_COLOR
      77                 :            : #undef OUTPUT_DRAWMODE_CONTRAST
      78                 :            : 
      79                 :            : /** Base class of the stacked shell hierarchy.
      80                 :            : 
      81                 :            :     <p>Despite its name this class is not a descendant of SfxViewShell
      82                 :            :     but of SfxShell.  Its name expresses the fact that it acts like a
      83                 :            :     view shell.  Beeing a stacked shell rather then being an actual view shell
      84                 :            :     there can be several instances of this class that
      85                 :            :     <ul>
      86                 :            :     <li>all are based on the same view shell and thus show the same
      87                 :            :     document and share common view functionality and</li>
      88                 :            :     <li>are all visible at the same time and live in the same
      89                 :            :     frame.</li>
      90                 :            :     <ul></p>
      91                 :            : 
      92                 :            :     <p>This class replaces the former ViewShell class.</p>
      93                 :            : */
      94                 :            : class ViewShell
      95                 :            :     : public SfxShell
      96                 :            : {
      97                 :            : public:
      98                 :            :     enum ShellType {
      99                 :            :         ST_NONE,
     100                 :            :         ST_DRAW,         // The Draw application.
     101                 :            :         ST_IMPRESS,      // Main view of the Impress application.
     102                 :            :         ST_NOTES,
     103                 :            :         ST_HANDOUT,
     104                 :            :         ST_OUTLINE,
     105                 :            :         ST_SLIDE_SORTER,
     106                 :            :         ST_PRESENTATION,
     107                 :            :         ST_TASK_PANE
     108                 :            :     };
     109                 :            :     static const int MAX_HSPLIT_CNT = 1;
     110                 :            :     static const int MAX_VSPLIT_CNT = 1;
     111                 :            :     static const int MIN_SCROLLBAR_SIZE = 50;
     112                 :            : 
     113                 :            :     static const sal_uLong OUTPUT_DRAWMODE_COLOR = DRAWMODE_DEFAULT;
     114                 :            :     static const sal_uLong OUTPUT_DRAWMODE_GRAYSCALE
     115                 :            :         = DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL
     116                 :            :         | DRAWMODE_BLACKTEXT | DRAWMODE_GRAYBITMAP
     117                 :            :         | DRAWMODE_GRAYGRADIENT;
     118                 :            :     static const int  OUTPUT_DRAWMODE_BLACKWHITE
     119                 :            :         = DRAWMODE_BLACKLINE | DRAWMODE_BLACKTEXT
     120                 :            :         | DRAWMODE_WHITEFILL | DRAWMODE_GRAYBITMAP
     121                 :            :         | DRAWMODE_WHITEGRADIENT;
     122                 :            :     static const int OUTPUT_DRAWMODE_CONTRAST
     123                 :            :         = DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL
     124                 :            :         | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT;
     125                 :            : 
     126                 :            :     TYPEINFO();
     127                 :            : 
     128                 :            :     ViewShell (
     129                 :            :         SfxViewFrame *pFrame,
     130                 :            :         ::Window* pParentWindow,
     131                 :            :         ViewShellBase& rViewShellBase,
     132                 :            :         bool bAllowCenter = true);
     133                 :            :     virtual ~ViewShell (void);
     134                 :            : 
     135                 :            :     /** The Init method has to be called from the outside directly
     136                 :            :         after a new object of this class has been created.  It can be
     137                 :            :         used for that part of the initialisation that can be run only
     138                 :            :         after the creation of the new object is finished.  This
     139                 :            :         includes registration as listener at event broadcasters.
     140                 :            : 
     141                 :            :         Derived classes should call this method at the head of their
     142                 :            :         Init() methods.
     143                 :            :         @param bIsMainViewShell
     144                 :            :             This flag tells the Init() method whether the new ViewShell will
     145                 :            :             be the main view shell.
     146                 :            :     */
     147                 :            :     virtual void Init (bool bIsMainViewShell);
     148                 :            : 
     149                 :            :     /** The Exit() method has to be called before the destructor so that the
     150                 :            :         view shell is still a valid object and can safely call methods that
     151                 :            :         rely on that.
     152                 :            :     */
     153                 :            :     virtual void Exit (void);
     154                 :            : 
     155                 :            :     void Cancel();
     156                 :            : 
     157                 :            :     /** Return the window that is the parent of all controls of this view
     158                 :            :         shell.  This may or may not be the window of the frame.
     159                 :            :     */
     160                 :            :     inline ::Window* GetParentWindow (void) const;
     161                 :            : 
     162                 :            :     inline ::sd::View* GetView (void) const;
     163                 :            :     inline SdrView* GetDrawView (void) const;
     164                 :            :     SD_DLLPUBLIC DrawDocShell* GetDocSh (void) const;
     165                 :            : 
     166                 :            :     SdDrawDocument*  GetDoc (void) const;
     167                 :            : 
     168                 :            :     SD_DLLPUBLIC SfxViewFrame* GetViewFrame (void) const;
     169                 :            : 
     170                 :            :     /** The active window is usually the mpContentWindow.  When there is a
     171                 :            :         show running then the active window is a ShowWindow.
     172                 :            :     */
     173                 :            :     ::sd::Window* GetActiveWindow (void) const;
     174                 :            : 
     175                 :            :     /** Set the active window.  When the shell is displayed in the center
     176                 :            :         pane then the window of the ViewShellBase is also set to the given
     177                 :            :         window.
     178                 :            :     */
     179                 :            :     void SetActiveWindow (::sd::Window* pWindow);
     180                 :            : 
     181                 :            :     /** Return the rectangle that encloses all windows of the view.  That
     182                 :            :         excludes the controls in the frame like rulers, scroll bars, tab
     183                 :            :         bar, and buttons.
     184                 :            :         @return
     185                 :            :             The rectangle is returned in screen coordinates, i.e. pixel
     186                 :            :             values relative to the upper left corner of the screen?.
     187                 :            :     */
     188                 :            :     const Rectangle& GetAllWindowRect (void);
     189                 :            : 
     190                 :            :     // Mouse- & Key-Events
     191                 :            :     virtual void PrePaint();
     192                 :            :     virtual void Paint (const Rectangle& rRect, ::sd::Window* pWin);
     193                 :            :     virtual sal_Bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
     194                 :            :     virtual void MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin);
     195                 :            :     virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
     196                 :            :     virtual void MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin);
     197                 :            :     virtual void Command(const CommandEvent& rCEvt, ::sd::Window* pWin);
     198                 :            :     virtual sal_Bool RequestHelp( const HelpEvent& rEvt, ::sd::Window* pWin );
     199                 :            :     virtual long Notify( NotifyEvent& rNEvt, ::sd::Window* pWin );
     200                 :            : 
     201                 :            :     virtual bool HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWin);
     202                 :            : 
     203                 :            :     virtual void Draw(OutputDevice &rDev, const Region &rReg);
     204                 :            : 
     205                 :            :     virtual void SetUIUnit(FieldUnit eUnit);
     206                 :            :     virtual void SetDefTabHRuler( sal_uInt16 nDefTab );
     207                 :            : 
     208                 :            :     sal_Bool HasRuler (void);
     209                 :            :     void SetRuler(sal_Bool bRuler);
     210                 :            : 
     211                 :            :     /** Set internal values of all scroll bars that determine thumb size and
     212                 :            :         position.  The external values like size and position of the scroll
     213                 :            :         bar controls are not modified.
     214                 :            :     */
     215                 :            :     virtual void UpdateScrollBars (void);
     216                 :            :     void    Scroll(long nX, long nY);
     217                 :            :     void    ScrollLines(long nX, long nY);
     218                 :            :     virtual void    SetZoom(long nZoom);
     219                 :            :     virtual void    SetZoomRect(const Rectangle& rZoomRect);
     220                 :            :     void    InitWindows(const Point& rViewOrigin, const Size& rViewSize,
     221                 :            :                         const Point& rWinPos, sal_Bool bUpdate = sal_False);
     222                 :            :     void    InvalidateWindows();
     223                 :            :     /** This method is still used by the OutlineViewShell to update the
     224                 :            :         model according to the content of the outline view.  This in turn
     225                 :            :         updates the previews in the slide sorter.
     226                 :            :     */
     227                 :            :      virtual void UpdatePreview (SdPage* pPage, sal_Bool bInit = sal_False);
     228                 :            : 
     229                 :            :     void    DrawMarkRect(const Rectangle& rRect) const;
     230                 :            : 
     231                 :            :     void    ExecReq( SfxRequest &rReq );
     232                 :            : 
     233                 :            :     ZoomList* GetZoomList (void);
     234                 :            : 
     235                 :            :     FrameView* GetFrameView (void);
     236                 :            :     /** Setting a frame view triggers ReadFrameViewData() for the new
     237                 :            :         frame.
     238                 :            :         @param pFrameView
     239                 :            :             The new frame view that replaces the old one.
     240                 :            :     */
     241                 :            :     void SetFrameView (FrameView* pFrameView);
     242                 :            :     virtual void  ReadFrameViewData(FrameView* pView);
     243                 :            :     virtual void  WriteFrameViewData();
     244                 :            :     virtual void  WriteUserData(String& rString);
     245                 :            :     virtual void  ReadUserData(const String& rString);
     246                 :            : 
     247                 :            :     virtual sal_Bool  ActivateObject(SdrOle2Obj* pObj, long nVerb);
     248                 :            : 
     249                 :            :     /** @returns
     250                 :            :             current or selected page or 0. This method
     251                 :            :             will fail in master page mode.
     252                 :            : 
     253                 :            :         @deprecated, please use getCurrentPage();
     254                 :            :     */
     255                 :            :     virtual SdPage* GetActualPage() = 0;
     256                 :            : 
     257                 :            :     /** @returns
     258                 :            :             current or selected page or 0.
     259                 :            :     */
     260                 :            :     virtual SdPage* getCurrentPage() const = 0;
     261                 :            : 
     262                 :          0 :     FunctionReference GetOldFunction() const { return mxOldFunction; }
     263                 :        130 :     bool HasOldFunction() const { return mxOldFunction.is(); }
     264                 :      22649 :     FunctionReference GetCurrentFunction() const { return mxCurrentFunction; }
     265 [ +  - ][ -  + ]:        284 :     bool HasCurrentFunction( sal_uInt16 nSID ) { return mxCurrentFunction.is() && (mxCurrentFunction->GetSlotID() == nSID ); }
     266                 :      17430 :     bool HasCurrentFunction() { return mxCurrentFunction.is(); }
     267                 :            : 
     268                 :            :     void SetCurrentFunction(const FunctionReference& xFunction);
     269                 :            :     void SetOldFunction(const FunctionReference& xFunction);
     270                 :            :     void DeactivateCurrentFunction( bool bPermanent = false );
     271                 :            : 
     272                 :            :     void    SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
     273                 :            :                             long nLeft, long nRight, long nUpper, long nLower,
     274                 :            :                             sal_Bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin,
     275                 :            :                             sal_Bool bBackgroundFullSize );
     276                 :            : 
     277                 :          0 :     void    SetStartShowWithDialog( sal_Bool bIn = sal_True ) { mbStartShowWithDialog = bIn; }
     278                 :          0 :     sal_Bool    IsStartShowWithDialog() const { return mbStartShowWithDialog; }
     279                 :            : 
     280                 :          0 :     sal_uInt16 GetPrintedHandoutPageNum (void) const { return mnPrintedHandoutPageNum; }
     281                 :          0 :     void SetPrintedHandoutPageNum (sal_uInt16 nPageNumber) {mnPrintedHandoutPageNum=nPageNumber; }
     282                 :            : 
     283                 :          0 :     sal_uInt16 GetPrintedHandoutPageCount(void) const { return mnPrintedHandoutPageCount; }
     284                 :          0 :     void SetPrintedHandoutPageCount (sal_uInt16 nPageCount) {mnPrintedHandoutPageCount=nPageCount; }
     285                 :            : 
     286                 :            :     virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
     287                 :            : 
     288                 :            :     void GetMenuState(SfxItemSet& rSet);
     289                 :            : 
     290                 :            :     virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
     291                 :            :                                  ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer );
     292                 :            :     virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
     293                 :            :                                   ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer );
     294                 :            : 
     295                 :            :     virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
     296                 :            :     virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
     297                 :            : 
     298                 :            :     /** this method is called when the visible area of the view from this viewshell is changed */
     299                 :            :     virtual void VisAreaChanged(const Rectangle& rRect);
     300                 :            : 
     301                 :            :     /** Create an accessible object representing the specified window.
     302                 :            :         Overload this method to provide view mode specific objects.  The
     303                 :            :         default implementation returns an empty reference.
     304                 :            :         @param pWindow
     305                 :            :             Make the document displayed in this window accessible.
     306                 :            :         @return
     307                 :            :             This default implementation returns an empty reference.
     308                 :            :     */
     309                 :            :     virtual ::com::sun::star::uno::Reference<
     310                 :            :         ::com::sun::star::accessibility::XAccessible>
     311                 :            :         CreateAccessibleDocumentView (::sd::Window* pWindow);
     312                 :            : 
     313                 :            :     void SetWinViewPos(const Point& rWinPos, bool bUpdate);
     314                 :            :     Point GetWinViewPos() const;
     315                 :            :     Point GetViewOrigin() const;
     316                 :            : 
     317                 :            :     /** Return the window updater of this view shell.
     318                 :            :         @return
     319                 :            :             In rare circumstances the returned pointer may be <null/>,
     320                 :            :             i.e. when no memory is available anymore.
     321                 :            :     */
     322                 :            :     ::sd::WindowUpdater* GetWindowUpdater (void) const;
     323                 :            : 
     324                 :            :     /** Return the border that is drawn arround the actual document view.
     325                 :            :         The border contains typically rulers and scroll bars.
     326                 :            :         @param bOuterResize
     327                 :            :             When this flag is <TRUE/> then the border is used for an
     328                 :            :             OuterResizePixel(), i.e. there is a given window size and the
     329                 :            :             border elements are placed inside so that the document view has
     330                 :            :             the given window size minus the border.
     331                 :            :             When the flag is <FALSE/> then the border is used for an
     332                 :            :             InnerResizePixel(), i.e. the document view has a given size and
     333                 :            :             the border is placed outside.  In this scenario the parent
     334                 :            :             window has the size of the document view plus the border.
     335                 :            :     */
     336                 :            :     SvBorder GetBorder (bool bOuterResize);
     337                 :            : 
     338                 :            :     /** Notify the view shell that its parent window has been resized.
     339                 :            :         The ViewShell places and resizes its UI elements accordingly.
     340                 :            :         The new size can be obtained from the parent window.
     341                 :            :     */
     342                 :            :     virtual void Resize (void);
     343                 :            : 
     344                 :            :     /** Set the position and size of the area which contains the GUI
     345                 :            :         elements like rulers, sliders, and buttons as well as the document
     346                 :            :         view.  Both size and position are expected to be in pixel
     347                 :            :         coordinates.  The positions and sizes of the mentioned GUI elements
     348                 :            :         are updated as well.
     349                 :            : 
     350                 :            :         <p> This method is implemented by first setting copying the given
     351                 :            :         values to internal variables and then calling the
     352                 :            :         <type>ArrangeGUIElements</type> method which performs the actual
     353                 :            :         work of sizeing and arranging the UI elements accordingly.</p>
     354                 :            :         @param rPos
     355                 :            :             The position of the enclosing window relative to the document
     356                 :            :             window.  This is only interesting if a Draw/Impress document
     357                 :            :             view is embedded as OLE object into another document view.  For
     358                 :            :             normal documents this position is (0,0).
     359                 :            :         @param rSize
     360                 :            :             The new size in pixel.
     361                 :            :     */
     362                 :            :     // This is to be replaced by Resize.
     363                 :            :     //  virtual void AdjustPosSizePixel(const Point &rPos, const Size &rSize);
     364                 :            : 
     365                 :            :     /** Set position and size of the GUI elements that are controllerd by
     366                 :            :         the view shell like rulers and scroll bars as well as the actual
     367                 :            :         document view according to the position and size that were given
     368                 :            :         with the last Resize() call.
     369                 :            :     */
     370                 :            :     virtual void ArrangeGUIElements (void);
     371                 :            : 
     372                 :            :     //  virtual void OuterResizePixel(const Point &rPos, const Size &rSize);
     373                 :            :     //  virtual void InnerResizePixel(const Point &rPos, const Size &rSize);
     374                 :            : 
     375                 :            :     ViewShellBase& GetViewShellBase (void) const;
     376                 :            : 
     377                 :            :     /** Return <TRUE/> when the called view shell is the main sub shell of
     378                 :            :         its ViewShellBase object, i.e. is display in the center pane.  This
     379                 :            :         convenience function is equivalent to comparing the this pointer to
     380                 :            :         the result of ViewShellBase::GetViewShell(PT_CENTER).
     381                 :            :     */
     382                 :            :     bool IsMainViewShell (void) const;
     383                 :            : 
     384                 :            :     /** Set or reset the flag that indicates whether the called shell is the
     385                 :            :         one displayed in the center pane.  By default this flag is set to
     386                 :            :         <FALSE/>.  For the main view shell it thus has to be set to <TRUE/>.
     387                 :            :     */
     388                 :            :     void SetIsMainViewShell (bool bIsMainViewShell);
     389                 :            : 
     390                 :            :     /** Return a sub controller that implements the view shell specific
     391                 :            :         part of the DrawController.
     392                 :            :     */
     393                 :            :     virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void) = 0;
     394                 :            : 
     395                 :            :     /** Return the type of the shell.
     396                 :            :     */
     397                 :            :     virtual ShellType GetShellType (void) const;
     398                 :            : 
     399                 :            :     /** This method is more or less an alias to Deactivate().  It is called
     400                 :            :         before an object of this class is taken from the stack of view
     401                 :            :         shells.
     402                 :            : 
     403                 :            :         <p>When this method is not called before a view shell is taken from
     404                 :            :         a stack then the Deactivate() call from the SFX as a response to
     405                 :            :         RemoveSubShell() comes to late when the view shell is not on the
     406                 :            :         stack anymore.</p>
     407                 :            :     */
     408                 :            :     virtual void Shutdown (void);
     409                 :            : 
     410                 :            :     /** This function is called from the underlying ViewShellBase
     411                 :            :         object to handle a verb execution request.
     412                 :            :     */
     413                 :            :     virtual ErrCode DoVerb (long nVerb);
     414                 :            : 
     415                 :            :     virtual void UIActivating( SfxInPlaceClient* );
     416                 :            :     virtual void UIDeactivated( SfxInPlaceClient* );
     417                 :            : 
     418                 :            :     /** Show controls of the UI or hide them, depending on the given flag.
     419                 :            :         As a result the border is adapted.
     420                 :            :     */
     421                 :            :     virtual void ShowUIControls (bool bVisible = true);
     422                 :            :     sal_Bool IsPageFlipMode(void) const;
     423                 :            : 
     424                 :            :     /** Set the given window as new parent window.  This is not possible for
     425                 :            :         all views, so the return value tells the caller if the relocation
     426                 :            :         was successfull.
     427                 :            :     */
     428                 :            :     virtual bool RelocateToParentWindow (::Window* pParentWindow);
     429                 :            : 
     430                 :            :     void AdaptDefaultsForChart(
     431                 :            :         const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > & xEmbObj );
     432                 :            : 
     433                 :            :     /** Depending on the given request create a new page or duplicate an
     434                 :            :         existing one.  A new page is created behind the given slide.
     435                 :            :         @param rRequest
     436                 :            :             The request as passed to an Execute() method.  Its arguments are
     437                 :            :             evaluated.  Its slot id determines whether to create or
     438                 :            :             duplicate a slide.
     439                 :            :         @param pPage
     440                 :            :             This page is either duplicated or becomes the predecessor of the
     441                 :            :             new slide.  If NULL a duplication request is ignored.  A new
     442                 :            :             slide is inserted as first slide.
     443                 :            :         @param nInsertPosition
     444                 :            :             When -1 (the default) then insert after pPage.  Otherwise insert
     445                 :            :             before the given index (of a standard page).
     446                 :            :         @return
     447                 :            :             The new slide is returned.  If for some reason a new page can
     448                 :            :             not be created then NULL is returned.
     449                 :            :     */
     450                 :            :     virtual SdPage* CreateOrDuplicatePage (
     451                 :            :         SfxRequest& rRequest,
     452                 :            :         PageKind ePageKind,
     453                 :            :         SdPage* pPage,
     454                 :            :         const sal_Int32 nInsertPosition = -1);
     455                 :            : 
     456                 :            : 
     457                 :            :     class Implementation;
     458                 :            : 
     459                 :            : protected:
     460                 :            :     /** must be called in the beginning of each subclass d'tor.
     461                 :            :         disposes and clears both current and old function. */
     462                 :            :     void DisposeFunctions();
     463                 :            : 
     464                 :            :     friend class ViewShellBase;
     465                 :            : 
     466                 :            :     /** Window inside the rulers and scroll bars that shows a view of the
     467                 :            :         document.
     468                 :            :     */
     469                 :            : 
     470                 :            :     ::boost::shared_ptr<sd::Window> mpContentWindow;
     471                 :            : 
     472                 :            :     /// Horizontal scroll bar for the current slide is displayed when needed.
     473                 :            :     ::boost::shared_ptr<ScrollBar> mpHorizontalScrollBar;
     474                 :            :     /// Vertical scroll bar for whole document is always visible.
     475                 :            :     ::boost::shared_ptr<ScrollBar> mpVerticalScrollBar;
     476                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     477                 :            :     /// Horizontal ruler is not shown by default.
     478                 :            :     ::std::auto_ptr<SvxRuler> mpHorizontalRuler;
     479                 :            :     /// Vertical ruler is not shown by default.
     480                 :            :     ::std::auto_ptr<SvxRuler> mpVerticalRuler;
     481                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     482                 :            :     /// Filler of the little square enclosed by the two scroll bars.
     483                 :            :     ::boost::shared_ptr<ScrollBarBox> mpScrollBarBox;
     484                 :            :     /// Layer tab bar.
     485                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     486                 :            :     ::std::auto_ptr<LayerTabBar> mpLayerTabBar;
     487                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     488                 :            : 
     489                 :            :     /// This flag controls whether the rulers are visible.
     490                 :            :     bool mbHasRulers;
     491                 :            : 
     492                 :            :     /// The active window.
     493                 :            :     ::sd::Window* mpActiveWindow;
     494                 :            :     ::sd::View* mpView;
     495                 :            :     FrameView*  mpFrameView;
     496                 :            : 
     497                 :            :     FunctionReference   mxCurrentFunction;
     498                 :            :     FunctionReference   mxOldFunction;
     499                 :            :     ZoomList*   mpZoomList;
     500                 :            : 
     501                 :            :     Point       maViewPos;
     502                 :            :     Size        maViewSize;
     503                 :            :     Size        maScrBarWH;
     504                 :            : 
     505                 :            :     sal_Bool        mbCenterAllowed;          // wird an Fenster weitergegeben
     506                 :            : 
     507                 :            :     sal_Bool        mbStartShowWithDialog;  // Praesentation wurde ueber Dialog gestartet
     508                 :            :     sal_uInt16      mnPrintedHandoutPageNum; // Page number of the handout page that is to be printed.
     509                 :            :     sal_uInt16      mnPrintedHandoutPageCount; // Page count of the handout pages that are to be printed.
     510                 :            : 
     511                 :            :     //af    sal_Bool        bPrintDirectSelected;       // Print only selected objects in direct print
     512                 :            :     //afString      sPageRange;                 // pagerange if selected objects in direct print
     513                 :            : 
     514                 :            :     /** Area covered by all windows, i.e. the area of the parent window
     515                 :            :         without the controls at the borders like rulers, scroll bars, tab
     516                 :            :         bar, buttons.
     517                 :            :         This rectangle may be set in window coordinates (i.e. pixel values
     518                 :            :         relative to the parent window).  It is transformed by every call to
     519                 :            :         GetAllWindowRectangle() into screen coordinates (relative to the
     520                 :            :         upper left corner of the screen.
     521                 :            :     */
     522                 :            :     Rectangle maAllWindowRectangle;
     523                 :            : 
     524                 :            :     /// The type of the shell.  Returned by GetShellType().
     525                 :            :     ShellType meShellType;
     526                 :            : 
     527                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     528                 :            :     ::std::auto_ptr<Implementation> mpImpl;
     529                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     530                 :            : 
     531                 :            :     // Support methods for centralized UNDO/REDO
     532                 :            :     virtual ::svl::IUndoManager* ImpGetUndoManager (void) const;
     533                 :            :     void ImpGetUndoStrings(SfxItemSet &rSet) const;
     534                 :            :     void ImpGetRedoStrings(SfxItemSet &rSet) const;
     535                 :            :     void ImpSidUndo(sal_Bool bDrawViewShell, SfxRequest& rReq);
     536                 :            :     void ImpSidRedo(sal_Bool bDrawViewShell, SfxRequest& rReq);
     537                 :            : 
     538                 :            :     DECL_LINK( HScrollHdl, ScrollBar * );
     539                 :            :     DECL_LINK( VScrollHdl, ScrollBar * );
     540                 :            : 
     541                 :            :     // virt. Scroll-Handler, hier koennen sich abgeleitete Klassen einklinken
     542                 :            :     virtual long VirtHScrollHdl(ScrollBar* pHScroll);
     543                 :            :     virtual long VirtVScrollHdl(ScrollBar* pVScroll);
     544                 :            : 
     545                 :            :     // virtuelle Funktionen fuer Lineal-Handling
     546                 :            :     virtual SvxRuler* CreateHRuler(::sd::Window* pWin, sal_Bool bIsFirst);
     547                 :            :     virtual SvxRuler* CreateVRuler(::sd::Window* pWin);
     548                 :            :     virtual void UpdateHRuler();
     549                 :            :     virtual void UpdateVRuler();
     550                 :            : 
     551                 :            :     // Zeiger auf ein zusaetzliches Control im horizontalen ScrollBar
     552                 :            :     // abgeleiteter Klassen (z.B. ein TabBar) zurueckgeben
     553                 :            :     virtual long GetHCtrlWidth();
     554                 :            : 
     555                 :            :     virtual void Activate(sal_Bool IsMDIActivate);
     556                 :            :     virtual void Deactivate(sal_Bool IsMDIActivate);
     557                 :            : 
     558                 :            :     virtual void SetZoomFactor( const Fraction &rZoomX,
     559                 :            :                                 const Fraction &rZoomY );
     560                 :            : 
     561                 :            :     /**
     562                 :            :         This must be called after the ctor, but before anything else.
     563                 :            :         It's the part of construction that is dependent
     564                 :            :         on showing the top-level window.
     565                 :            : 
     566                 :            :         Showing a window with a11y enabled causes various callbacks
     567                 :            :         to be triggered.
     568                 :            : 
     569                 :            :         Due to the "virtual methods are not virtual during constructors"
     570                 :            :         problem, this is a disaster to call from the ctor
     571                 :            : 
     572                 :            :         i.e. construct calls Show, and if a11y is enabled this
     573                 :            :         reenters the not-fully constructed object and calls
     574                 :            :         CreateAccessibleDocumentView, so if construct is called
     575                 :            :         from the ctor then if a derived class is contructed the base-cass
     576                 :            :         CreateAccessibleDocumentView is used, not the derived
     577                 :            :         CreateAccessibleDocumentView. i.e. run smoketest under a11y with
     578                 :            :         debugging assertions enabled
     579                 :            :     */
     580                 :            :     void doShow();
     581                 :            : 
     582                 :            : private:
     583                 :            :     ::Window* mpParentWindow;
     584                 :            :     /** This window updater is used to keep all relevant windows up to date
     585                 :            :         with reference to the digit langugage used to display digits in text
     586                 :            :         shapes.
     587                 :            :     */
     588                 :            :     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     589                 :            :     ::std::auto_ptr< ::sd::WindowUpdater> mpWindowUpdater;
     590                 :            :     SAL_WNODEPRECATED_DECLARATIONS_POP
     591                 :            : 
     592                 :            :     /** Code common to all constructors.  It generally is a bad idea
     593                 :            :         to call this function from outside a constructor.
     594                 :            :     */
     595                 :            :     void construct (void);
     596                 :            : 
     597                 :            :     DECL_LINK(FrameWindowEventListener, VclSimpleEvent*);
     598                 :            : 
     599                 :            :     /** Create the rulers.
     600                 :            :     */
     601                 :            :     void SetupRulers (void);
     602                 :            : };
     603                 :            : 
     604                 :            : 
     605                 :            : 
     606                 :            : 
     607                 :       3704 : ::Window* ViewShell::GetParentWindow (void) const
     608                 :            : {
     609                 :       3704 :     return mpParentWindow;
     610                 :            : }
     611                 :            : 
     612                 :       5492 : ::sd::View* ViewShell::GetView (void) const
     613                 :            : {
     614                 :       5492 :     return mpView;
     615                 :            : }
     616                 :            : 
     617                 :        418 : SdrView* ViewShell::GetDrawView (void) const
     618                 :            : {
     619                 :        418 :     return static_cast<SdrView*>(mpView);
     620                 :            : }
     621                 :            : 
     622                 :            : } // end of namespace sd
     623                 :            : 
     624                 :            : #endif
     625                 :            : 
     626                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10