fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / undostyl.hxx
blob7487f9076838bad2d11b31fdcd584316ad43795d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
26 class ScDocShell;
27 class SfxStyleSheetBase;
29 class ScStyleSaveData
31 private:
32 OUString aName;
33 OUString aParent;
34 SfxItemSet* pItems;
36 public:
37 ScStyleSaveData();
38 ScStyleSaveData( const ScStyleSaveData& rOther );
39 ~ScStyleSaveData();
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
51 private:
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 );
60 public:
61 TYPEINFO_OVERRIDE();
62 ScUndoModifyStyle( ScDocShell* pDocSh,
63 SfxStyleFamily eFam,
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
78 public:
79 TYPEINFO_OVERRIDE();
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;
92 private:
93 struct ApplyStyleEntry
95 SCTAB mnTab;
96 OUString maOldStyle;
97 explicit ApplyStyleEntry( SCTAB nTab, const OUString& rOldStyle );
99 typedef ::std::vector< ApplyStyleEntry > ApplyStyleVec;
101 ApplyStyleVec maEntries;
102 OUString maNewStyle;
105 #endif
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */