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

Generated by: LCOV version 1.10