LCOV - code coverage report
Current view: top level - libreoffice/sd/source/ui/inc - ViewShellBase.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 1 100.0 %
Date: 2012-12-27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef SD_VIEW_SHELL_BASE_HXX
      21             : #define SD_VIEW_SHELL_BASE_HXX
      22             : 
      23             : #include <com/sun/star/frame/XFrame.hpp>
      24             : 
      25             : #include "ViewShell.hxx"
      26             : 
      27             : #include "glob.hxx"
      28             : #include <sfx2/viewsh.hxx>
      29             : #include <sfx2/viewfac.hxx>
      30             : #include <memory>
      31             : #include <boost/shared_ptr.hpp>
      32             : #include <boost/scoped_ptr.hpp>
      33             : 
      34             : #include <set>
      35             : 
      36             : class SdDrawDocument;
      37             : class SfxRequest;
      38             : 
      39             : namespace sd { namespace tools {
      40             : class EventMultiplexer;
      41             : } }
      42             : 
      43             : namespace sd {
      44             : 
      45             : class DrawController;
      46             : class DrawDocShell;
      47             : class FormShellManager;
      48             : class ToolBarManager;
      49             : class ViewShell;
      50             : class ViewShellManager;
      51             : class ViewTabBar;
      52             : 
      53             : /** SfxViewShell descendant that the stacked Draw/Impress shells are
      54             :     based on.
      55             : 
      56             :     <p>The "base" part of the name does not mean that this is a base
      57             :     class of some class hierarchy.  It rather is the base of the
      58             :     stacked shells.</p>
      59             : 
      60             :     <p>This class starts as a new and relatively small class.  Over
      61             :     time as much code as possible should be moved from the stacked
      62             :     shells to this class.</p>
      63             : */
      64             : class ViewShellBase
      65             :     : public SfxViewShell
      66             : {
      67             : public:
      68             :     TYPEINFO();
      69             :     SFX_DECL_VIEWFACTORY(ViewShellBase);
      70           3 :     SFX_DECL_INTERFACE(SD_IF_SDVIEWSHELLBASE)
      71             : 
      72             :     /** This constructor is used by the view factory of the SFX macros.
      73             :         Note that LateInit() has to be called after the constructor
      74             :         terminates and before doing anything else.
      75             :     */
      76             :     ViewShellBase (
      77             :         SfxViewFrame *pFrame,
      78             :         SfxViewShell* pOldShell);
      79             : 
      80             :     virtual ~ViewShellBase (void);
      81             : 
      82             :     /** This method is part of the object construction.  It HAS to be called
      83             :         after the constructor has created a new object.
      84             :     */
      85             :     virtual void LateInit (const ::rtl::OUString& rsDefaultView);
      86             : 
      87             :     ::boost::shared_ptr<ViewShellManager> GetViewShellManager (void) const;
      88             : 
      89             :     /** Return the main view shell stacked on the called ViewShellBase
      90             :         object.  This is usually the view shell displayed in the center
      91             :         pane.
      92             :     */
      93             :     ::boost::shared_ptr<ViewShell> GetMainViewShell (void) const;
      94             : 
      95             :     /** When given a view frame this static method returns the
      96             :         corresponding sd::ViewShellBase object.
      97             :         @return
      98             :             When the SfxViewShell of the given frame is not a
      99             :             ViewShellBase object then NULL is returned.
     100             :     */
     101             :     static ViewShellBase* GetViewShellBase (SfxViewFrame* pFrame);
     102             : 
     103             :     DrawDocShell* GetDocShell (void) const;
     104             :     SdDrawDocument* GetDocument (void) const;
     105             : 
     106             :     /** Callback function for general slot calls.  At the moment these are
     107             :         slots for switching the pane docking windows on and off.
     108             :     */
     109             :     virtual void Execute (SfxRequest& rRequest);
     110             : 
     111             :     /** Callback function for retrieving item values related to certain
     112             :         slots.  This is the companion of Execute() and handles the slots
     113             :         concerned with showing the pane docking windows.
     114             :     */
     115             :     virtual void GetState (SfxItemSet& rSet);
     116             : 
     117             :     /* override these from SfxViewShell */
     118             :     virtual String GetSelectionText(sal_Bool);
     119             :     virtual sal_Bool HasSelection(sal_Bool) const;
     120             : 
     121             :     SvBorder GetBorder (bool bOuterResize);
     122             :     virtual void InnerResizePixel (const Point& rOrigin, const Size& rSize);
     123             :     virtual void OuterResizePixel (const Point& rOrigin, const Size& rSize);
     124             : 
     125             :     /** This call is forwarded to the main sub-shell.
     126             :     */
     127             :     virtual ErrCode DoVerb (long nVerb);
     128             : 
     129             :     /** Return a new renderer that can be used for example for printing the
     130             :         document.
     131             :     */
     132             :     virtual com::sun::star::uno::Reference<com::sun::star::view::XRenderable> GetRenderable (void);
     133             : 
     134             :     /// Forwarded to the print manager.
     135             :     virtual SfxPrinter* GetPrinter (sal_Bool bCreate = sal_False);
     136             : 
     137             :     /// Forwarded to the print manager.
     138             :     virtual sal_uInt16 SetPrinter (
     139             :         SfxPrinter* pNewPrinter,
     140             :         sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false);
     141             : 
     142             :     /// Forward methods to main sub shell.
     143             :     virtual void WriteUserDataSequence (
     144             :         ::com::sun::star::uno::Sequence <
     145             :         ::com::sun::star::beans::PropertyValue >&,
     146             :         sal_Bool bBrowse = sal_False);
     147             : 
     148             :     /** Pass the given properties to the main view shell.  After that we
     149             :         ensure that the right view shell type is displayed in the center
     150             :         pane.
     151             :     */
     152             :     virtual void ReadUserDataSequence (
     153             :         const ::com::sun::star::uno::Sequence <
     154             :         ::com::sun::star::beans::PropertyValue >&,
     155             :         sal_Bool bBrowse = sal_False);
     156             : 
     157             :     virtual void UIActivating( SfxInPlaceClient* );
     158             :     virtual void UIDeactivated( SfxInPlaceClient* );
     159             :     virtual void Activate (sal_Bool IsMDIActivate);
     160             :     virtual void Deactivate (sal_Bool IsMDIActivate);
     161             :     virtual void SetZoomFactor (
     162             :         const Fraction &rZoomX,
     163             :         const Fraction &rZoomY);
     164             :     virtual sal_uInt16 PrepareClose (sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False);
     165             :     virtual void WriteUserData (String&, sal_Bool bBrowse = sal_False);
     166             :     virtual void ReadUserData (const String&, sal_Bool bBrowse = sal_False);
     167             :     virtual SdrView* GetDrawView (void) const;
     168             :     virtual void AdjustPosSizePixel (const Point &rOfs, const Size &rSize);
     169             : 
     170             :     /** When <TRUE/> is given, then the mouse shape is set to hour glass (or
     171             :         whatever the busy shape looks like on the system.)
     172             :     */
     173             :     void SetBusyState (bool bBusy);
     174             : 
     175             :     /** Call this method when the controls of this view shell or the
     176             :         embedded sub shell need to be rearranged.  This is necessary
     177             :         e.g. when the border has been modified (UpdateBorder() calls this
     178             :         method).
     179             : 
     180             :         This method is like ResizePixel() with no arguments.
     181             :     */
     182             :     void Rearrange (void);
     183             : 
     184             :     /** Update the border that is set with SfxViewShell::SetBorderPixel().
     185             :         This is done by adding the border used by the ViewShellBase itself
     186             :         with the border used by the main view shell.
     187             : 
     188             :         @param bForce   if true the borders are also updated if old border
     189             :                         and new border are same.
     190             :     */
     191             :     void UpdateBorder ( bool bForce = false );
     192             : 
     193             :     /** With this method the UI controls can be turned on or off.  It is
     194             :         used by the FuSlideShow to hide the UI controls while showing a
     195             :         non-full-screen or in-window presentation in the center pane.
     196             :     */
     197             :     void ShowUIControls (bool bVisible);
     198             : 
     199             :     /** this method starts the presentation by
     200             :         executing the slot SID_PRESENTATION asynchronous */
     201             :     void StartPresentation();
     202             : 
     203             :     /** Return an event multiplexer.  It is a single class that forwards
     204             :         events from various sources.  This method must not be called before
     205             :         LateInit() has terminated.
     206             :     */
     207             :     ::boost::shared_ptr<tools::EventMultiplexer> GetEventMultiplexer (void);
     208             : 
     209             :     /** returns the complete area of the current view relative to the frame
     210             :         window
     211             :     */
     212             :     const Rectangle& getClientRectangle() const;
     213             : 
     214             :     ::boost::shared_ptr<ToolBarManager> GetToolBarManager (void) const;
     215             :     ::boost::shared_ptr<FormShellManager> GetFormShellManager (void) const;
     216             : 
     217             :     DrawController& GetDrawController (void) const;
     218             : 
     219             :     void SetViewTabBar (const ::rtl::Reference<ViewTabBar>& rViewTabBar);
     220             : 
     221             :     /** Return the window that is used by the main view shell to display its
     222             :         view and other UI elements, like scroll bars and rulers.  Ownership
     223             :         of that window remains with the called ViewShellBase object.
     224             :     */
     225             :     ::Window* GetViewWindow (void);
     226             : 
     227             :     /** returns the ui descriptive name for the given uno slot. The result is taken from the configuration
     228             :         and not cached, so do not use it excessive (f.e. in status updates) */
     229             :     ::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL ) const;
     230             : 
     231             : protected:
     232             :     osl::Mutex maMutex;
     233             : 
     234             :     virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
     235             : 
     236             :     virtual void InitializeFramework (void);
     237             : 
     238             : private:
     239             :     class Implementation;
     240             :     ::boost::scoped_ptr<Implementation> mpImpl;
     241             :     DrawDocShell* mpDocShell;
     242             :     SdDrawDocument* mpDocument;
     243             : 
     244             :     /** Determine from the properties of the document shell the initial type
     245             :         of the view shell in the center pane.  We use this method to avoid
     246             :         starting with the wrong type.  When ReadUserDataSequence() is called
     247             :         we check that the right type is active and change again if that is
     248             :         not the case because something went wrong.
     249             :     */
     250             :     ::rtl::OUString GetInitialViewShellType (void);
     251             : };
     252             : 
     253             : } // end of namespace sd
     254             : 
     255             : #endif
     256             : 
     257             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10