LCOV - code coverage report
Current view: top level - basctl/source/basicide - moduldlg.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 14 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 12 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             : 
      20             : #ifndef INCLUDED_BASCTL_SOURCE_BASICIDE_MODULDLG_HXX
      21             : #define INCLUDED_BASCTL_SOURCE_BASICIDE_MODULDLG_HXX
      22             : 
      23             : #include <bastype2.hxx>
      24             : #include <svtools/svtabbx.hxx>
      25             : #include <vcl/layout.hxx>
      26             : #include <vcl/lstbox.hxx>
      27             : #include <vcl/tabctrl.hxx>
      28             : #include <vcl/tabdlg.hxx>
      29             : #include <vcl/tabpage.hxx>
      30             : #include <com/sun/star/task/XInteractionHandler.hpp>
      31             : 
      32             : class SvxPasswordDialog;
      33             : 
      34             : namespace basctl
      35             : {
      36             : 
      37             : namespace ObjectMode
      38             : {
      39             :     enum Mode
      40             :     {
      41             :         Library = 1,
      42             :         Module  = 2,
      43             :         Dialog  = 3,
      44             :         Method  = 4,
      45             :     };
      46             : }
      47             : 
      48             : class NewObjectDialog : public ModalDialog
      49             : {
      50             : private:
      51             :     VclPtr<Edit>           m_pEdit;
      52             :     VclPtr<OKButton>       m_pOKButton;
      53             : 
      54             :     DECL_LINK(OkButtonHandler, void *);
      55             : public:
      56             :     NewObjectDialog (vcl::Window* pParent, ObjectMode::Mode, bool bCheckName = false);
      57             :     virtual ~NewObjectDialog();
      58             :     virtual void dispose() SAL_OVERRIDE;
      59           0 :     OUString GetObjectName() const { return m_pEdit->GetText(); }
      60           0 :     void SetObjectName( const OUString& rName )
      61             :     {
      62           0 :         m_pEdit->SetText( rName );
      63           0 :         m_pEdit->SetSelection(Selection( 0, rName.getLength()));
      64           0 :     }
      65             : };
      66             : 
      67             : class GotoLineDialog : public ModalDialog
      68             : {
      69             :     VclPtr<Edit>           m_pEdit;
      70             :     VclPtr<OKButton>       m_pOKButton;
      71             :     DECL_LINK(OkButtonHandler, void *);
      72             : public:
      73             :     explicit GotoLineDialog(vcl::Window * pParent);
      74             :     virtual ~GotoLineDialog();
      75             :     virtual void dispose() SAL_OVERRIDE;
      76             :     sal_Int32 GetLineNumber() const;
      77             : };
      78             : 
      79             : class ExportDialog : public ModalDialog
      80             : {
      81             : private:
      82             :     VclPtr<RadioButton>    m_pExportAsPackageButton;
      83             :     VclPtr<OKButton>       m_pOKButton;
      84             : 
      85             :     bool            mbExportAsPackage;
      86             : 
      87             :     DECL_LINK(OkButtonHandler, void *);
      88             : 
      89             : public:
      90             :     explicit ExportDialog( vcl::Window * pParent );
      91             :     virtual ~ExportDialog();
      92             :     virtual void dispose() SAL_OVERRIDE;
      93             : 
      94           0 :     bool isExportAsPackage () const { return mbExportAsPackage; }
      95             : };
      96             : 
      97             : 
      98           0 : class ExtTreeListBox : public TreeListBox
      99             : {
     100             : protected:
     101             :     virtual bool    EditingEntry( SvTreeListEntry* pEntry, Selection& rSel  ) SAL_OVERRIDE;
     102             :     virtual bool    EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText ) SAL_OVERRIDE;
     103             : 
     104             :     virtual DragDropMode    NotifyStartDrag( TransferDataContainer& rData, SvTreeListEntry* pEntry ) SAL_OVERRIDE;
     105             :     virtual bool            NotifyAcceptDrop( SvTreeListEntry* pEntry ) SAL_OVERRIDE;
     106             : 
     107             :     virtual TriState    NotifyMoving( SvTreeListEntry* pTarget, SvTreeListEntry* pEntry,
     108             :                         SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos ) SAL_OVERRIDE;
     109             :     virtual TriState    NotifyCopying( SvTreeListEntry* pTarget, SvTreeListEntry* pEntry,
     110             :                         SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos ) SAL_OVERRIDE;
     111             :     TriState            NotifyCopyingMoving( SvTreeListEntry* pTarget, SvTreeListEntry* pEntry,
     112             :                         SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos, bool bMove );
     113             : 
     114             : public:
     115             :     ExtTreeListBox(vcl::Window* pParent, WinBits nStyle);
     116             : };
     117             : 
     118             : class CheckBox : public SvTabListBox
     119             : {
     120             : private:
     121             :     ObjectMode::Mode    eMode;
     122             :     SvLBoxButtonData*   pCheckButton;
     123             :     ScriptDocument      m_aDocument;
     124             :     void                Init();
     125             : 
     126             : public:
     127             :     CheckBox(vcl::Window* pParent, WinBits nStyle);
     128             :     virtual ~CheckBox();
     129             :     virtual void    dispose() SAL_OVERRIDE;
     130             : 
     131             :     SvTreeListEntry*    DoInsertEntry( const OUString& rStr, sal_uLong nPos = LISTBOX_APPEND );
     132             :     SvTreeListEntry*    FindEntry( const OUString& rName );
     133             : 
     134             :     void            CheckEntryPos( sal_uLong nPos );
     135             :     bool            IsChecked( sal_uLong nPos ) const;
     136             : 
     137             :     virtual void    InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind eButtonKind) SAL_OVERRIDE;
     138             :     virtual bool    EditingEntry( SvTreeListEntry* pEntry, Selection& rSel ) SAL_OVERRIDE;
     139             :     virtual bool    EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewText ) SAL_OVERRIDE;
     140             : 
     141           0 :     void            SetDocument( const ScriptDocument& rDocument ) { m_aDocument = rDocument; }
     142             : 
     143             :     void            SetMode (ObjectMode::Mode);
     144             :     ObjectMode::Mode GetMode () const { return eMode; }
     145             : };
     146             : 
     147             : class LibDialog: public ModalDialog
     148             : {
     149             : private:
     150             :     VclPtr<VclFrame>       m_pStorageFrame;
     151             :     VclPtr<CheckBox>       m_pLibBox;
     152             :     VclPtr< ::CheckBox>       m_pReferenceBox;
     153             :     VclPtr< ::CheckBox>       m_pReplaceBox;
     154             : 
     155             : public:
     156             :     explicit LibDialog(vcl::Window* pParent);
     157             :     virtual ~LibDialog();
     158             :     virtual void dispose() SAL_OVERRIDE;
     159             : 
     160             :     void            SetStorageName( const OUString& rName );
     161             : 
     162           0 :     CheckBox&       GetLibBox()                 { return *m_pLibBox; }
     163           0 :     bool            IsReference() const         { return m_pReferenceBox->IsChecked(); }
     164           0 :     bool            IsReplace() const           { return m_pReplaceBox->IsChecked(); }
     165             : 
     166           0 :     void            EnableReference (bool b)    { m_pReferenceBox->Enable(b); }
     167             :     void            EnableReplace (bool b)      { m_pReplaceBox->Enable(b); }
     168             : };
     169             : 
     170             : class OrganizeDialog : public TabDialog
     171             : {
     172             : private:
     173             :     VclPtr<TabControl> m_pTabCtrl;
     174             :     EntryDescriptor    m_aCurEntry;
     175             : 
     176             : public:
     177             :     OrganizeDialog( vcl::Window* pParent, sal_Int16 tabId, EntryDescriptor& rDesc );
     178             :     virtual ~OrganizeDialog();
     179             :     virtual void    dispose() SAL_OVERRIDE;
     180             : 
     181             :     virtual short   Execute() SAL_OVERRIDE;
     182             : 
     183             :     DECL_LINK( ActivatePageHdl, TabControl * );
     184             : };
     185             : 
     186             : class ObjectPage: public TabPage
     187             : {
     188             : protected:
     189             :     VclPtr<ExtTreeListBox>     m_pBasicBox;
     190             :     VclPtr<PushButton>         m_pEditButton;
     191             :     VclPtr<PushButton>         m_pNewModButton;
     192             :     VclPtr<PushButton>         m_pNewDlgButton;
     193             :     VclPtr<PushButton>         m_pDelButton;
     194             : 
     195             :     DECL_LINK( BasicBoxHighlightHdl, TreeListBox * );
     196             :     DECL_LINK( ButtonHdl, Button * );
     197             :     void                CheckButtons();
     198             :     bool                GetSelection( ScriptDocument& rDocument, OUString& rLibName );
     199             :     void                DeleteCurrent();
     200             :     void                NewModule();
     201             :     void                NewDialog();
     202             :     void                EndTabDialog( sal_uInt16 nRet );
     203             : 
     204             :     VclPtr<TabDialog>          pTabDlg;
     205             : 
     206             :     virtual void        ActivatePage() SAL_OVERRIDE;
     207             :     virtual void        DeactivatePage() SAL_OVERRIDE;
     208             : 
     209             : public:
     210             :     ObjectPage(vcl::Window* pParent, const OString& rName, sal_uInt16 nMode);
     211             :     virtual ~ObjectPage();
     212             :     virtual void dispose() SAL_OVERRIDE;
     213             : 
     214             :     void                SetCurrentEntry( EntryDescriptor& rDesc );
     215           0 :     void                SetTabDlg( TabDialog* p ) { pTabDlg = p;}
     216             : };
     217             : 
     218             : 
     219             : class LibPage: public TabPage
     220             : {
     221             : protected:
     222             :     VclPtr<ListBox>            m_pBasicsBox;
     223             :     VclPtr<CheckBox>           m_pLibBox;
     224             :     VclPtr<PushButton>         m_pEditButton;
     225             :     VclPtr<PushButton>         m_pPasswordButton;
     226             :     VclPtr<PushButton>         m_pNewLibButton;
     227             :     VclPtr<PushButton>         m_pInsertLibButton;
     228             :     VclPtr<PushButton>         m_pExportButton;
     229             :     VclPtr<PushButton>         m_pDelButton;
     230             : 
     231             :     ScriptDocument      m_aCurDocument;
     232             :     LibraryLocation     m_eCurLocation;
     233             : 
     234             :     DECL_LINK( TreeListHighlightHdl, SvTreeListBox * );
     235             :     DECL_LINK( BasicSelectHdl, ListBox * );
     236             :     DECL_LINK( ButtonHdl, Button * );
     237             :     DECL_LINK( CheckPasswordHdl, SvxPasswordDialog * );
     238             :     void                CheckButtons();
     239             :     void                DeleteCurrent();
     240             :     void                NewLib();
     241             :     void                InsertLib();
     242             :     void                implExportLib( const OUString& aLibName, const OUString& aTargetURL,
     243             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler );
     244             :     void                Export();
     245             :     void                ExportAsPackage( const OUString& aLibName );
     246             :     void                ExportAsBasic( const OUString& aLibName );
     247             :     void                EndTabDialog( sal_uInt16 nRet );
     248             :     void                FillListBox();
     249             :     void                InsertListBoxEntry( const ScriptDocument& rDocument, LibraryLocation eLocation );
     250             :     void                SetCurLib();
     251             :     SvTreeListEntry*        ImpInsertLibEntry( const OUString& rLibName, sal_uLong nPos );
     252             :     virtual void        ActivatePage() SAL_OVERRIDE;
     253             :     virtual void        DeactivatePage() SAL_OVERRIDE;
     254             : 
     255             :     VclPtr<TabDialog>          pTabDlg;
     256             : 
     257             : public:
     258             :     explicit LibPage(vcl::Window* pParent);
     259             :     virtual             ~LibPage();
     260             :     virtual void        dispose() SAL_OVERRIDE;
     261             : 
     262           0 :     void                SetTabDlg( TabDialog* p ) { pTabDlg = p;}
     263             : };
     264             : 
     265             : // Helper functions
     266             : SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
     267             :     TreeListBox& rBasicBox, const OUString& rLibName, const OUString& aModName, bool bMain = false );
     268             : void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
     269             :                     CheckBox* pLibBox, TreeListBox* pBasicBox );
     270             : 
     271             : } // namespace basctl
     272             : 
     273             : #endif // INCLUDED_BASCTL_SOURCE_BASICIDE_MODULDLG_HXX
     274             : 
     275             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11