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

Generated by: LCOV version 1.10