diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-02-25 14:43:28 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-02-28 12:58:28 +0100 |
commit | 34ab7b37709fbf889f90b30790573f5ab2521e94 (patch) | |
tree | 4fc73b8c516191e63184dd94aceaae062b97603d /sfx2/inc | |
parent | 65438bcda46bab4f2fe6fb555f44aace45e11e5e (diff) |
Create the SfxRedactionHelper class
And move some code pieces, related to the redaction functionality,
from objserv.cxx to the new SfxRedactionHelper.cxx file.
Change-Id: I6491c9b581ea6d3a05a72117c5b72e1dc19025dc
Reviewed-on: https://gerrit.libreoffice.org/68338
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sfx2/inc')
-rw-r--r-- | sfx2/inc/SfxRedactionHelper.hxx | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx new file mode 100644 index 000000000000..d338143c608e --- /dev/null +++ b/sfx2/inc/SfxRedactionHelper.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX +#define INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/lang/XComponent.hpp> + +#include <sal/types.h> +#include <rtl/ustring.hxx> + +#include <vector> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +class SfxRequest; +class SfxStringItem; +class GDIMetaFile; +class DocumentToGraphicRenderer; +class SfxViewFrame; + +/* + * Mostly a bunch of static methods to handle the redaction functionality at + * different points of the process. + **/ +class SfxRedactionHelper +{ +public: + /// Checks to see if the request has a parameter of IsRedactMode:bool=true + static bool isRedactMode(const SfxRequest& rReq); + /* + * Returns the value of the given string param as an OUString + * Returns empty OUString if no param + * */ + static OUString getStringParam(const SfxRequest& rReq, const sal_uInt16& nParamId); + /* + * Creates metafiles from the pages of the given document, + * and pushes into the given vector. + * */ + static void getPageMetaFilesFromDoc(std::vector<GDIMetaFile>& aMetaFiles, + const sal_Int32& nPages, + DocumentToGraphicRenderer& aRenderer, bool bIsWriter, + bool bIsCalc); + /* + * Creates one shape and one draw page for each gdimetafile, + * and inserts the shapes into the newly created draw pages. + * */ + static void addPagesToDraw(uno::Reference<XComponent>& xComponent, const sal_Int32& nPages, + const std::vector<GDIMetaFile>& aMetaFiles, bool bIsCalc); + /* + * Makes the Redaction toolbar visible to the user. + * Meant to be called after converting a document to a Draw doc + * for redaction purposes. + * */ + static void showRedactionToolbar(SfxViewFrame* pViewFrame); +}; + +#endif // INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |