diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-11-02 10:26:39 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-11-03 12:19:16 +0000 |
commit | e509c22863b5184421e710cf8ae81e2ddc961623 (patch) | |
tree | 4d7b366c4e5f1fcd0dcb29f901c3732be49d8fe5 /include | |
parent | 954f721ad59e52f039154cb01490e068cc0f0ce5 (diff) |
SafeModeDialog: Allow to create zip file from profile
Change-Id: I4296d1cf5058be359ffed46745673cf26eba3375
Reviewed-on: https://gerrit.libreoffice.org/30479
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/backupfilehelper.hxx | 3 | ||||
-rw-r--r-- | include/comphelper/package/ZipPackageHelper.hxx | 57 | ||||
-rw-r--r-- | include/svx/dialogs.hrc | 6 |
3 files changed, 65 insertions, 1 deletions
diff --git a/include/comphelper/backupfilehelper.hxx b/include/comphelper/backupfilehelper.hxx index 07cfb61053ec..d11208a00572 100644 --- a/include/comphelper/backupfilehelper.hxx +++ b/include/comphelper/backupfilehelper.hxx @@ -182,6 +182,9 @@ namespace comphelper /** Return the profile url */ static const OUString& getUserProfileURL(); + /** Return the url of the backed up profile (when in safe mode) */ + static const OUString& getUserProfileWorkURL(); + private: // internal helper methods static const rtl::OUString getPackURL(); diff --git a/include/comphelper/package/ZipPackageHelper.hxx b/include/comphelper/package/ZipPackageHelper.hxx new file mode 100644 index 000000000000..2cdd5db7dccc --- /dev/null +++ b/include/comphelper/package/ZipPackageHelper.hxx @@ -0,0 +1,57 @@ +/* -*- 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_COMPHELPER_PACKAGE_ZIPPACKAGEHELPER_HXX +#define INCLUDED_COMPHELPER_PACKAGE_ZIPPACKAGEHELPER_HXX + +#include <com/sun/star/container/XHierarchicalNameAccess.hpp> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/io/XInputStream.hpp> + + +class ZipPackageHelper +{ +public: + ZipPackageHelper( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const OUString& sPackageURL); + + void savePackage(); + + void addFile( const OUString& rSourceFile ) + throw( css::uno::Exception, std::exception ); + + void addStream( css::uno::Reference< css::io::XInputStream > const & xInput, + const OUString& aName ) throw( css::uno::Exception ); + + css::uno::Reference< css::uno::XInterface > addFolder( const OUString& rName ) + throw( css::uno::Exception, std::exception ); + + void addFolderWithContent( const OUString& rDirURL ); + +private: + css::uno::Reference< css::uno::XComponentContext > mxContext; + css::uno::Reference< css::container::XHierarchicalNameAccess > mxHNameAccess; + css::uno::Reference< css::lang::XSingleServiceFactory > mxFactory; + css::uno::Reference< css::uno::XInterface > mxRootFolder; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index aba0095e93d6..3ccea55d2a4a 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -1080,8 +1080,12 @@ #define RID_SVXSTRARY_SPACING (RID_SVX_START + 1398) #define RID_SVXSTRARY_SAMECONTENT (RID_SVX_START + 1399) +// Strings for SafeModeDialog +#define RID_SVXSTR_SAFEMODE_ZIP_FAILURE (RID_SVX_START + 1400) + + // !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!! -#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1400) +#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1401) // if we have _a_lot_ time, we should group the resource ids by type, instead // of grouping them by semantics. The reason is that resource ids have to be |