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 SC_UNDOSTYL_HXX
21 #define SC_UNDOSTYL_HXX
23 #include <rsc/rscsfx.hxx>
24 #include "undobase.hxx"
27 class SfxStyleSheetBase
;
29 //----------------------------------------------------------------------------
40 ScStyleSaveData( const ScStyleSaveData
& rOther
);
42 ScStyleSaveData
& operator=( const ScStyleSaveData
& rOther
);
44 void InitFromStyle( const SfxStyleSheetBase
* pSource
);
46 const OUString
& GetName() const { return aName
; }
47 const OUString
& GetParent() const { return aParent
; }
48 const SfxItemSet
* GetItems() const { return pItems
; }
51 class ScUndoModifyStyle
: public ScSimpleUndo
54 SfxStyleFamily eFamily
;
55 ScStyleSaveData aOldData
;
56 ScStyleSaveData aNewData
;
58 static void DoChange( ScDocShell
* pDocSh
,
59 const OUString
& rName
, SfxStyleFamily eStyleFamily
,
60 const ScStyleSaveData
& rData
);
64 ScUndoModifyStyle( ScDocShell
* pDocSh
,
66 const ScStyleSaveData
& rOld
,
67 const ScStyleSaveData
& rNew
);
68 virtual ~ScUndoModifyStyle();
72 virtual void Repeat(SfxRepeatTarget
& rTarget
);
73 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const;
75 virtual OUString
GetComment() const;
78 class ScUndoApplyPageStyle
: public ScSimpleUndo
82 ScUndoApplyPageStyle( ScDocShell
* pDocSh
, const OUString
& rNewStyle
);
83 virtual ~ScUndoApplyPageStyle();
85 void AddSheetAction( SCTAB nTab
, const OUString
& rOld
);
89 virtual void Repeat(SfxRepeatTarget
& rTarget
);
90 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const;
92 virtual OUString
GetComment() const;
95 struct ApplyStyleEntry
99 explicit ApplyStyleEntry( SCTAB nTab
, const OUString
& rOldStyle
);
101 typedef ::std::vector
< ApplyStyleEntry
> ApplyStyleVec
;
103 ApplyStyleVec maEntries
;
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */