fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / dbaccess / source / ui / querydesign / QueryTabWinUndoAct.hxx
blobaf22a64063d2775633ccbda6d0b59d180cf417cf
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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QUERYTABWINUNDOACT_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QUERYTABWINUNDOACT_HXX
22 #include "QueryDesignUndoAction.hxx"
23 #include <vector>
24 #include <algorithm>
26 namespace dbaui
28 // OQueryTabWinUndoAct - undo base class for all which is concerned with insert/remove TabWins
30 class OQueryTableWindow;
31 class OTableConnection;
32 class OQueryTableView;
33 class OQueryTabWinUndoAct : public OQueryDesignUndoAction
35 protected:
36 ::std::vector<VclPtr<OTableConnection> > m_vTableConnection;
37 VclPtr<OQueryTableWindow> m_pTabWin;
38 bool m_bOwnerOfObjects;
39 // am I the only owner of the managed objects? (changes with every redo or undo)
41 public:
42 OQueryTabWinUndoAct(OQueryTableView* pOwner, sal_uInt16 nCommentID);
43 virtual ~OQueryTabWinUndoAct();
45 void SetOwnership(bool bTakeIt) { m_bOwnerOfObjects = bTakeIt; }
47 virtual void Undo() SAL_OVERRIDE = 0;
48 virtual void Redo() SAL_OVERRIDE = 0;
50 // access to the TabWin
51 void SetTabWin(OQueryTableWindow* pTW) { m_pTabWin = pTW; }
52 // now SetOwnership should be invoked
54 // access to the managed connections
55 sal_uInt16 ConnCount() { return (sal_uInt16)m_vTableConnection.size(); }
57 ::std::vector<VclPtr<OTableConnection> >& GetTabConnList() { return m_vTableConnection; }
59 void InsertConnection( OTableConnection* pConnection ) { m_vTableConnection.push_back(pConnection); }
60 void RemoveConnection( OTableConnection* pConnection )
62 m_vTableConnection.erase(::std::remove(m_vTableConnection.begin(),m_vTableConnection.end(),pConnection),m_vTableConnection.end());
67 #endif // INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QUERYTABWINUNDOACT_HXX
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */