LCOV - code coverage report
Current view: top level - dbaccess/source/ui/inc - indexdialog.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 6 0.0 %
Date: 2012-08-25 Functions: 0 5 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 2 0.0 %

           Branch data     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                 :            : 
      20                 :            : #ifndef _DBAUI_INDEXDIALOG_HXX_
      21                 :            : #define _DBAUI_INDEXDIALOG_HXX_
      22                 :            : 
      23                 :            : #include <vcl/dialog.hxx>
      24                 :            : #include <vcl/fixed.hxx>
      25                 :            : #include <vcl/lstbox.hxx>
      26                 :            : #include <vcl/button.hxx>
      27                 :            : #include <com/sun/star/container/XNameAccess.hpp>
      28                 :            : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      29                 :            : #include <com/sun/star/sdbc/XConnection.hpp>
      30                 :            : #include <com/sun/star/uno/Sequence.hxx>
      31                 :            : #include <vcl/toolbox.hxx>
      32                 :            : #include <svtools/svtreebx.hxx>
      33                 :            : #include <unotools/viewoptions.hxx>
      34                 :            : #include "indexes.hxx"
      35                 :            : #include "ToolBoxHelper.hxx"
      36                 :            : 
      37                 :            : //......................................................................
      38                 :            : namespace dbaui
      39                 :            : {
      40                 :            : //......................................................................
      41                 :            : 
      42                 :            :     //==================================================================
      43                 :            :     //= DbaIndexList
      44                 :            :     //==================================================================
      45         [ #  # ]:          0 :     class DbaIndexList : public SvTreeListBox
      46                 :            :     {
      47                 :            :     protected:
      48                 :            :         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
      49                 :            :         Link        m_aSelectHdl;
      50                 :            :         Link        m_aEndEditHdl;
      51                 :            :         sal_Bool    m_bSuspendSelectHdl;
      52                 :            : 
      53                 :            :     public:
      54                 :            :         DbaIndexList(Window* _pParent, const ResId& _rId);
      55                 :            : 
      56                 :          0 :         void SetSelectHdl(const Link& _rHdl) { m_aSelectHdl = _rHdl; }
      57                 :            :         Link GetSelectHdl() const { return m_aSelectHdl; }
      58                 :            : 
      59                 :          0 :         void SetEndEditHdl(const Link& _rHdl) { m_aEndEditHdl = _rHdl; }
      60                 :            :         Link GetEndEditHdl() const { return m_aEndEditHdl; }
      61                 :            : 
      62                 :            :         virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect );
      63                 :            : 
      64                 :            :         void enableSelectHandler();
      65                 :            :         void disableSelectHandler();
      66                 :            : 
      67                 :            :         void SelectNoHandlerCall( SvLBoxEntry* pEntry );
      68                 :            : 
      69                 :          0 :         inline void setConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection)
      70                 :            :         {
      71                 :          0 :              m_xConnection = _rxConnection;
      72                 :          0 :         }
      73                 :            : 
      74                 :            :     protected:
      75                 :            :         virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText );
      76                 :            : 
      77                 :            :     private:
      78                 :            :         using SvTreeListBox::Select;
      79                 :            :     };
      80                 :            : 
      81                 :            :     //==================================================================
      82                 :            :     //= DbaIndexDialog
      83                 :            :     //==================================================================
      84                 :            :     class IndexFieldsControl;
      85                 :            :     class OIndexCollection;
      86                 :            :     class DbaIndexDialog :  public ModalDialog,
      87                 :            :                             public OToolBoxHelper
      88                 :            :     {
      89                 :            :     protected:
      90                 :            :         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
      91                 :            :         SvtViewOptions          m_aGeometrySettings;
      92                 :            : 
      93                 :            :         ToolBox                 m_aActions;
      94                 :            :         DbaIndexList            m_aIndexes;
      95                 :            :         FixedLine               m_aIndexDetails;
      96                 :            :         FixedText               m_aDescriptionLabel;
      97                 :            :         FixedText               m_aDescription;
      98                 :            :         CheckBox                m_aUnique;
      99                 :            :         FixedText               m_aFieldsLabel;
     100                 :            :         IndexFieldsControl*     m_pFields;
     101                 :            :         PushButton              m_aClose;
     102                 :            :         HelpButton              m_aHelp;
     103                 :            : 
     104                 :            :         OIndexCollection*       m_pIndexes;
     105                 :            :         SvLBoxEntry*            m_pPreviousSelection;
     106                 :            :         sal_Bool                m_bEditAgain;
     107                 :            : 
     108                 :            :         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
     109                 :            :                                 m_xORB;
     110                 :            :     public:
     111                 :            :         DbaIndexDialog(
     112                 :            :             Window* _pParent,
     113                 :            :             const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rFieldNames,
     114                 :            :             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxIndexes,
     115                 :            :             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
     116                 :            :             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
     117                 :            :             sal_Int32 _nMaxColumnsInIndex
     118                 :            :             );
     119                 :            :         virtual ~DbaIndexDialog();
     120                 :            : 
     121                 :            :         virtual void StateChanged( StateChangedType nStateChange );
     122                 :            :         virtual void DataChanged( const DataChangedEvent& rDCEvt );
     123                 :            : 
     124                 :            :         /** will be called whenthe id of the image list is needed.
     125                 :            :             @param  _eBitmapSet
     126                 :            :                 <svtools/imgdef.hxx>
     127                 :            :             @param  _bHiContast
     128                 :            :                 <TRUE/> when in high contrast mode.
     129                 :            :         */
     130                 :            :         virtual ImageList getImageList(sal_Int16 _eBitmapSet) const;
     131                 :            : 
     132                 :            :         /** will be called when the controls need to be resized.
     133                 :            :         */
     134                 :            :         virtual void resizeControls(const Size& _rDiff);
     135                 :            : 
     136                 :            :     protected:
     137                 :            :         void fillIndexList();
     138                 :            :         void updateToolbox();
     139                 :            :         void updateControls(const SvLBoxEntry* _pEntry);
     140                 :            : 
     141                 :            :     protected:
     142                 :            :         DECL_LINK( OnIndexSelected, DbaIndexList* );
     143                 :            :         DECL_LINK( OnIndexAction, ToolBox* );
     144                 :            :         DECL_LINK( OnEntryEdited, SvLBoxEntry* );
     145                 :            :         DECL_LINK( OnModified, void* );
     146                 :            :         DECL_LINK( OnCloseDialog, void* );
     147                 :            : 
     148                 :            :         DECL_LINK( OnEditIndexAgain, SvLBoxEntry* );
     149                 :            : 
     150                 :            :     private:
     151                 :            :         void OnNewIndex();
     152                 :            :         void OnDropIndex(sal_Bool _bConfirm = sal_True);
     153                 :            :         void OnRenameIndex();
     154                 :            :         void OnSaveIndex();
     155                 :            :         void OnResetIndex();
     156                 :            : 
     157                 :            :         sal_Bool implCommit(SvLBoxEntry* _pEntry);
     158                 :            :         sal_Bool implSaveModified(sal_Bool _bPlausibility = sal_True);
     159                 :            :         sal_Bool implCommitPreviouslySelected();
     160                 :            : 
     161                 :            :         sal_Bool implDropIndex(SvLBoxEntry* _pEntry, sal_Bool _bRemoveFromCollection);
     162                 :            : 
     163                 :            :         sal_Bool implCheckPlausibility(const ConstIndexesIterator& _rPos);
     164                 :            : 
     165                 :            :         /** checks if the controls have to be replaced and moved.
     166                 :            :         */
     167                 :            :         void checkControls();
     168                 :            :     };
     169                 :            : 
     170                 :            : //......................................................................
     171                 :            : }   // namespace dbaui
     172                 :            : //......................................................................
     173                 :            : 
     174                 :            : #endif // _DBAUI_INDEXDIALOG_HXX_
     175                 :            : 
     176                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10