LCOV - code coverage report
Current view: top level - dbaccess/source/ui/inc - TableWindow.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 11 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 11 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_TABLEWINDOW_HXX
      20             : #define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOW_HXX
      21             : 
      22             : #include <com/sun/star/container/XNameAccess.hpp>
      23             : #include <com/sun/star/beans/XPropertySet.hpp>
      24             : #include "TableWindowTitle.hxx"
      25             : #include <tools/rtti.hxx>
      26             : #include <rtl/ref.hxx>
      27             : #include "TableWindowData.hxx"
      28             : #include <vector>
      29             : #include <vcl/window.hxx>
      30             : 
      31             : #include <comphelper/containermultiplexer.hxx>
      32             : #include "cppuhelper/basemutex.hxx"
      33             : 
      34             : class SvTreeListEntry;
      35             : namespace dbaui
      36             : {
      37             :     // Flags for the size adjustment of SbaJoinTabWins
      38             :     const sal_uInt16 SIZING_NONE    = 0x0000;
      39             :     const sal_uInt16 SIZING_TOP     = 0x0001;
      40             :     const sal_uInt16 SIZING_BOTTOM  = 0x0002;
      41             :     const sal_uInt16 SIZING_LEFT    = 0x0004;
      42             :     const sal_uInt16 SIZING_RIGHT   = 0x0008;
      43             : 
      44             :     class OTableWindowListBox;
      45             :     class OJoinDesignView;
      46             :     class OJoinTableView;
      47             :     class OTableWindowAccess;
      48             : 
      49             :     class OTableWindow : public ::cppu::BaseMutex
      50             :                         ,public ::comphelper::OContainerListener
      51             :                         ,public vcl::Window
      52             :     {
      53             :         friend class OTableWindowTitle;
      54             :         friend class OTableWindowListBox;
      55             :     protected:
      56             :         // and the table itself (needed for me as I want to lock it as long as the window is alive)
      57             :         VclPtr<FixedImage>          m_aTypeImage;
      58             :         VclPtr<OTableWindowTitle>   m_aTitle;
      59             :         VclPtr<OTableWindowListBox>    m_pListBox;
      60             :         OTableWindowAccess*     m_pAccessible;
      61             : 
      62             :     private:
      63             :         TTableWindowData::value_type
      64             :                                 m_pData;
      65             :         ::rtl::Reference< comphelper::OContainerListenerAdapter>
      66             :                                 m_pContainerListener;
      67             :         sal_Int32               m_nMoveCount;           // how often the arrow keys was pressed
      68             :         sal_Int32               m_nMoveIncrement;       // how many pixel we should move
      69             :         sal_uInt16              m_nSizingFlags;
      70             :         bool                m_bActive;
      71             : 
      72             :         // OContainerListener
      73             :         virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      74             :         virtual void _elementRemoved( const  ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      75             :         virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      76             : 
      77             :     protected:
      78             :         virtual void    Resize() SAL_OVERRIDE;
      79             :         virtual void    Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
      80             :         virtual void    MouseMove( const MouseEvent& rEvt ) SAL_OVERRIDE;
      81             :         virtual void    MouseButtonDown( const MouseEvent& rEvt ) SAL_OVERRIDE;
      82             :         virtual void    DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
      83             : 
      84             :         VclPtr<OTableWindowListBox> CreateListBox();
      85             :             // called at FIRST Init
      86             :         bool FillListBox();
      87             :             // called at EACH Init
      88             : 
      89           0 :         virtual void OnEntryDoubleClicked(SvTreeListEntry* /*pEntry*/) { }
      90             :             // called from the DoubleClickHdl of the ListBox
      91             : 
      92             :         /** HandleKeyInput tries to handle the KeyEvent. Movement or deletion
      93             :             @param  rEvt
      94             :                 The KEyEvent
      95             :             @return
      96             :                 <TRUE/> when the table could handle the keyevent.
      97             :         */
      98             :         bool            HandleKeyInput( const KeyEvent& rEvt );
      99             : 
     100             :         /** delete the user data with the equal type as created within createUserData
     101             :             @param  _pUserData
     102             :                 The user data store in the listbox entries. Created with a call to createUserData.
     103             :                 _pUserData may be <NULL/>. _pUserData will be set to <NULL/> after call.
     104             :         */
     105             :         virtual void deleteUserData(void*& _pUserData);
     106             : 
     107             :         /** creates user information that will be append at the ListBoxentry
     108             :             @param  _xColumn
     109             :                 The corresponding column, can be <NULL/>.
     110             :             @param  _bPrimaryKey
     111             :                 <TRUE/> when the column belongs to the primary key
     112             :             @return
     113             :                 the user data which will be append at the listbox entry, may be <NULL/>
     114             :         */
     115             :         virtual void* createUserData(const ::com::sun::star::uno::Reference<
     116             :                                     ::com::sun::star::beans::XPropertySet>& _xColumn,
     117             :                                     bool _bPrimaryKey);
     118             : 
     119             :         /** updates m_aTypeImage
     120             :         */
     121             :         void    impl_updateImage();
     122             : 
     123             :         OTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData );
     124             : 
     125             :     public:
     126             :         virtual ~OTableWindow();
     127             :         virtual void dispose() SAL_OVERRIDE;
     128             : 
     129             :         // late Constructor, see also CreateListbox and FillListbox
     130             :         virtual bool Init();
     131             : 
     132             :         OJoinTableView*             getTableView();
     133             :         const OJoinTableView*       getTableView() const;
     134             :         OJoinDesignView*            getDesignView();
     135             :         void                        SetPosPixel( const Point& rNewPos ) SAL_OVERRIDE;
     136             :         void                        SetSizePixel( const Size& rNewSize ) SAL_OVERRIDE;
     137             :         void                        SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) SAL_OVERRIDE;
     138             : 
     139             :         OUString                    getTitle() const;
     140             :         void                        SetBoldTitle( bool bBold );
     141             :         void                        setActive(bool _bActive = true);
     142             : 
     143             :         void                        Remove();
     144             :         bool                        IsActiveWindow(){ return m_bActive; }
     145             : 
     146           0 :         OUString             GetTableName() const { return m_pData->GetTableName(); }
     147           0 :         OUString             GetWinName() const { return m_pData->GetWinName(); }
     148           0 :         OUString             GetComposedName() const { return m_pData->GetComposedName(); }
     149           0 :         OTableWindowListBox*         GetListBox() const { return m_pListBox; }
     150           0 :         TTableWindowData::value_type GetData() const { return m_pData; }
     151           0 :         OTableWindowTitle&           GetTitleCtrl() { return *m_aTitle.get(); }
     152             : 
     153             :         /** returns the name which should be used when displaying join or relations
     154             :             @return
     155             :                 The composed name or the window name.
     156             :         */
     157             :         virtual OUString     GetName() const = 0;
     158             : 
     159           0 :         inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetOriginalColumns() const { return m_pData->getColumns(); }
     160           0 :         inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >    GetTable() const { return m_pData->getTable(); }
     161             : 
     162           0 :         sal_uInt16                      GetSizingFlags() const { return m_nSizingFlags; }
     163             :         /** set the sizing flag to the direction
     164             :             @param  _rPos
     165             :                 The EndPosition after resizing.
     166             :         */
     167             :         void                        setSizingFlag(const Point& _rPos);
     168             :         /** set the rsizing flag to NONE.
     169             :         */
     170           0 :         void                        resetSizingFlag() { m_nSizingFlags = SIZING_NONE; }
     171             : 
     172             :         /** returns the new sizing
     173             :         */
     174             :         Rectangle getSizingRect(const Point& _rPos,const Size& _rOutputSize) const;
     175             : 
     176             :         // window override
     177             :         virtual void                StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
     178             :         virtual void                GetFocus() SAL_OVERRIDE;
     179             :         virtual bool                PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
     180             :         virtual void                Command(const CommandEvent& rEvt) SAL_OVERRIDE;
     181             : 
     182             :         // Accessibility
     183             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
     184             : 
     185             :         // do I have connections to the outside?
     186             :         bool ExistsAConn() const;
     187             : 
     188             :         void EnumValidFields(::std::vector< OUString>& arrstrFields);
     189             : 
     190             :         /** clears the listbox inside. Must be called be the dtor is called.
     191             :         */
     192             :         void clearListBox();
     193             :     };
     194             : }
     195             : #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEWINDOW_HXX
     196             : 
     197             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11