Files
libreoffice/sd/source/ui/inc/FrameView.hxx

217 lines
9.1 KiB
C++
Raw Normal View History

2010-10-27 12:53:26 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SD_SOURCE_UI_INC_FRAMEVIEW_HXX
#define INCLUDED_SD_SOURCE_UI_INC_FRAMEVIEW_HXX
#include "ViewShell.hxx"
#include <svx/svdview.hxx>
#include <pres.hxx>
class SdDrawDocument;
class SdOptions;
namespace sd {
/**
* View for MDIFrame
*/
2011-06-13 05:51:12 +02:00
class SD_DLLPUBLIC FrameView
: public SdrView
{
public:
FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView = nullptr );
FrameView(const FrameView& rFrameView);
virtual ~FrameView() override;
void Connect();
void Disconnect();
void Update(SdOptions const * pOptions);
void SetStandardHelpLines(const SdrHelpLineList& rHelpLines)
{ maStandardHelpLines = rHelpLines; }
const SdrHelpLineList& GetStandardHelpLines() { return maStandardHelpLines; }
void SetNotesHelpLines(const SdrHelpLineList& rHelpLines)
{ maNotesHelpLines = rHelpLines; }
const SdrHelpLineList& GetNotesHelpLines() { return maNotesHelpLines; }
void SetHandoutHelpLines(const SdrHelpLineList& rHelpLines)
{ maHandoutHelpLines = rHelpLines; }
const SdrHelpLineList& GetHandoutHelpLines() { return maHandoutHelpLines; }
void SetVisibleLayers(const SdrLayerIDSet& rVisibleLayers)
{ maVisibleLayers = rVisibleLayers; }
const SdrLayerIDSet& GetVisibleLayers() { return maVisibleLayers; }
void SetLockedLayers(const SdrLayerIDSet& rLockedLayers)
{ maLockedLayers = rLockedLayers; }
const SdrLayerIDSet& GetLockedLayers() { return maLockedLayers; }
void SetPrintableLayers(const SdrLayerIDSet& rPrintableLayers)
{ maPrintableLayers = rPrintableLayers; }
const SdrLayerIDSet& GetPrintableLayers() { return maPrintableLayers; }
void SetRuler(const bool bRulerOn)
{ mbRuler = bRulerOn; }
bool HasRuler() const { return mbRuler; }
void SetNoColors(const bool bNoCol)
{ mbNoColors = bNoCol; }
bool IsNoColors() const { return mbNoColors; }
void SetNoAttribs(const bool bNoAttr)
{ mbNoAttribs = bNoAttr; }
bool IsNoAttribs() const { return mbNoAttribs; }
void SetVisArea(const ::tools::Rectangle& rVisArea)
{ maVisArea = rVisArea; }
const ::tools::Rectangle& GetVisArea() { return maVisArea; }
void SetPageKind(PageKind eKind) { mePageKind = eKind; }
2008-10-10 13:02:43 +00:00
PageKind GetPageKind() const { return mePageKind; }
/** is used in FrameView::ReadUserDataSequence() only to store the
page kind that was selected while last saving this document */
void SetPageKindOnLoad(PageKind eKind) { mePageKindOnLoad = eKind; }
/** can be used to get the page kind that was selected on last save of this document */
2008-10-10 13:02:43 +00:00
PageKind GetPageKindOnLoad() const { return mePageKindOnLoad; }
2011-06-13 05:51:12 +02:00
void SetSelectedPage (sal_uInt16 nPage);
sal_uInt16 GetSelectedPage () const { return mnSelectedPage;}
/** is used in FrameView::ReadUserDataSequence() only to store the
page that was selected while last saving this document */
void SetSelectedPageOnLoad (sal_uInt16 nPage) { mnSelectedPageOnLoad = nPage; }
/** can be used to get the page that was selected on last save of this document */
sal_uInt16 GetSelectedPageOnLoad () const { return mnSelectedPageOnLoad; }
Impress: Rework the way the display modes are presented. TODO: take into account remarks from Gerrit New combo to select display mode among: - Slide edition (Normal) - Outline - Notes - Slide sorter - Slide master - Notes master - Handout (master, as we are designing the template used to generate the handout) The combo is based on uno command .uno:DisplayMode Center pane tabs are hidden by default. A new uno dispatch command (.uno:ToggleTabBarVisibility) is available to show/hide this tab bar. Modified uno dispatch commands: No uno name has been modified. .uno:DiaMode : SID_DIAMODE renamed SID_SLIDER_SORTER_MODE .uno:OutlineMode SID_OUTLINEMODE renamed SID_OUTLINE_MODE .uno:NotesMode No change .uno:HandoutMode SID_HANDOUT_MODE renamed SID_HANDOUT_MASTER_MODE All internal code also considers the edit mode as master .uno:SlideMasterPage SID_SLIDE_MASTERPAGE renamed SID_SLIDE_MASTER_MODE If the input parameter SfxBoolItem Isactive is true or not provided, activates Slide Master mode. If parameter is false, activates the "Normal" (slide editing) mode. .uno:NotesMasterPage SID_NOTES_MASTERPAGE renamed SID_NOTES_MASTER_MODE If the input parameter SfxBoolItem Isactive is true or not provided, activates Notes Master mode. If parameter is false, activates the "Notes" mode. Modified behaviours: Now only one mode can be chosen. It is possible to navigate from a mode to any other mode. Previous behaviour: the following navigation Normal -> Slide Master -> Notes -> Normal was displaying slide master. It was required to activate Normal once more to get back to normal. Now the same commands will display the requested mode. Still to come (at least): - Fix reopen the last display mode. - Center pane tabs are now presenting all buttons for all modes (TODO). Change-Id: I11ab59d2f3caa9149260c5e55d44d598d0ce3390 Reviewed-on: https://gerrit.libreoffice.org/16723 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
2015-07-10 17:02:44 +02:00
void SetViewShEditMode(EditMode eMode);
EditMode GetViewShEditMode ();
/** Remember the edit mode of the main view shell at the time when the
document is loaded.
*/
void SetViewShEditModeOnLoad (const EditMode eMode);
/** Return the value of the edit mode as it was when the document was
loaded.
*/
EditMode GetViewShEditModeOnLoad() const { return meEditModeOnLoad;}
void SetLayerMode(bool bMode)
{ mbLayerMode = bMode; }
bool IsLayerMode() const { return mbLayerMode; }
void SetQuickEdit(bool bQEdit)
{ mbQuickEdit = bQEdit; }
bool IsQuickEdit() const { return mbQuickEdit; }
void SetDoubleClickTextEdit( bool bOn ) { mbDoubleClickTextEdit = bOn; }
bool IsDoubleClickTextEdit() const { return mbDoubleClickTextEdit; }
void SetClickChangeRotation( bool bOn ) { mbClickChangeRotation = bOn; }
bool IsClickChangeRotation() const { return mbClickChangeRotation; }
/** Remember the type of the view shell that was (or soon will be)
previously associated with this frame view.
@param eType
The type of the previous view shell or ViewShell::ST_NONE to
indicate that there is no previous view shell.
*/
void SetPreviousViewShellType (ViewShell::ShellType eType);
/** Return the type of the view shell previously associated with this
frame view.
*/
ViewShell::ShellType GetPreviousViewShellType() const { return mePreviousViewShellType;}
/** Remember the type of the view shell at the time when the document is
loaded or, rather, when the ViewShellBase is constructed.
*/
void SetViewShellTypeOnLoad (ViewShell::ShellType eType);
ViewShell::ShellType GetViewShellTypeOnLoad() const { return meViewShellTypeOnLoad;}
void SetPresentationViewShellId(sal_uInt16 nId)
{ mnPresViewShellId = nId; }
sal_uInt16 GetPresentationViewShellId() const { return mnPresViewShellId; }
void SetSlidesPerRow(sal_uInt16 nSlides) { mnSlidesPerRow = nSlides; }
sal_uInt16 GetSlidesPerRow() const { return mnSlidesPerRow; }
void SetDrawMode(DrawModeFlags nNewDrawMode) { mnDrawMode = nNewDrawMode; };
DrawModeFlags GetDrawMode() const { return mnDrawMode; };
void SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes);
bool IsNavigatorShowingAllShapes() const { return mbIsNavigatorShowingAllShapes;}
void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& );
void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& );
private:
sal_uInt16 mnRefCount;
bool mbRuler;
SdrLayerIDSet maVisibleLayers;
SdrLayerIDSet maLockedLayers;
SdrLayerIDSet maPrintableLayers;
SdrHelpLineList maStandardHelpLines;
SdrHelpLineList maNotesHelpLines;
SdrHelpLineList maHandoutHelpLines;
bool mbNoColors; ///< structuring mode
bool mbNoAttribs; ///< structuring mode
::tools::Rectangle maVisArea; ///< visible area
PageKind mePageKind; ///< kind of page (standard, notes, handout)
sal_uInt16 mnSelectedPage;
PageKind mePageKindOnLoad;
sal_uInt16 mnSelectedPageOnLoad;
EditMode mePageEditMode; ///< edit mode in drawing mode (Page/MasterPage)
Impress: Rework the way the display modes are presented. TODO: take into account remarks from Gerrit New combo to select display mode among: - Slide edition (Normal) - Outline - Notes - Slide sorter - Slide master - Notes master - Handout (master, as we are designing the template used to generate the handout) The combo is based on uno command .uno:DisplayMode Center pane tabs are hidden by default. A new uno dispatch command (.uno:ToggleTabBarVisibility) is available to show/hide this tab bar. Modified uno dispatch commands: No uno name has been modified. .uno:DiaMode : SID_DIAMODE renamed SID_SLIDER_SORTER_MODE .uno:OutlineMode SID_OUTLINEMODE renamed SID_OUTLINE_MODE .uno:NotesMode No change .uno:HandoutMode SID_HANDOUT_MODE renamed SID_HANDOUT_MASTER_MODE All internal code also considers the edit mode as master .uno:SlideMasterPage SID_SLIDE_MASTERPAGE renamed SID_SLIDE_MASTER_MODE If the input parameter SfxBoolItem Isactive is true or not provided, activates Slide Master mode. If parameter is false, activates the "Normal" (slide editing) mode. .uno:NotesMasterPage SID_NOTES_MASTERPAGE renamed SID_NOTES_MASTER_MODE If the input parameter SfxBoolItem Isactive is true or not provided, activates Notes Master mode. If parameter is false, activates the "Notes" mode. Modified behaviours: Now only one mode can be chosen. It is possible to navigate from a mode to any other mode. Previous behaviour: the following navigation Normal -> Slide Master -> Notes -> Normal was displaying slide master. It was required to activate Normal once more to get back to normal. Now the same commands will display the requested mode. Still to come (at least): - Fix reopen the last display mode. - Center pane tabs are now presenting all buttons for all modes (TODO). Change-Id: I11ab59d2f3caa9149260c5e55d44d598d0ce3390 Reviewed-on: https://gerrit.libreoffice.org/16723 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
2015-07-10 17:02:44 +02:00
// EditMode meStandardEditMode; ///< edit mode in drawing mode (Page/MasterPage)
// EditMode meNotesEditMode; ///< edit mode in notes mode (Page/MasterPage)
// EditMode meHandoutEditMode; ///< edit mode in handout mode (Page/MasterPage)
EditMode meEditModeOnLoad;
bool mbLayerMode; ///< layer on/off
bool mbQuickEdit; ///< QuickEdit on/off
bool mbDoubleClickTextEdit; ///< text mode after double click
bool mbClickChangeRotation; ///< single click switches between selection/rotation mode
sal_uInt16 mnPresViewShellId; ///< ViewShell from which the presentation was started
sal_uInt16 mnSlidesPerRow; ///< slides per row on the slide-desk
DrawModeFlags mnDrawMode; ///< draw mode for the normal window
/** Remember whether the navigator shows all shapes (<TRUE/>) or only
the names ones (<FALSE/>). Not persistent.
*/
bool mbIsNavigatorShowingAllShapes;
/** The type of the previous view shell. The (default) value
ViewShell::ST_NONE indicates that there was no previous view shell.
Note that this value is used only temporarily and is not saved or
restored.
*/
ViewShell::ShellType mePreviousViewShellType;
ViewShell::ShellType meViewShellTypeOnLoad;
};
} // end of namespace sd
#endif
2010-10-27 12:53:26 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */