LCOV - code coverage report
Current view: top level - dbaccess/source/ui/inc - TableConnection.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 6 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 5 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_TABLECONNECTION_HXX
      20             : #define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLECONNECTION_HXX
      21             : 
      22             : #include <vector>
      23             : #include <tools/debug.hxx>
      24             : #include <vcl/window.hxx>
      25             : #include <tools/rtti.hxx>
      26             : #include <com/sun/star/uno/Reference.h>
      27             : #include "TableConnectionData.hxx"
      28             : 
      29             : class Point;
      30             : class Rectangle;
      31             : 
      32             : namespace dbaui
      33             : {
      34             :     class OTableConnectionData;
      35             :     class OTableWindow;
      36             :     class OJoinTableView;
      37             :     class OConnectionLine;
      38             : 
      39             :     class OTableConnection : public vcl::Window
      40             :     {
      41             :         ::std::vector<OConnectionLine*> m_vConnLine;
      42             :         TTableConnectionData::value_type
      43             :                                         m_pData;
      44             :         VclPtr<OJoinTableView>          m_pParent;
      45             : 
      46             :         bool                            m_bSelected;
      47             : 
      48             :         void Init();
      49             :         /** loops through the vector and deletes all lines */
      50             :         void clearLineData();
      51             : 
      52             :     protected:
      53             :         static OConnectionLine* CreateConnLine( const OConnectionLine& rConnLine );
      54             : 
      55             :     public:
      56             :         OTableConnection( OJoinTableView* pContainer, const TTableConnectionData::value_type& pTabConnData );
      57             :         OTableConnection( const OTableConnection& rConn );
      58             :         /** destructor
      59             : 
      60             :             @attention Normally a pointer to OTableConnectionData is given but
      61             :                        here, however, one has to create an instance (with
      62             :                        OTableConnectionDate::NewInstance) which is never deleted
      63             :                        (same like in other cases). Thus, the caller is
      64             :                        responsible to check and save the data for deleting it
      65             :                        eventually.
      66             :          */
      67             :         virtual ~OTableConnection();
      68             :         virtual void dispose() SAL_OVERRIDE;
      69             : 
      70             :         OTableConnection& operator=( const OTableConnection& rConn );
      71             : 
      72             :         void        Select();
      73             :         void        Deselect();
      74           0 :         bool        IsSelected() const { return m_bSelected; }
      75             :         bool        CheckHit( const Point& rMousePos ) const;
      76             :         bool        InvalidateConnection();
      77             :         void        UpdateLineList();
      78             : 
      79             :         OTableWindow* GetSourceWin() const;
      80             :         OTableWindow* GetDestWin() const;
      81             : 
      82             :         bool RecalcLines();
      83             :         /** isTableConnection
      84             : 
      85             :             @param  _pTable the table where we should check if we belongs to it
      86             :             @return true when the source or the destination window are equal
      87             :         */
      88           0 :         bool isTableConnection(const OTableWindow* _pTable)
      89             :         {
      90           0 :             return (_pTable == GetSourceWin() || _pTable == GetDestWin());
      91             :         }
      92             : 
      93             :         Rectangle   GetBoundingRect() const;
      94             : 
      95           0 :         inline TTableConnectionData::value_type GetData() const { return m_pData; }
      96           0 :         const ::std::vector<OConnectionLine*>&  GetConnLineList() const { return m_vConnLine; }
      97           0 :         inline OJoinTableView*                  GetParent() const { return m_pParent; }
      98             :         virtual void Draw(vcl::RenderContext& rRenderContext, const Rectangle& rRect);
      99             :         using Window::Draw;
     100             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
     101             :     };
     102             : }
     103             : #endif
     104             : 
     105             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11