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

Generated by: LCOV version 1.10