1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_UNDOSTYL_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_UNDOSTYL_HXX
23 #include <rsc/rscsfx.hxx>
24 #include "undobase.hxx"
27 class SfxStyleSheetBase
;
38 ScStyleSaveData( const ScStyleSaveData
& rOther
);
40 ScStyleSaveData
& operator=( const ScStyleSaveData
& rOther
);
42 void InitFromStyle( const SfxStyleSheetBase
* pSource
);
44 const OUString
& GetName() const { return aName
; }
45 const OUString
& GetParent() const { return aParent
; }
46 const SfxItemSet
* GetItems() const { return pItems
; }
49 class ScUndoModifyStyle
: public ScSimpleUndo
52 SfxStyleFamily eFamily
;
53 ScStyleSaveData aOldData
;
54 ScStyleSaveData aNewData
;
56 static void DoChange( ScDocShell
* pDocSh
,
57 const OUString
& rName
, SfxStyleFamily eStyleFamily
,
58 const ScStyleSaveData
& rData
);
62 ScUndoModifyStyle( ScDocShell
* pDocSh
,
64 const ScStyleSaveData
& rOld
,
65 const ScStyleSaveData
& rNew
);
66 virtual ~ScUndoModifyStyle();
68 virtual void Undo() SAL_OVERRIDE
;
69 virtual void Redo() SAL_OVERRIDE
;
70 virtual void Repeat(SfxRepeatTarget
& rTarget
) SAL_OVERRIDE
;
71 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const SAL_OVERRIDE
;
73 virtual OUString
GetComment() const SAL_OVERRIDE
;
76 class ScUndoApplyPageStyle
: public ScSimpleUndo
80 ScUndoApplyPageStyle( ScDocShell
* pDocSh
, const OUString
& rNewStyle
);
81 virtual ~ScUndoApplyPageStyle();
83 void AddSheetAction( SCTAB nTab
, const OUString
& rOld
);
85 virtual void Undo() SAL_OVERRIDE
;
86 virtual void Redo() SAL_OVERRIDE
;
87 virtual void Repeat(SfxRepeatTarget
& rTarget
) SAL_OVERRIDE
;
88 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const SAL_OVERRIDE
;
90 virtual OUString
GetComment() const SAL_OVERRIDE
;
93 struct ApplyStyleEntry
97 explicit ApplyStyleEntry( SCTAB nTab
, const OUString
& rOldStyle
);
99 typedef ::std::vector
< ApplyStyleEntry
> ApplyStyleVec
;
101 ApplyStyleVec maEntries
;
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */