update dev300-m58
[ooovba.git] / dbaccess / source / ui / querydesign / QueryTabWinUndoAct.hxx
blob0df442204a0e8d3a295a1dabd4f172b460354d70
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: QueryTabWinUndoAct.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_QUERYTABWINUNDOACT_HXX
31 #define DBAUI_QUERYTABWINUNDOACT_HXX
33 #ifndef DBAUI_QUERYDESIGNUNDOACTION_HXX
34 #include "QueryDesignUndoAction.hxx"
35 #endif
36 #ifndef INCLUDED_VECTOR
37 #define INCLUDED_VECTOR
38 #include <vector>
39 #endif // INCLUDED_VECTOR
41 #include <algorithm>
43 namespace dbaui
45 // ================================================================================================
46 // OQueryTabWinUndoAct - Undo-Basisklasse fuer alles, was mit Einfuegen/Entfernen von TabWIns zu tun hat zu tun hat
48 class OQueryTableWindow;
49 class OTableConnection;
50 class OQueryTableView;
51 class OQueryTabWinUndoAct : public OQueryDesignUndoAction
53 protected:
54 ::std::vector<OTableConnection*> m_vTableConnection;
55 OQueryTableWindow* m_pTabWin;
56 BOOL m_bOwnerOfObjects;
57 // bin ich alleiniger Eigentuemer der verwalteten Objekte ? (aendert sich mit jedem Redo oder Undo)
59 public:
60 OQueryTabWinUndoAct(OQueryTableView* pOwner, USHORT nCommentID);
61 virtual ~OQueryTabWinUndoAct();
63 void SetOwnership(BOOL bTakeIt) { m_bOwnerOfObjects = bTakeIt; }
66 virtual void Undo() = 0;
67 virtual void Redo() = 0;
69 // Zugriff auf das TabWin
70 void SetTabWin(OQueryTableWindow* pTW) { m_pTabWin = pTW; }
71 // anschliessend sollte das SetOwnership aufgerufen werden
73 // Zugriff auf die verwalteten Connections
74 USHORT ConnCount() { return (USHORT)m_vTableConnection.size(); }
76 ::std::vector<OTableConnection*>* GetTabConnList() { return &m_vTableConnection; }
78 void InsertConnection( OTableConnection* pConnection ) { m_vTableConnection.push_back(pConnection); }
79 void RemoveConnection( OTableConnection* pConnection )
81 m_vTableConnection.erase(::std::remove(m_vTableConnection.begin(),m_vTableConnection.end(),pConnection),m_vTableConnection.end());
87 #endif // DBAUI_QUERYTABWINUNDOACT_HXX