LCOV - code coverage report
Current view: top level - sfx2/inc - templatedlg.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 1 0.0 %
Date: 2014-04-11 Functions: 0 1 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             : 
      10             : #ifndef INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
      11             : #define INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
      12             : 
      13             : #include <set>
      14             : 
      15             : #include <vcl/dialog.hxx>
      16             : #include <vcl/button.hxx>
      17             : #include <vcl/tabctrl.hxx>
      18             : #include <vcl/tabpage.hxx>
      19             : #include <com/sun/star/frame/XDesktop2.hpp>
      20             : 
      21             : #include <sfx2/templateabstractview.hxx>
      22             : 
      23             : class Edit;
      24             : class PopupMenu;
      25             : class SfxTemplateInfoDlg;
      26             : class TemplateAbstractView;
      27             : class TemplateLocalView;
      28             : class TemplateRemoteView;
      29             : class TemplateRepository;
      30             : class TemplateSearchView;
      31             : class ThumbnailView;
      32             : class ThumbnailViewItem;
      33             : class ToolBox;
      34             : 
      35             : namespace com {
      36             :     namespace sun { namespace star { namespace frame {
      37             :         class XComponentLoader;
      38             :         class XModel;
      39             :     }   }   }
      40             : }
      41             : 
      42             : class SfxTemplateManagerDlg : public ModelessDialog
      43             : {
      44             :     typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*,const ThumbnailViewItem*);
      45             : 
      46             : public:
      47             : 
      48             :     SfxTemplateManagerDlg (Window *parent = DIALOG_NO_PARENT);
      49             : 
      50             :     virtual ~SfxTemplateManagerDlg ();
      51             : 
      52             :     void setSaveMode();
      53             : 
      54             :     void setDocumentModel (const com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel);
      55             : 
      56             :     DECL_LINK(ActivatePageHdl, void*);
      57             : 
      58             : private:
      59             : 
      60             :     void readSettings ();
      61             : 
      62             :     void writeSettings ();
      63             : 
      64             :     DECL_LINK(TBXViewHdl, void*);
      65             :     DECL_LINK(TBXActionHdl, void*);
      66             :     DECL_LINK(TBXTemplateHdl, void*);
      67             :     DECL_LINK(TBXDropdownHdl, ToolBox*);
      68             : 
      69             :     DECL_LINK(TVItemStateHdl, const ThumbnailViewItem*);
      70             : 
      71             :     DECL_LINK(MenuSelectHdl, Menu*);
      72             :     DECL_LINK(MoveMenuSelectHdl, Menu*);
      73             :     DECL_LINK(RepositoryMenuSelectHdl, Menu*);
      74             :     DECL_LINK(DefaultTemplateMenuSelectHdl, Menu*);
      75             : 
      76             :     DECL_LINK(OpenRegionHdl, void*);
      77             :     DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*);
      78             : 
      79             :     DECL_LINK(SearchUpdateHdl, void*);
      80             : 
      81             :     void OnTemplateImport ();
      82             :     void OnTemplateSearch ();
      83             :     void OnTemplateLink ();
      84             :     void OnTemplateOpen ();
      85             :     void OnTemplateEdit ();
      86             :     void OnTemplateProperties ();
      87             :     void OnTemplateDelete ();
      88             :     void OnTemplateAsDefault ();
      89             :     void OnTemplateExport ();
      90             : 
      91             :     void OnTemplateState (const ThumbnailViewItem *pItem);
      92             : 
      93             :     void OnFolderNew ();
      94             :     void OnFolderDelete ();
      95             : 
      96             :     void OnRegionState (const ThumbnailViewItem *pItem);
      97             : 
      98             :     void OnRepositoryDelete ();
      99             :     void OnTemplateSaveAs ();
     100             : 
     101             :     void createRepositoryMenu ();
     102             : 
     103             :     void createDefaultTemplateMenu ();
     104             : 
     105             :     // Exchange view between local/online view.
     106             :     void switchMainView (bool bDisplayLocal);
     107             : 
     108             :     /**
     109             :      *
     110             :      * Move templates stored in the filesystem to another folder.
     111             :      *
     112             :      **/
     113             : 
     114             :     void localMoveTo (sal_uInt16 nMenuId);
     115             : 
     116             :     void remoteMoveTo (const sal_uInt16 nMenuId);
     117             : 
     118             :     /**
     119             :      *
     120             :      * Move search result templates stored in the filesystem to another folder.
     121             :      *
     122             :      **/
     123             : 
     124             :     void localSearchMoveTo (sal_uInt16 nMenuId);
     125             : 
     126             :     // Remote repositories handling methods
     127             :     void loadRepositories ();
     128             : 
     129           0 :     const std::vector<TemplateRepository*>& getRepositories () const { return maRepositories; }
     130             : 
     131             :     bool insertRepository (const OUString &rName, const OUString &rURL);
     132             : 
     133             :     bool deleteRepository (const sal_uInt16 nRepositoryId);
     134             : 
     135             :     void syncRepositories () const;
     136             : 
     137             :     /// Return filter according to the currently selected tab page.
     138             :     FILTER_APPLICATION getCurrentFilter();
     139             : 
     140             : private:
     141             : 
     142             :     TabControl *mpTabControl;
     143             : 
     144             :     Edit *mpSearchEdit;
     145             :     ToolBox *mpViewBar;
     146             :     ToolBox *mpActionBar;
     147             :     ToolBox *mpTemplateBar;
     148             :     TemplateSearchView *mpSearchView;
     149             :     TemplateAbstractView *mpCurView;
     150             :     TemplateLocalView *mpLocalView;
     151             :     TemplateRemoteView *mpRemoteView;
     152             :     PopupMenu *mpActionMenu;
     153             :     PopupMenu *mpRepositoryMenu;
     154             :     PopupMenu *mpTemplateDefaultMenu;
     155             : 
     156             :     std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelTemplates;
     157             :     std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelFolders;
     158             : 
     159             :     bool mbIsSaveMode;  ///< Flag that indicates if we are in save mode or not.
     160             :     com::sun::star::uno::Reference< com::sun::star::frame::XModel > m_xModel;
     161             :     com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2 > mxDesktop;
     162             : 
     163             :     bool mbIsSynced; ///< Tells whether maRepositories is synchronized with the user config
     164             :     std::vector<TemplateRepository*> maRepositories; ///< Stores the remote repositories for templates
     165             : };
     166             : 
     167             : #endif // INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
     168             : 
     169             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10