LCOV - code coverage report
Current view: top level - dbaccess/source/ui/inc - FieldDescControl.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 8 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 8 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_FIELDDESCCONTROL_HXX
      20             : #define INCLUDED_DBACCESS_SOURCE_UI_INC_FIELDDESCCONTROL_HXX
      21             : 
      22             : #include <vcl/tabpage.hxx>
      23             : #include "QEnumTypes.hxx"
      24             : #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
      25             : #include <com/sun/star/util/XNumberFormatter.hpp>
      26             : #include "TypeInfo.hxx"
      27             : 
      28             : // field description columns of a table
      29             : #define FIELD_NAME                      1
      30             : #define FIELD_TYPE                      2
      31             : #define HELP_TEXT                       3
      32             : #define COLUMN_DESCRIPTION              4
      33             : 
      34             : #define FIELD_FIRST_VIRTUAL_COLUMN      5
      35             : 
      36             : #define FIELD_PROPERTY_REQUIRED         5
      37             : #define FIELD_PROPERTY_NUMTYPE          6
      38             : #define FIELD_PROPERTY_AUTOINC          7
      39             : #define FIELD_PROPERTY_DEFAULT          8
      40             : #define FIELD_PROPERTY_TEXTLEN          9
      41             : #define FIELD_PROPERTY_LENGTH           10
      42             : #define FIELD_PROPERTY_SCALE            11
      43             : #define FIELD_PROPERTY_BOOL_DEFAULT     12
      44             : #define FIELD_PROPERTY_FORMAT           13
      45             : #define FIELD_PROPERTY_COLUMNNAME       14
      46             : #define FIELD_PROPERTY_TYPE             15
      47             : #define FIELD_PROPERTY_AUTOINCREMENT    16
      48             : 
      49             : class FixedText;
      50             : class PushButton;
      51             : class ScrollBar;
      52             : class Button;
      53             : class ListBox;
      54             : class Control;
      55             : 
      56             : namespace dbaui
      57             : {
      58             :     class OTableDesignHelpBar;
      59             :     class OPropListBoxCtrl;
      60             :     class OPropEditCtrl;
      61             :     class OPropNumericEditCtrl;
      62             :     class OFieldDescription;
      63             :     class OPropColumnEditCtrl;
      64             : 
      65             :     class OFieldDescControl : public TabPage
      66             :     {
      67             :     private:
      68             :         VclPtr<OTableDesignHelpBar>    pHelp;
      69             :         VclPtr<vcl::Window>            pLastFocusWindow;
      70             :         VclPtr<vcl::Window>            m_pActFocusWindow;
      71             : 
      72             :         VclPtr<FixedText>              pDefaultText;
      73             :         VclPtr<FixedText>              pRequiredText;
      74             :         VclPtr<FixedText>              pAutoIncrementText;
      75             :         VclPtr<FixedText>              pTextLenText;
      76             :         VclPtr<FixedText>              pNumTypeText;
      77             :         VclPtr<FixedText>              pLengthText;
      78             :         VclPtr<FixedText>              pScaleText;
      79             :         VclPtr<FixedText>              pFormatText;
      80             :         VclPtr<FixedText>              pBoolDefaultText;
      81             :         VclPtr<FixedText>              m_pColumnNameText;
      82             :         VclPtr<FixedText>              m_pTypeText;
      83             :         VclPtr<FixedText>              m_pAutoIncrementValueText;
      84             : 
      85             :         VclPtr<OPropListBoxCtrl>       pRequired;
      86             :         VclPtr<OPropListBoxCtrl>       pNumType;
      87             :         VclPtr<OPropListBoxCtrl>       pAutoIncrement;
      88             :         VclPtr<OPropEditCtrl>          pDefault;
      89             :         VclPtr<OPropNumericEditCtrl>   pTextLen;
      90             :         VclPtr<OPropNumericEditCtrl>   pLength;
      91             :         VclPtr<OPropNumericEditCtrl>   pScale;
      92             :         VclPtr<OPropEditCtrl>          pFormatSample;
      93             :         VclPtr<OPropListBoxCtrl>       pBoolDefault;
      94             :         VclPtr<OPropColumnEditCtrl>    m_pColumnName;
      95             :         VclPtr<OPropListBoxCtrl>       m_pType;
      96             :         VclPtr<OPropEditCtrl>          m_pAutoIncrementValue;
      97             : 
      98             :         VclPtr<PushButton>             pFormat;
      99             : 
     100             :         VclPtr<ScrollBar>              m_pVertScroll;
     101             :         VclPtr<ScrollBar>              m_pHorzScroll;
     102             : 
     103             :         TOTypeInfoSP            m_pPreviousType;
     104             :         short                   m_nPos;
     105             :         OUString                aYes;
     106             :         OUString                aNo;
     107             : 
     108             :         long                    m_nOldVThumb;
     109             :         long                    m_nOldHThumb;
     110             :         sal_Int32               m_nWidth;
     111             : 
     112             :         bool                m_bAdded;
     113             :         bool                    m_bRightAligned;
     114             : 
     115             :         OFieldDescription*      pActFieldDescr;
     116             : 
     117             :         DECL_LINK( OnScroll, ScrollBar*);
     118             : 
     119             :         DECL_LINK( FormatClickHdl, Button * );
     120             :         DECL_LINK( ChangeHdl, ListBox * );
     121             : 
     122             :         // used by ActivatePropertyField
     123             :         DECL_LINK( OnControlFocusLost, Control* );
     124             :         DECL_LINK( OnControlFocusGot, Control* );
     125             : 
     126             :         void                UpdateFormatSample(OFieldDescription* pFieldDescr);
     127             :         void                ArrangeAggregates();
     128             : 
     129             :         void                SetPosSize( VclPtr<Control>& rControl, long nRow, sal_uInt16 nCol );
     130             : 
     131             :         static void         ScrollAggregate(Control* pText, Control* pInput, Control* pButton, long nDeltaX, long nDeltaY);
     132             :         void                ScrollAllAggregates();
     133             : 
     134             :         bool                isTextFormat(const OFieldDescription* _pFieldDescr,sal_uInt32& _nFormatKey) const;
     135             :         void                Contruct();
     136             :         VclPtr<OPropNumericEditCtrl> CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const OString& _sHelpId);
     137             :         VclPtr<FixedText>   CreateText(sal_uInt16 _nTextRes);
     138             :         void                InitializeControl(Control* _pControl,const OString& _sHelpId,bool _bAddChangeHandler);
     139             : 
     140             :     protected:
     141           0 :         inline  void    setRightAligned()       { m_bRightAligned = true; }
     142           0 :         inline  bool    isRightAligned() const  { return m_bRightAligned; }
     143             : 
     144           0 :         inline  void                saveCurrentFieldDescData() { SaveData( pActFieldDescr ); }
     145           0 :         inline  OFieldDescription*  getCurrentFieldDescData() { return pActFieldDescr; }
     146           0 :         inline  void                setCurrentFieldDescData( OFieldDescription* _pDesc ) { pActFieldDescr = _pDesc; }
     147             : 
     148             :         sal_uInt16          CountActiveAggregates() const;
     149             :         sal_Int32           GetMaxControlHeight() const;
     150             : 
     151             :         virtual void        ActivateAggregate( EControlType eType );
     152             :         virtual void        DeactivateAggregate( EControlType eType );
     153           0 :         virtual bool        IsReadOnly() { return false; };
     154             : 
     155             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter() const = 0;
     156             : 
     157             :         virtual ::com::sun::star::lang::Locale  GetLocale() const = 0;
     158             : 
     159             :         virtual void                            CellModified(long nRow, sal_uInt16 nColId ) = 0;
     160             :         virtual void                            SetModified(bool bModified);    // base implementation is empty
     161             : 
     162             :         virtual TOTypeInfoSP                    getTypeInfo(sal_Int32 _nPos)        = 0;
     163             :         virtual const OTypeInfoMap*             getTypeInfo() const  = 0;
     164             : 
     165             :         virtual bool                        isAutoIncrementValueEnabled() const = 0;
     166             :         virtual OUString                 getAutoIncrementValue() const = 0;
     167             : 
     168             :         OUString                                BoolStringPersistent(const OUString& rUIString) const;
     169             :         OUString                                BoolStringUI(const OUString& rPersistentString) const;
     170             : 
     171           0 :         const OPropColumnEditCtrl*              getColumnCtrl() const { return m_pColumnName; }
     172             : 
     173             :         void    implFocusLost(vcl::Window* _pWhich);
     174             : 
     175             :     public:
     176             :         OFieldDescControl( vcl::Window* pParent, OTableDesignHelpBar* pHelpBar);
     177             :         virtual ~OFieldDescControl();
     178             :         virtual void        dispose() SAL_OVERRIDE;
     179             : 
     180             :         void                DisplayData(OFieldDescription* pFieldDescr );
     181             : 
     182             :         void                SaveData( OFieldDescription* pFieldDescr );
     183             : 
     184             :         void                SetControlText( sal_uInt16 nControlId, const OUString& rText );
     185             :         OUString            GetControlText( sal_uInt16 nControlId );
     186             :         void                SetReadOnly( bool bReadOnly );
     187             : 
     188             :         // when resize is called
     189             :         void                CheckScrollBars();
     190             :         bool                isCutAllowed();
     191             :         bool                isCopyAllowed();
     192             :         bool                isPasteAllowed();
     193             : 
     194             :         void                cut();
     195             :         void                copy();
     196             :         void                paste();
     197             : 
     198             :         void                Init();
     199             :         virtual void        GetFocus() SAL_OVERRIDE;
     200             :         virtual void        LoseFocus() SAL_OVERRIDE;
     201             :         virtual void        Resize() SAL_OVERRIDE;
     202             : 
     203             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() = 0;
     204             :         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() = 0;
     205             : 
     206             :         OUString            getControlDefault( const OFieldDescription* _pFieldDescr, bool _bCheck = true) const;
     207             : 
     208           0 :         inline void setEditWidth(sal_Int32 _nWidth) { m_nWidth = _nWidth; }
     209             :     };
     210             : }
     211             : #endif
     212             : 
     213             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11